Adds gles2-context renderer constraint
This adds a new renderer constraint enum: COGL_RENDERER_CONSTRAINT_SUPPORTS_GLES2_CONTEXT that can be used by applications to ensure the renderer they connect to has support for creating a GLES2 context via cogl_gles2_context_new(). The cogl-gles2-context and cogl-gles2-gears examples and the conformance tests have been updated to use this constraint. Reviewed-by: Neil Roberts <neil@linux.intel.com> (cherry picked from commit ed61463d7194354b26624e8014859f0fbfc06a12)
This commit is contained in:
@@ -79,8 +79,14 @@ main (int argc, char **argv)
|
||||
};
|
||||
GSource *cogl_source;
|
||||
GMainLoop *loop;
|
||||
CoglRenderer *renderer;
|
||||
CoglDisplay *display;
|
||||
|
||||
data.ctx = cogl_context_new (NULL, NULL);
|
||||
renderer = cogl_renderer_new ();
|
||||
cogl_renderer_add_constraint (renderer,
|
||||
COGL_RENDERER_CONSTRAINT_SUPPORTS_COGL_GLES2);
|
||||
display = cogl_display_new (renderer, NULL);
|
||||
data.ctx = cogl_context_new (display, NULL);
|
||||
|
||||
onscreen = cogl_onscreen_new (data.ctx, 640, 480);
|
||||
cogl_onscreen_show (onscreen);
|
||||
|
@@ -758,8 +758,14 @@ main (int argc, char **argv)
|
||||
GError *error = NULL;
|
||||
GSource *cogl_source;
|
||||
GMainLoop *loop;
|
||||
CoglRenderer *renderer;
|
||||
CoglDisplay *display;
|
||||
|
||||
data.ctx = cogl_context_new (NULL, NULL);
|
||||
renderer = cogl_renderer_new ();
|
||||
cogl_renderer_add_constraint (renderer,
|
||||
COGL_RENDERER_CONSTRAINT_SUPPORTS_COGL_GLES2);
|
||||
display = cogl_display_new (renderer, NULL);
|
||||
data.ctx = cogl_context_new (display, NULL);
|
||||
|
||||
onscreen = cogl_onscreen_new (data.ctx, 300, 300);
|
||||
cogl_onscreen_show (onscreen);
|
||||
|
Reference in New Issue
Block a user