## Rendering Context Rendering Context — OpenGL rendering context object |

## Functions

GdkGLContext * | gdk_gl_context_new ()
void | gdk_gl_context_destroy ()
gboolean | gdk_gl_context_copy ()
GdkGLDrawable * | gdk_gl_context_get_gl_drawable ()
GdkGLConfig * | gdk_gl_context_get_gl_config ()
GdkGLContext * | gdk_gl_context_get_share_list ()
gboolean | gdk_gl_context_is_direct ()
int | gdk_gl_context_get_render_type ()
GdkGLContext * | gdk_gl_context_get_current ()

## Types and Values

| GdkGLContext

## Object Hierarchy

        GObject
        ╰── GdkGLContext

## Includes

    #include <gdk/gdkgl.h>

## Description

## Functions

### gdk_gl_context_new ()

    GdkGLContext *
    gdk_gl_context_new (GdkGLDrawable *gldrawable,
                        GdkGLContext *share_list,
                        gboolean direct,
                        int render_type);

Creates a new OpenGL rendering context.

#### Parameters

gldrawable | a GdkGLDrawable. |
share_list | the GdkGLContext with which to share display lists and texture objects. NULL indicates that no sharing is to take place. |
direct | whether rendering is to be done with a direct connection to the graphics system. |
render_type | GDK_GL_RGBA_TYPE or GDK_GL_COLOR_INDEX_TYPE (currently not used). |

#### Returns

the new GdkGLContext.

### gdk_gl_context_destroy ()

    void
    gdk_gl_context_destroy (GdkGLContext *glcontext);

Destroys the OpenGL resources associated with `glcontext` and decrements `glcontext` 's reference count.

#### Parameters

glcontext | a GdkGLContext. |

### gdk_gl_context_copy ()

    gboolean
    gdk_gl_context_copy (GdkGLContext *glcontext,
                         GdkGLContext *src,
                         unsigned long  mask);

Copy state from `src` rendering context to `glcontext` .

`mask` contains the bitwise-OR of the same symbolic names that are passed to the `glPushAttrib()` function. You can use GL_ALL_ATTRIB_BITS to copy all the rendering state information.

#### Parameters

glcontext | a GdkGLContext. |
src | the source context. |
mask | which portions of `src` state are to be copied to `glcontext` . |

#### Returns

FALSE if it fails, TRUE otherwise.

### gdk_gl_context_get_gl_drawable ()

    GdkGLDrawable *
    gdk_gl_context_get_gl_drawable (GdkGLContext *glcontext);

Gets GdkGLDrawable to which the `glcontext` is bound.

#### Parameters

glcontext | a GdkGLContext. |

#### Returns

the GdkGLDrawable or NULL if no GdkGLDrawable is bound.

### gdk_gl_context_get_gl_config ()

    GdkGLConfig *
    gdk_gl_context_get_gl_config (GdkGLContext *glcontext);

Gets GdkGLConfig with which the `glcontext` is configured.

#### Parameters

glcontext | a GdkGLContext. |

#### Returns

the GdkGLConfig.

### gdk_gl_context_get_share_list ()

    GdkGLContext *
    gdk_gl_context_get_share_list (GdkGLContext *glcontext);

Gets GdkGLContext with which the `glcontext` shares the display lists and texture objects.

#### Parameters

glcontext | a GdkGLContext. |

#### Returns

the GdkGLContext.

### gdk_gl_context_is_direct ()

    gboolean
    gdk_gl_context_is_direct (GdkGLContext *glcontext);

Returns whether the `glcontext` is a direct rendering context.

#### Parameters

glcontext | a GdkGLContext. |

#### Returns

TRUE if the `glcontext` is a direct rendering contest.

### gdk_gl_context_get_render_type ()

    int
    gdk_gl_context_get_render_type (GdkGLContext *glcontext);

Gets render_type of the `glcontext` .

#### Parameters

glcontext | a GdkGLContext. |

#### Returns

GDK_GL_RGBA_TYPE or GDK_GL_COLOR_INDEX_TYPE.

### gdk_gl_context_get_current ()

    GdkGLContext *
    gdk_gl_context_get_current (void);

Returns the current GdkGLContext.

#### Returns

the current GdkGLContext or NULL if there is no current context.

## Types and Values

### GdkGLContext

    typedef struct _GdkGLContext GdkGLContext;