[grits] Abort when opengl setup fails



commit 4ecb274b7e9892ddb2fb02d7c315b411e02877bb
Author: Andy Spencer <andy753421 gmail com>
Date:   Wed Aug 24 15:43:20 2011 +0000

    Abort when opengl setup fails

 src/gtkgl.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
---
diff --git a/src/gtkgl.c b/src/gtkgl.c
index 6812d33..e99f5f8 100644
--- a/src/gtkgl.c
+++ b/src/gtkgl.c
@@ -56,6 +56,8 @@ void gtk_gl_enable(GtkWidget *widget)
 	                 GLX_DEPTH_SIZE,  1,
 	                 None};
 	XVisualInfo *xvinfo  = glXChooseVisual(xdisplay, nscreen, attribs);
+	if (!xvinfo)
+		g_error("GtkGl: enable - unable to get valid OpenGL Visual");
 	GLXContext   context = glXCreateContext(xdisplay, xvinfo, NULL, False);
 	g_object_set_data(G_OBJECT(widget), "glcontext", context);
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]