From 387462ad0c2d73fc82f1d73bdf2c131dbc1a7e61 Mon Sep 17 00:00:00 2001 From: Dana Jansens Date: Wed, 4 Jun 2003 19:14:08 +0000 Subject: [PATCH] obsolete --- render2/init.c | 94 -------------------------------------------------- 1 file changed, 94 deletions(-) delete mode 100644 render2/init.c diff --git a/render2/init.c b/render2/init.c deleted file mode 100644 index b6916456..00000000 --- a/render2/init.c +++ /dev/null @@ -1,94 +0,0 @@ -#include "instance.h" -#include "render.h" -#include "debug.h" -#include "glft/glft.h" - -static int glXRating(Display *display, XVisualInfo *v) -{ - int rating = 0; - int val; - RrDebug("evaluating visual %d\n", (int)v->visualid); - glXGetConfig(display, v, GLX_BUFFER_SIZE, &val); - RrDebug("buffer size %d\n", val); - - switch (val) { - case 32: - rating += 300; - break; - case 24: - rating += 200; - break; - case 16: - rating += 100; - break; - } - - glXGetConfig(display, v, GLX_LEVEL, &val); - RrDebug("level %d\n", val); - if (val != 0) - rating = -10000; - - glXGetConfig(display, v, GLX_DEPTH_SIZE, &val); - RrDebug("depth size %d\n", val); - switch (val) { - case 32: - rating += 30; - break; - case 24: - rating += 20; - break; - case 16: - rating += 10; - break; - case 0: - rating -= 10000; - } - - glXGetConfig(display, v, GLX_DOUBLEBUFFER, &val); - RrDebug("double buffer %d\n", val); - if (val) - rating++; - return rating; -} - -struct RrInstance *RrInit(Display *display, - int screen) -{ - int count, i = 0, val, best = 0, rate = 0, temp; - XVisualInfo vimatch, *vilist; - struct RrInstance *ret = NULL; - - vimatch.screen = screen; - vimatch.class = TrueColor; - vilist = XGetVisualInfo(display, VisualScreenMask | VisualClassMask, - &vimatch, &count); - - if (vilist) { - RrDebug("looking for a GL visual in %d visuals\n", count); - for (i = 0; i < count; i++) { - glXGetConfig(display, &vilist[i], GLX_USE_GL, &val); - if (val) { - temp = glXRating(display, &vilist[i]); - if (temp > rate) { - best = i; - rate = temp; - } - } - } - } - if (rate > 0) { - RrDebug("picked visual %d with rating %d\n", best, rate); - ret = RrInstanceNew(display, screen, vilist[best]); - - GlftInit(); - } - - return ret; -} - -void RrDestroy(struct RrInstance *inst) -{ - if (inst) { - RrInstanceFree(inst); - } -} -- 2.34.1