From: Dana Jansens Date: Mon, 26 May 2003 12:49:36 +0000 (+0000) Subject: check for failed initialization in the test. print the error message there instead... X-Git-Tag: gl2~129 X-Git-Url: http://git.openbox.org/?a=commitdiff_plain;h=350aff771657cbdf8e38abed2e5225df3a373e18;p=dana%2Fopenbox.git check for failed initialization in the test. print the error message there instead of inside the library. --- diff --git a/render2/init.c b/render2/init.c index c3eec1b2..8ed7237d 100644 --- a/render2/init.c +++ b/render2/init.c @@ -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; } diff --git a/render2/test.c b/render2/test.c index 44e660b9..4db87ff8 100644 --- a/render2/test.c +++ b/render2/test.c @@ -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) {