check for failed initialization in the test. print the error message there instead...
authorDana Jansens <danakj@orodu.net>
Mon, 26 May 2003 12:49:36 +0000 (12:49 +0000)
committerDana Jansens <danakj@orodu.net>
Mon, 26 May 2003 12:49:36 +0000 (12:49 +0000)
render2/init.c
render2/test.c

index c3eec1b2eef64c62374989e6f3574d8f5a4f6fd8..8ed7237dc4b7a83239b3eb4e1e3dd5f7dc71b5d9 100644 (file)
@@ -77,8 +77,6 @@ struct RrInstance *RrInit(Display *display,
     if (rate > 0) {
         g_print("picked visual %d with rating %d\n", best, rate);
         ret = RrInstanceNew(display, screen, vilist[best]);
-    } else {
-        g_print("no valid GL visual was found\n");
     }
     return ret;
 }
index 44e660b9c031d1648edf4c11cb2068b7708582ae..4db87ff8033b3538d924e4135ed5c0cd92faa4ce 100644 (file)
@@ -42,7 +42,11 @@ int main()
     XSetClassHint(display, win, &chint);
 
     /* init Render */
-    inst = RrInit(display, DefaultScreen(display));
+    if (!(inst = RrInit(display, DefaultScreen(display)))) {
+        fprintf(stderr, "couldn't initialize the Render library "
+                "(no suitable GL support found)\n");
+        return EXIT_FAILURE;
+    }
 
     /*paint(win, look);*/
     while (1) {