2008-04-03 Emmanuele Bassi <ebassi@openedhand.com>
authorEmmanuele Bassi <ebassi@openedhand.com>
Thu, 3 Apr 2008 03:04:41 +0000 (03:04 +0000)
committerEmmanuele Bassi <ebassi@openedhand.com>
Thu, 3 Apr 2008 03:04:41 +0000 (03:04 +0000)
* clutter/glx/clutter-backend-glx.c:
(clutter_backend_glx_get_features): Assert if we don't have a
GL context here or if it's not matched to a drawable. Asserting
might seem too drastic, but if we don't have a valid GL context
here then Clutter will segfault anyway, and I'll take an assert()
over a hard to read, deep in GLX guts backtrace any day (and
twice on a monday).

* clutter/x11/clutter-backend-x11.c:
(clutter_backend_x11_get_features): No need for a variable here.

ChangeLog
clutter/glx/clutter-backend-glx.c
clutter/x11/clutter-backend-x11.c

index 1447aa3..f80cc0b 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,16 @@
+2008-04-03  Emmanuele Bassi  <ebassi@openedhand.com>
+
+       * clutter/glx/clutter-backend-glx.c:
+       (clutter_backend_glx_get_features): Assert if we don't have a
+       GL context here or if it's not matched to a drawable. Asserting
+       might seem too drastic, but if we don't have a valid GL context
+       here then Clutter will segfault anyway, and I'll take an assert()
+       over a hard to read, deep in GLX guts backtrace any day (and
+       twice on a monday).
+
+       * clutter/x11/clutter-backend-x11.c:
+       (clutter_backend_x11_get_features): No need for a variable here.
+
 2008-04-01  Matthew Allum  <mallum@openedhand.com>
 
        * clutter/clutter-backend.c:
index de6eaad..9d17252 100644 (file)
@@ -216,7 +216,11 @@ clutter_backend_glx_get_features (ClutterBackend *backend)
   const gchar        *glx_extensions = NULL;
   ClutterFeatureFlags flags = CLUTTER_FEATURE_STAGE_MULTIPLE;
 
-  /* FIXME: we really need to check if gl context is set */
+  /* this will make sure that the GL context exists and its
+   * bound to a drawable
+   */
+  g_assert (backend_glx->gl_context != None);
+  g_assert (glXGetCurrentDrawable () != None);
 
   CLUTTER_NOTE (BACKEND, "Checking features\n"
                 "GL_VENDOR: %s\n"
index 73e2783..58c334f 100644 (file)
@@ -288,13 +288,7 @@ clutter_backend_x11_constructor (GType                  gtype,
 ClutterFeatureFlags
 clutter_backend_x11_get_features (ClutterBackend *backend)
 {
-  ClutterFeatureFlags flags = 0;
-
-  /* FIXME: we really need to check if gl context is set */
-
-  flags = CLUTTER_FEATURE_STAGE_USER_RESIZE|CLUTTER_FEATURE_STAGE_CURSOR;
-
-  return flags;
+  return CLUTTER_FEATURE_STAGE_USER_RESIZE | CLUTTER_FEATURE_STAGE_CURSOR;
 }
 
 static void