Cogl.GLES2Context

g Cogl.GLES2Context Cogl.GLES2Context Cogl.Object Cogl.Object Cogl.Object->Cogl.GLES2Context

Subclasses:None

Methods

Inherited:Cogl.Object (2)
class new (ctx)
  get_vtable ()

Virtual Methods

None

Fields

None

Class Details

class Cogl.GLES2Context
Bases:Cogl.Object
Abstract:No

Represents an OpenGLES 2.0 api context used as a sandbox for OpenGLES 2.0 state. This is comparable to an EGLContext for those who have used OpenGLES 2.0 with EGL before.

New in version 1.12.

classmethod new(ctx)
Parameters:ctx (Cogl.Context) – A Cogl.Context
Raises:GLib.Error
Returns:A newly allocated Cogl.GLES2Context or None if there was an error and error will be updated in that case.
Return type:Cogl.GLES2Context

Allocates a new OpenGLES 2.0 context that can be used to render to #CoglOffscreen framebuffers (Rendering to Cogl.Onscreen framebuffers is not currently supported).

To actually access the OpenGLES 2.0 api itself you need to use Cogl.GLES2Context.get_vtable(). You should not try to directly link to and use the symbols provided by the a system OpenGLES 2.0 driver.

Once you have allocated an OpenGLES 2.0 context you can make it current using Cogl.push_gles2_context(). For those familiar with using the EGL api, this serves a similar purpose to eglMakeCurrent.

Before using this api applications can check for OpenGLES 2.0 api support by checking for Cogl.FeatureID.OGL_FEATURE_ID_GLES2_CONTEXT support with Cogl.has_feature(). This function will return False and return an Cogl.GLES2ContextError.UNSUPPORTED error if the feature isn’t available.

New in version 2.0.

get_vtable()
Returns:A pointer to a Cogl.GLES2Vtable providing pointers to functions for the full OpenGLES 2.0 api.
Return type:Cogl.GLES2Vtable

Queries the OpenGLES 2.0 api function pointers that should be used for rendering with the given self.

You should not try to directly link to and use the symbols provided by any system OpenGLES 2.0 driver.

New in version 2.0.