]> Pileus Git - grits/blobdiff - src/gtkgl.c
Fix grits-demo linking on 64-bit
[grits] / src / gtkgl.c
index 6812d33bc6f870086d5017a84a61fb36cb295d94..b4959870357315daee9795c32fc784ec90002447 100644 (file)
@@ -1,3 +1,20 @@
+/*
+ * Copyright (C) 2009-2011 Andy Spencer <andy753421@gmail.com>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+
 #include <gtk/gtk.h>
 
 /***************************
@@ -56,6 +73,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);