forked from AuroraMiddleware/gtk
gl: Add a realize() fallback
Calling gdk_gl_context_realize() should always result in a valid result, so we need to provide a default implementation, to avoid a call to a NULL function pointer.
This commit is contained in:
parent
9318dc1f3e
commit
fe684078f9
@ -286,11 +286,23 @@ gdk_gl_context_upload_texture (GdkGLContext *context,
|
||||
}
|
||||
}
|
||||
|
||||
static gboolean
|
||||
gdk_gl_context_real_realize (GdkGLContext *self,
|
||||
GError **error)
|
||||
{
|
||||
g_set_error_literal (error, GDK_GL_ERROR, GDK_GL_ERROR_NOT_AVAILABLE,
|
||||
"The current backend does not support OpenGL");
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
static void
|
||||
gdk_gl_context_class_init (GdkGLContextClass *klass)
|
||||
{
|
||||
GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
|
||||
|
||||
klass->realize = gdk_gl_context_real_realize;
|
||||
|
||||
/**
|
||||
* GdkGLContext:display:
|
||||
*
|
||||
|
Loading…
Reference in New Issue
Block a user