![]() |
![]() |
![]() |
COGL Reference Manual | ![]() |
---|---|---|---|---|
Top | Description |
Offscreen BuffersOffscreen Buffers — Fuctions for creating and manipulating offscreen frame buffer objects |
CoglHandle cogl_offscreen_new_to_texture (CoglHandle handle); CoglHandle cogl_offscreen_ref (CoglHandle handle); void cogl_offscreen_unref (CoglHandle handle); gboolean cogl_is_offscreen (CoglHandle handle); void cogl_set_draw_buffer (CoglBufferTarget target, CoglHandle offscreen); void cogl_pop_draw_buffer (void); void cogl_push_draw_buffer (void);
CoglHandle cogl_offscreen_new_to_texture (CoglHandle handle);
This creates an offscreen buffer object using the given texture as the primary color buffer. It doesn't just initialize the contents of the offscreen buffer with the texture; they are tightly bound so that drawing to the offscreen buffer effectivly updates the contents of the given texture. You don't need to destroy the offscreen buffer before you can use the texture again.
Note: This does not work with sliced Cogl textures.
|
A CoglHandle for a Cogl texture |
Returns : |
a CoglHandle for the new offscreen buffer or COGL_INVALID_HANDLE
if it wasn't possible to create the buffer.
|
CoglHandle cogl_offscreen_ref (CoglHandle handle);
Increments the reference count on the offscreen buffer.
|
A CoglHandle for an offscreen buffer |
Returns : |
For convenience it returns the given CoglHandle |
void cogl_offscreen_unref (CoglHandle handle);
Decreases the reference count for the offscreen buffer and frees it when the count reaches 0.
|
A CoglHandle for an offscreen buffer |
gboolean cogl_is_offscreen (CoglHandle handle);
Gets whether the given handle references an existing offscreen buffer object.
|
A CoglHandle for an offscreen buffer |
Returns : |
TRUE if the handle references an offscreen buffer,
FALSE otherwise
|
void cogl_set_draw_buffer (CoglBufferTarget target, CoglHandle offscreen);
This redirects all subsequent drawing to the specified draw buffer. This
can either be an offscreen buffer created with
cogl_offscreen_new_to_texture()
or you can revert to your original
on screen window buffer.
|
A CoglBufferTarget that specifies what kind of draw buffer you are setting as the render target. |
|
If you are setting a draw buffer of type COGL_OFFSCREEN_BUFFER then this is a CoglHandle for the offscreen buffer. |