Validate that the GL version is >= 1.2

There is a new internal Cogl function called _cogl_check_driver_valid
which looks at the value of the GL_VERSION string to determine whether
the driver is supported. Clutter now calls this after the stage is
realized. If it fails then the stage is marked as unrealized and a
warning is shown.

_cogl_features_init now also checks the version number before getting
the function pointers for glBlendFuncSeparate and
glBlendEquationSeparate. It is not safe to just check for the presence
of the functions because some drivers may define the function without
fully implementing the spec.

The GLES version of _cogl_check_driver_valid just always returns TRUE
because there are no version requirements yet.

Eventually the function could also check for mandatory extensions if
there were any.

http://bugzilla.openedhand.com/show_bug.cgi?id=1875
This commit is contained in:
Neil Roberts
2009-11-11 13:26:54 +00:00
parent 677ff9fb30
commit 568c29ba49
7 changed files with 133 additions and 13 deletions

View File

@ -323,12 +323,20 @@ _clutter_backend_create_context (ClutterBackend *backend,
return TRUE;
}
void
_clutter_backend_ensure_context_internal (ClutterBackend *backend,
ClutterStage *stage)
{
ClutterBackendClass *klass = CLUTTER_BACKEND_GET_CLASS (backend);
if (G_LIKELY (klass->ensure_context))
klass->ensure_context (backend, stage);
}
void
_clutter_backend_ensure_context (ClutterBackend *backend,
ClutterStage *stage)
{
static ClutterStage *current_context_stage = NULL;
ClutterBackendClass *klass;
g_return_if_fail (CLUTTER_IS_BACKEND (backend));
g_return_if_fail (CLUTTER_IS_STAGE (stage));
@ -354,9 +362,7 @@ _clutter_backend_ensure_context (ClutterBackend *backend,
new_stage);
}
klass = CLUTTER_BACKEND_GET_CLASS (backend);
if (G_LIKELY (klass->ensure_context))
klass->ensure_context (backend, new_stage);
_clutter_backend_ensure_context_internal (backend, new_stage);
/* XXX: Until Cogl becomes fully responsible for backend windows
* Clutter need to manually keep it informed of the current window size