Cogl 2.0 Reference Manual | ||||
---|---|---|---|---|
Top | Description |
Offscreen FramebuffersOffscreen Framebuffers — Functions for creating and manipulating offscreen framebuffers. |
CoglOffscreen; CoglBool cogl_is_offscreen (void *object
); CoglOffscreen * cogl_offscreen_new_with_texture (CoglTexture *texture
);
CoglBool cogl_is_offscreen (void *object
);
Determines whether the given CoglObject references an offscreen framebuffer object.
|
A pointer to a CoglObject |
Returns : |
TRUE if object is a CoglOffscreen framebuffer,
FALSE otherwise |
CoglOffscreen * cogl_offscreen_new_with_texture (CoglTexture *texture
);
This creates an offscreen framebuffer 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 effectively
updates the contents of the given texture. You don't need to
destroy the offscreen buffer before you can use the texture
again.
The storage for the framebuffer is actually allocated lazily
so this function will never return NULL
to indicate a runtime
error. This means it is still possible to configure the framebuffer
before it is really allocated.
Simple applications without full error handling can simply rely on
Cogl to lazily allocate the storage of framebuffers but you should
be aware that if Cogl encounters an error (such as running out of
GPU memory) then your application will simply abort with an error
message. If you need to be able to catch such exceptions at runtime
then you can explicitly allocate your framebuffer when you have
finished configuring it by calling cogl_framebuffer_allocate()
and
passing in a CoglError argument to catch any exceptions.
|
A CoglTexture pointer |
Returns : |
a newly instantiated CoglOffscreen framebuffer. [transfer full] |