## OpenGL Window

OpenGL Window — OpenGL window which is located on-screen

## Synopsis

    #include <gdk/gdkgl.h>

                GdkGLWindow;
    GdkGLWindow* gdk_gl_window_new              (GdkGLConfig *glconfig,
                                                 GdkWindow *window,
                                                 const int *attrib_list);
    void        gdk_gl_window_destroy           (GdkGLWindow *glwindow);
    GdkWindow*  gdk_gl_window_get_window        (GdkGLWindow *glwindow);
    GdkGLWindow* gdk_window_set_gl_capability   (GdkWindow *window,
                                                 GdkGLConfig *glconfig,
                                                 const int *attrib_list);
    void        gdk_window_unset_gl_capability  (GdkWindow *window);
    gboolean    gdk_window_is_gl_capable        (GdkWindow *window);
    GdkGLWindow* gdk_window_get_gl_window       (GdkWindow *window);
    #define     gdk_window_get_gl_drawable      (window)

## Object Hierarchy

      GObject
       +----GdkDrawable
             +----GdkGLWindow

## Description

## Details

### GdkGLWindow

    typedef struct _GdkGLWindow GdkGLWindow;

### gdk_gl_window_new ()

    GdkGLWindow* gdk_gl_window_new              (GdkGLConfig *glconfig,
                                                 GdkWindow *window,
                                                 const int *attrib_list);

Creates an on-screen rendering area. attrib_list is currently unused. This must be set to NULL or empty (first attribute of None). See GLX 1.3 spec.

`glconfig` : | a GdkGLConfig.
`window` : | the GdkWindow to be used as the rendering area.
`attrib_list` : | this must be set to NULL or empty (first attribute of None).
Returns : | the new GdkGLWindow.

### gdk_gl_window_destroy ()

    void        gdk_gl_window_destroy           (GdkGLWindow *glwindow);

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

`glwindow` : | a GdkGLWindow.

### gdk_gl_window_get_window ()

    GdkWindow*  gdk_gl_window_get_window        (GdkGLWindow *glwindow);

Returns the GdkWindow associated with `glwindow`.

Notice that GdkGLWindow is not GdkWindow, but another GdkDrawable which have an associated GdkWindow.

`glwindow` : | a GdkGLWindow.
Returns : | the GdkWindow associated with `glwindow`.

### gdk_window_set_gl_capability ()

    GdkGLWindow* gdk_window_set_gl_capability   (GdkWindow *window,
                                                 GdkGLConfig *glconfig,
                                                 const int *attrib_list);

Set the OpenGL-capability to the `window`. This function creates a new GdkGLWindow held by the `window`. attrib_list is currently unused. This must be set to NULL or empty (first attribute of None).

`window` : | the GdkWindow to be used as the rendering area.
`glconfig` : | a GdkGLConfig.
`attrib_list` : | this must be set to NULL or empty (first attribute of None).
Returns : | the GdkGLWindow used by the `window` if it is successful, NULL otherwise.

### gdk_window_unset_gl_capability ()

    void        gdk_window_unset_gl_capability  (GdkWindow *window);

Unset the OpenGL-capability of the `window`. This function destroys the GdkGLWindow held by the `window`.

`window` : | a GdkWindow.

### gdk_window_is_gl_capable ()

    gboolean    gdk_window_is_gl_capable        (GdkWindow *window);

Returns whether the `window` is OpenGL-capable.

`window` : | a GdkWindow.
Returns : | TRUE if the `window` is OpenGL-capable, FALSE otherwise.

### gdk_window_get_gl_window ()

    GdkGLWindow* gdk_window_get_gl_window       (GdkWindow *window);

Returns the GdkGLWindow held by the `window`.

`window` : | a GdkWindow.
Returns : | the GdkGLWindow.

### gdk_window_get_gl_drawable()

    #define     gdk_window_get_gl_drawable(window)

Returns the GdkGLDrawable held by the `window`. In fact, this is macro that casts the result of gdk_window_get_gl_window to GdkGLDrawable.

`window` : | a GdkGLWindow.
Returns : | the GdkGLDrawable.