Cogl.GLES2Context.new
function new(ctx: Cogl.Context): Cogl.GLES2Context { // Gjs wrapper for cogl_gles2_context_new() }
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.prototype.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.
<note>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.</note>
Since 2.0
- ctx
- Returns
A newly allocated Cogl.GLES2Context or null if there was an error and @error will be updated in that case.