5 #include "../fb_gfx_gl.h"
7 #if !defined DISABLE_X11 && !defined DISABLE_OPENGL
12 #ifndef GLX_SAMPLE_BUFFERS_ARB
13 # define GLX_SAMPLE_BUFFERS_ARB 100000
15 #ifndef GLX_SAMPLES_ARB
16 # define GLX_SAMPLES_ARB 100001
19 static int driver_init(
char *title,
int w,
int h,
int depth,
int refresh_rate,
int flags);
42 typedef XVisualInfo *(*GLXCHOOSEVISUAL)(Display *, int,
int *);
84 display_name = XDisplayName(
NULL);
85 if ((!display_name[0]) || (display_name[0] ==
':') || (!strncmp(display_name,
"unix:", 5))) {
125 static int driver_init(
char *title,
int w,
int h,
int depth,
int refresh_rate,
int flags)
127 const char *glx_funcs[] = {
128 "glXChooseVisual",
"glXCreateContext",
"glXDestroyContext",
129 "glXMakeCurrent",
"glXSwapBuffers",
NULL
132 void **funcs_ptr = (
void **)funcs;
134 int attribs[64] = { GLX_RGBA, GLX_DOUBLEBUFFER, 0 }, *attrib = &attribs[2], *samples_attrib =
NULL;
145 *attrib++ = GLX_RED_SIZE;
147 *attrib++ = GLX_GREEN_SIZE;
149 *attrib++ = GLX_BLUE_SIZE;
151 *attrib++ = GLX_ALPHA_SIZE;
153 *attrib++ = GLX_DEPTH_SIZE;
156 *attrib++ = GLX_STENCIL_SIZE;
160 *attrib++ = GLX_ACCUM_RED_SIZE;
162 *attrib++ = GLX_ACCUM_GREEN_SIZE;
164 *attrib++ = GLX_ACCUM_BLUE_SIZE;
166 *attrib++ = GLX_ACCUM_ALPHA_SIZE;
173 samples_attrib = attrib;
200 }
while ((samples_attrib) && ((*samples_attrib -= 2) >= 0));
206 result =
fb_hX11Init(title, w, h, info->depth, refresh_rate, flags);
219 if ((samples_attrib) && (*samples_attrib > 0))