При попытке соединить вывод OpenGL с Иксовым окном выходит вот такая вот бяка
X Error of failed request: BadMatch (invalid parameter attributes)
Major opcode of failed request: 1 (X_CreateWindow)
Serial number of failed request: 18
Current serial number in output stream: 20
static int GLAttributs[] =
{ GLX_RGBA,
GLX_DOUBLEBUFFER,
GLX_RED_SIZE, 8,
GLX_GREEN_SIZE, 8,
GLX_BLUE_SIZE, 8,
GLX_DEPTH_SIZE, 16, 0,
None };
int InitGameWindow(Display *dpy, Window &rootwnd_h, Window &wnd_h,
unsigned int wnd_h_mask, XSetWindowAttributes wnd_h_attr,
XSizeHints wnd_h_hints, int wnd_hw, int wnd_hh,int glatt[] ,
XVisualInfo *&vis, GLXContext &glcont, char* &errStr)
{
dpy = XOpenDisplay(NULL);
if (dpy == NULL)
{
errStr = (char *) "Display no connected\n";
return 1;
}
rootwnd_h = DefaultRootWindow(dpy);
wnd_h_mask = CWBorderPixel | CWBackPixel | CWEventMask;
wnd_h_attr.event_mask = KeyPressMask | StructureNotifyMask | ExposureMask
| PropertyChangeMask;
memset(&wnd_h_hints, 0, sizeof(XSizeHints));
wnd_h_hints.flags = PMinSize | PMaxSize;
wnd_h_hints.min_width = wnd_hw;
wnd_h_hints.max_width = wnd_hw;
wnd_h_hints.min_height = wnd_hh;
wnd_h_hints.max_height = wnd_hh;
vis = glXChooseVisual(dpy, DefaultScreen(dpy), glatt);
wnd_h = XCreateWindow(dpy,rootwnd_h, 0, 0, wnd_hw, wnd_hh, 0, vis->depth,
InputOutput, vis->visual, wnd_h_mask, &wnd_h_attr);
XMapWindow(dpy, wnd_h);
glcont = glXCreateContext(dpy, vis, NULL, True);
XSetNormalHints(dpy, wnd_h, &wnd_h_hints);
if ( ! glXMakeCurrent(dpy, wnd_h, glcont) )
return 6;
if ( glGetError() != GL_NO_ERROR )
return 9;
glViewport(0,0,800,600);
glClearColor(255.0f,0.0f,0.0f,0.0f);
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
glFlush();
XSync(dpy, 1);
return 0;
}
Я нашел что если за место vis->depth и vis->visual написать copyfromparent то все работает, но естественно без вывода графики, как быть ?
Может у кого есть идеи как это исправить ?