Cogl.Onscreen
Description: Reference for Cogl.Onscreen

### Class

# CoglOnscreen

#### Description

    class Cogl.Onscreen : Cogl.Framebuffer {
      parent_instance: CoglFramebuffer
    }

No description available.

#### Ancestors

- CoglFramebuffer
- GObject

#### Instance methods

###### cogl_onscreen_add_dirty_callback

Installs a `callback` function that will be called whenever the window system has lost the contents of a region of the onscreen buffer and the application should redraw it to repair the buffer. For example this may happen in a window system without a compositor if a window that was previously covering up the onscreen window has been moved causing a region of the onscreen to be exposed.

Available since: 1.16

###### cogl_onscreen_add_frame_callback

Installs a `callback` function that will be called for significant events relating to the given `onscreen` framebuffer.

Available since: 1.14

###### cogl_onscreen_add_frame_info

No description available.

###### cogl_onscreen_direct_scanout

No description available.

###### cogl_onscreen_get_buffer_age

Gets the current age of the buffer contents.

Available since: 1.14

###### cogl_onscreen_get_frame_counter

Gets the value of the framebuffers frame counter. This is a counter that increases by one each time `cogl_onscreen_swap_buffers()` or `cogl_onscreen_swap_region()` is called.

Available since: 1.14

###### cogl_onscreen_hide

This requests to make `onscreen` invisible to the user.

Available since: 2.0

###### cogl_onscreen_queue_damage_region

Implementation for https://www.khronos.org/registry/EGL/extensions/KHR/EGL_KHR_partial_update.txt This immediately queues state to OpenGL that will be used for the next swap. This needs to be called every frame.

###### cogl_onscreen_remove_dirty_callback

Removes a callback and associated user data that were previously registered using cogl_onscreen_add_dirty_callback().

Available since: 1.16

###### cogl_onscreen_remove_frame_callback

Removes a callback and associated user data that were previously registered using cogl_onscreen_add_frame_callback().

Available since: 1.14

###### cogl_onscreen_show

This requests to make `onscreen` visible to the user.

Available since: 2.0

###### cogl_onscreen_swap_buffers

Swaps the current back buffer being rendered too, to the front for display.

Available since: 1.10

###### cogl_onscreen_swap_buffers_with_damage

Swaps the current back buffer being rendered too, to the front for display and provides information to any system compositor about what regions of the buffer have changed (damage) with respect to the last swapped buffer.

Available since: 1.16

###### cogl_onscreen_swap_region

Swaps a region of the back buffer being rendered too, to the front for display. `rectangles` represents the region as array of `n_rectangles` each defined by 4 sequential (x, y, width, height) integers.

Available since: 1.10

##### Methods inherited from CoglFramebuffer (59)

Please see CoglFramebuffer for a full list of methods.

##### Methods inherited from GObject (43)

Please see GObject for a full list of methods.

#### Properties

##### Properties inherited from CoglFramebuffer (4)

###### Cogl.Framebuffer:context

No description available.

###### Cogl.Framebuffer:driver-config

No description available.

###### Cogl.Framebuffer:height

No description available.

###### Cogl.Framebuffer:width

No description available.

#### Signals

##### Signals inherited from CoglFramebuffer (1)

###### Cogl.Framebuffer::destroy

No description available.

##### Signals inherited from GObject (1)

###### GObject.Object::notify

The notify signal is emitted on an object when one of its properties has its value set through g_object_set_property(), g_object_set(), et al.

#### Class structure

    struct CoglOnscreenClass {
      void (* bind) (
        CoglOnscreen* onscreen
      );
      void (* swap_buffers_with_damage) (
        CoglOnscreen* onscreen,
        const int* rectangles,
        int n_rectangles,
        CoglFrameInfo* info,
        gpointer user_data
      );
      void (* swap_region) (
        CoglOnscreen* onscreen,
        const int* rectangles,
        int n_rectangles,
        CoglFrameInfo* info,
        gpointer user_data
      );
      void (* queue_damage_region) (
        CoglOnscreen* onscreen,
        const int* rectangles,
        int n_rectangles
      );
      gboolean (* direct_scanout) (
        CoglOnscreen* onscreen,
        CoglScanout* scanout,
        CoglFrameInfo* info,
        gpointer user_data,
        GError** error
      );
      int (* get_buffer_age) (
        CoglOnscreen* onscreen
      );

    }

###### Class members

`bind` |
    void (* bind) (
        CoglOnscreen* onscreen
      )
| No description available.
`swap_buffers_with_damage` |
    void (* swap_buffers_with_damage) (
        CoglOnscreen* onscreen,
        const int* rectangles,
        int n_rectangles,
        CoglFrameInfo* info,
        gpointer user_data
      )
| No description available.
`swap_region` |
    void (* swap_region) (
        CoglOnscreen* onscreen,
        const int* rectangles,
        int n_rectangles,
        CoglFrameInfo* info,
        gpointer user_data
      )
| No description available.
`queue_damage_region` |
    void (* queue_damage_region) (
        CoglOnscreen* onscreen,
        const int* rectangles,
        int n_rectangles
      )
| No description available.
`direct_scanout` |
    gboolean (* direct_scanout) (
        CoglOnscreen* onscreen,
        CoglScanout* scanout,
        CoglFrameInfo* info,
        gpointer user_data,
        GError** error
      )
| No description available.
`get_buffer_age` |
    int (* get_buffer_age) (
        CoglOnscreen* onscreen
      )
| No description available.

#### Virtual methods

###### Cogl.OnscreenClass.bind

No description available.

###### Cogl.OnscreenClass.direct_scanout

No description available.

###### Cogl.OnscreenClass.get_buffer_age

Gets the current age of the buffer contents.

Available since: 1.14

###### Cogl.OnscreenClass.queue_damage_region

Implementation for https://www.khronos.org/registry/EGL/extensions/KHR/EGL_KHR_partial_update.txt This immediately queues state to OpenGL that will be used for the next swap. This needs to be called every frame.

###### Cogl.OnscreenClass.swap_buffers_with_damage

Swaps the current back buffer being rendered too, to the front for display and provides information to any system compositor about what regions of the buffer have changed (damage) with respect to the last swapped buffer.

Available since: 1.16

###### Cogl.OnscreenClass.swap_region

Swaps a region of the back buffer being rendered too, to the front for display. `rectangles` represents the region as array of `n_rectangles` each defined by 4 sequential (x, y, width, height) integers.

Available since: 1.10