diff --git a/ChangeLog b/ChangeLog index 526fec5e3..437a76fb0 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2008-06-26 Matthew Allum + + * clutter/glx/clutter-glx-texture-pixmap.c: + Move the gl extension probe into the regular object init() rather than + class_init. Should be a little safer. + 2008-06-26 Matthew Allum * tests/test-pixmap.c: (main): diff --git a/clutter/glx/clutter-glx-texture-pixmap.c b/clutter/glx/clutter-glx-texture-pixmap.c index c374a3d98..fdd9bac12 100644 --- a/clutter/glx/clutter-glx-texture-pixmap.c +++ b/clutter/glx/clutter-glx-texture-pixmap.c @@ -128,6 +128,28 @@ clutter_glx_texture_pixmap_init (ClutterGLXTexturePixmap *self) CLUTTER_GLX_TYPE_TEXTURE_PIXMAP, ClutterGLXTexturePixmapPrivate); + if (_ext_check_done == FALSE) + { + const gchar *glx_extensions = NULL; + + glx_extensions = + glXQueryExtensionsString (clutter_x11_get_default_display (), + clutter_x11_get_default_screen ()); + + /* Check for the texture from pixmap extension */ + if (cogl_check_extension ("GLX_EXT_texture_from_pixmap", glx_extensions)) + { + _gl_bind_tex_image = + (BindTexImage)cogl_get_proc_address ("glXBindTexImageEXT"); + _gl_release_tex_image = + (ReleaseTexImage)cogl_get_proc_address ("glXReleaseTexImageEXT"); + + if (_gl_bind_tex_image && _gl_release_tex_image) + _have_tex_from_pixmap_ext = TRUE; + } + + _ext_check_done = TRUE; + } } static void @@ -612,28 +634,6 @@ clutter_glx_texture_pixmap_class_init (ClutterGLXTexturePixmapClass *klass) x11_texture_class->update_area = clutter_glx_texture_pixmap_update_area; - if (_ext_check_done == FALSE) - { - const gchar *glx_extensions = NULL; - - glx_extensions = - glXQueryExtensionsString (clutter_x11_get_default_display (), - clutter_x11_get_default_screen ()); - - /* Check for the texture from pixmap extension */ - if (cogl_check_extension ("GLX_EXT_texture_from_pixmap", glx_extensions)) - { - _gl_bind_tex_image = - (BindTexImage)cogl_get_proc_address ("glXBindTexImageEXT"); - _gl_release_tex_image = - (ReleaseTexImage)cogl_get_proc_address ("glXReleaseTexImageEXT"); - - if (_gl_bind_tex_image && _gl_release_tex_image) - _have_tex_from_pixmap_ext = TRUE; - } - - _ext_check_done = TRUE; - } } /**