Cogl.Offscreen

g Cogl.Offscreen Cogl.Offscreen

Subclasses:

None

Methods

class

new_to_texture (texture)

class

new_with_texture (texture)

class

ref (offscreen)

class

unref (offscreen)

Virtual Methods

None

Fields

None

Class Details

class Cogl.Offscreen
Abstract:

No

classmethod new_to_texture(texture)
Parameters:

texture (Cogl.Texture) – A Cogl.Texture pointer

Returns:

a newly instantiated Cogl.Offscreen framebuffer or None if it wasn’t possible to create the buffer.

Return type:

Cogl.Offscreen

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.

This only works with low-level Cogl.Texture types such as #CoglTexture2D, #CoglTexture3D and #CoglTextureRectangle, and not with meta-texture types such as #CoglTexture2DSliced.

Deprecated since version 1.16: Use Cogl.Offscreen.new_with_texture instead.

classmethod new_with_texture(texture)
Parameters:

texture (Cogl.Texture) – A Cogl.Texture pointer

Returns:

a newly instantiated Cogl.Offscreen framebuffer.

Return type:

Cogl.Offscreen

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.

This api only works with low-level Cogl.Texture types such as #CoglTexture2D, #CoglTexture3D and #CoglTextureRectangle, and not with meta-texture types such as #CoglTexture2DSliced. The storage for the framebuffer is actually allocated lazily so this function will never return None 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.

classmethod ref(offscreen)
Parameters:

offscreen (object or None) – A pointer to a Cogl.Offscreen framebuffer

Returns:

For convenience it returns the given offscreen

Return type:

object or None

Increments the reference count on the offscreen framebuffer.

Deprecated since version 1.2: cogl_object_ref() should be used in new code.

classmethod unref(offscreen)
Parameters:

offscreen (object or None) – A pointer to a Cogl.Offscreen framebuffer

Decreases the reference count for the offscreen buffer and frees it when the count reaches 0.

Deprecated since version 1.2: cogl_object_unref() should be used in new code.