diff options
Diffstat (limited to 'generic')
-rw-r--r-- | generic/tkZinc.c | 60 |
1 files changed, 35 insertions, 25 deletions
diff --git a/generic/tkZinc.c b/generic/tkZinc.c index bf2a5ad..793d2a9 100644 --- a/generic/tkZinc.c +++ b/generic/tkZinc.c @@ -662,38 +662,48 @@ ZincObjCmd(ClientData client_data, /* Main window associated with #ifdef GLX if (wi->has_glx) { int val; - int attribs[] = { GLX_RGBA, GLX_DOUBLEBUFFER, + int attribs[] = { GLX_RGBA, + GLX_DOUBLEBUFFER, GLX_BUFFER_SIZE, 16, - GLX_STENCIL_SIZE, 1, None }; + GLX_STENCIL_SIZE, 1, + None }; wi->gl_visual = glXChooseVisual(wi->dpy, XScreenNumberOfScreen(wi->screen), attribs); if (!wi->gl_visual) { + printf("No glx visual\n"); wi->render = False; } - printf("Visual is 0x%x, ", (int) wi->gl_visual->visualid); - glXGetConfig(wi->dpy, wi->gl_visual, GLX_RGBA, &val); - printf("RGBA %d, ", val); - glXGetConfig(wi->dpy, wi->gl_visual, GLX_DOUBLEBUFFER, &val); - printf("Double Buffer %d, ", val); - glXGetConfig(wi->dpy, wi->gl_visual, GLX_STENCIL_SIZE, &val); - printf("Stencil %d, ", val); - glXGetConfig(wi->dpy, wi->gl_visual, GLX_BUFFER_SIZE, &val); - printf("depth %d, ", val); - glXGetConfig(wi->dpy, wi->gl_visual, GLX_RED_SIZE, &val); - printf("red %d, ", val); - glXGetConfig(wi->dpy, wi->gl_visual, GLX_GREEN_SIZE, &val); - printf("green %d, ", val); - glXGetConfig(wi->dpy, wi->gl_visual, GLX_BLUE_SIZE, &val); - printf("blue %d, ", val); - glXGetConfig(wi->dpy, wi->gl_visual, GLX_ALPHA_SIZE, &val); - printf("alpha %d\n", val); - wi->gl_context = glXCreateContext(wi->dpy, wi->gl_visual, NULL, True); - if (!wi->gl_context) { - wi->render = False; + else { + printf("Visual is 0x%x, ", (int) wi->gl_visual->visualid); + glXGetConfig(wi->dpy, wi->gl_visual, GLX_RGBA, &val); + printf("RGBA %d, ", val); + glXGetConfig(wi->dpy, wi->gl_visual, GLX_DOUBLEBUFFER, &val); + printf("Double Buffer %d, ", val); + glXGetConfig(wi->dpy, wi->gl_visual, GLX_STENCIL_SIZE, &val); + printf("Stencil %d, ", val); + glXGetConfig(wi->dpy, wi->gl_visual, GLX_BUFFER_SIZE, &val); + printf("depth %d, ", val); + glXGetConfig(wi->dpy, wi->gl_visual, GLX_RED_SIZE, &val); + printf("red %d, ", val); + glXGetConfig(wi->dpy, wi->gl_visual, GLX_GREEN_SIZE, &val); + printf("green %d, ", val); + glXGetConfig(wi->dpy, wi->gl_visual, GLX_BLUE_SIZE, &val); + printf("blue %d, ", val); + glXGetConfig(wi->dpy, wi->gl_visual, GLX_ALPHA_SIZE, &val); + printf("alpha %d\n", val); + wi->gl_context = glXCreateContext(wi->dpy, wi->gl_visual, NULL, True); + if (!wi->gl_context) { + printf("No glx context\n"); + wi->render = False; + } + else { + printf("Context: %d\n", glXIsDirect(wi->dpy, wi->gl_context)); + Tk_SetWindowVisual(wi->win, wi->gl_visual->visual, + 16, + XCreateColormap(wi->dpy, RootWindowOfScreen(wi->screen), + wi->gl_visual->visual, AllocNone)); + } } - printf("Context: %d\n", glXIsDirect(wi->dpy, wi->gl_context)); - Tk_SetWindowVisual(wi->win, wi->gl_visual->visual, - Tk_Depth(wi->win), Tk_Colormap(wi->win)); } #endif } |