Thomas Fischer
2018-06-06 23:12:32 UTC
Thanks, I actually managed to fix it, kinda by luck!
The code that didn't work was:
fb_configs = glXGetFBConfigs(display, default_screen, &num_fb_configs);
if(!fb_configs || num_fb_configs == 0)
{
fprintf(stderr, "glXGetFBConfigs failed\n");
return -1;
}
/* Select first framebuffer config and query visualID */
GLXFBConfig fb_config = fb_configs[0];
glXGetFBConfigAttrib(display, fb_config, GLX_VISUAL_ID , &visualID);
It was choosing a display that didn't have GLX_X_RENDERABLE set.
Using glXChooseFBConfig I was able to get it to work:
int visualID = 0;
static int visual_attribs[] =
{
GLX_X_RENDERABLE, True,
GLX_DRAWABLE_TYPE, GLX_WINDOW_BIT,
GLX_RENDER_TYPE, GLX_RGBA_BIT,
GLX_X_VISUAL_TYPE, GLX_TRUE_COLOR,
GLX_RED_SIZE, 8,
GLX_GREEN_SIZE, 8,
GLX_BLUE_SIZE, 8,
GLX_ALPHA_SIZE, 8,
GLX_DEPTH_SIZE, 24,
GLX_STENCIL_SIZE, 8,
GLX_DOUBLEBUFFER, True,
None
};
int num_fb_configs = 0;
GLXFBConfig *fb_configs = 0;
fb_configs = glXChooseFBConfig(display, default_screen, visual_attribs,
&num_fb_configs);
Is there any way I can update the page on the website with this working
code?
The code that didn't work was:
fb_configs = glXGetFBConfigs(display, default_screen, &num_fb_configs);
if(!fb_configs || num_fb_configs == 0)
{
fprintf(stderr, "glXGetFBConfigs failed\n");
return -1;
}
/* Select first framebuffer config and query visualID */
GLXFBConfig fb_config = fb_configs[0];
glXGetFBConfigAttrib(display, fb_config, GLX_VISUAL_ID , &visualID);
It was choosing a display that didn't have GLX_X_RENDERABLE set.
Using glXChooseFBConfig I was able to get it to work:
int visualID = 0;
static int visual_attribs[] =
{
GLX_X_RENDERABLE, True,
GLX_DRAWABLE_TYPE, GLX_WINDOW_BIT,
GLX_RENDER_TYPE, GLX_RGBA_BIT,
GLX_X_VISUAL_TYPE, GLX_TRUE_COLOR,
GLX_RED_SIZE, 8,
GLX_GREEN_SIZE, 8,
GLX_BLUE_SIZE, 8,
GLX_ALPHA_SIZE, 8,
GLX_DEPTH_SIZE, 24,
GLX_STENCIL_SIZE, 8,
GLX_DOUBLEBUFFER, True,
None
};
int num_fb_configs = 0;
GLXFBConfig *fb_configs = 0;
fb_configs = glXChooseFBConfig(display, default_screen, visual_attribs,
&num_fb_configs);
Is there any way I can update the page on the website with this working
code?
Hi,
According to [1], CreateColormap produces a Match error if the visual is
not supported by the screen. That's all that I can say, sorry. I know
basically nothing about GLX. (Well, you could print out the value of
visualID and look it up in the output of /usr/bin/xdpyinfo)
Cheers,
Uli
[1]: https://www.x.org/releases/X11R7.5/doc/x11proto/proto.html
--
Homophobia - The fear that another man will treat you the way you treat
women.
I've been trying to compile the code from
https://xcb.freedesktop.org/opengl/
tl;dr: The code used Xlib to interact with glx, but uses xcb to handle X
events.
It seems to not run because of something happening in
xcb_create_colormap,https://xcb.freedesktop.org/opengl/
tl;dr: The code used Xlib to interact with glx, but uses xcb to handle X
events.
It seems to not run because of something happening in
I changed the code to use create_colormap_checked, and printed out the
=============ERROR=============
Could not create the colormap
error->response_type: 0
error->error_code: 8
error->sequence: 31
error->resource_id: 0
error->minor_code: 0
error->major_code: 78
error->full_sequence: 31
===============================
Error 8 is XCB_MATCH / BadMatch.=============ERROR=============
Could not create the colormap
error->response_type: 0
error->error_code: 8
error->sequence: 31
error->resource_id: 0
error->minor_code: 0
error->major_code: 78
error->full_sequence: 31
===============================
According to [1], CreateColormap produces a Match error if the visual is
not supported by the screen. That's all that I can say, sorry. I know
basically nothing about GLX. (Well, you could print out the value of
visualID and look it up in the output of /usr/bin/xdpyinfo)
Cheers,
Uli
[1]: https://www.x.org/releases/X11R7.5/doc/x11proto/proto.html
--
Homophobia - The fear that another man will treat you the way you treat
women.