glXChooseVisual returns NULL with Mesa 17.2 (indirect GL)
Martin Vogt <[email protected]>
| Newsgroups | gmane.comp.video.mesa3d.user |
|---|---|
| Message-ID | <CAOE8yMBZj=TGwo1QHM7i+bh1LE1aqLVftohz6GgaMzxgb2rgow@mail.gmail.com> |
Hello, the attached program demonstrates that glXChooseVisual does not work anymore with Mesa 17.2 as client an NVidia as server. The same program works on Mesa 17.0. Before everyone says "contact NVidia", I like to ask if it's (maybe) a regression in Mesa 17.2? regards, Martin PS: glxinfo does not return the Vendor too, in this scenario _______________________________________________ mesa-users mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/mesa-users
glx.c
(text/x-csrc, 1.8 KB)
#include <stdio.h>
#include <GL/glx.h>
#include <GL/gl.h>
#include <stdlib.h>
/**
From the glxintro:
A GLX context must be created and attached to an X drawable before
OpenGL commands can be executed.
OpenGL commands issued while no context/drawable pair is current,
result in undefined behavior.
compile:
gcc -o glx glx.c -lGL -lX11
XServer: NVidia 390.30
Client: Mesa 17.0 works
Problem:
XServer: NVidia 390.30
Client: Mesa 17.2 does not work (vi == NULL)
*/
static int attributeListSgl[] = { GLX_RGBA,
GLX_RED_SIZE, 1,
GLX_GREEN_SIZE, 1,
GLX_BLUE_SIZE, 1,
None };
static Bool WaitForNotify(Display *d, XEvent *e, char *arg) {
printf("waiting\n");
return (e->type == MapNotify) && (e->xmap.window == (Window)arg);
}
int main()
{
XVisualInfo *vi;
Colormap cmap;
XSetWindowAttributes swa;
Window win;
GLXContext cx;
XEvent event;
Display *dpy;
GLint myint;
int back;
const char* vendor;
dpy = XOpenDisplay(0);
vi = glXChooseVisual(dpy, DefaultScreen(dpy), attributeListSgl);
if (vi == NULL) {
printf("vi null\n");
exit(0);
}
cx = glXCreateContext(dpy, vi, 0, GL_TRUE);
cmap = XCreateColormap(dpy, RootWindow(dpy, vi->screen),
vi->visual, AllocNone);
swa.colormap = cmap;
swa.border_pixel = 0;
swa.event_mask = StructureNotifyMask;
win = XCreateWindow(dpy, RootWindow(dpy, vi->screen), 0, 0, 200, 200,
0, vi->depth, InputOutput, vi->visual,
CWBorderPixel|CWColormap|CWEventMask, &swa);
//XMapWindow(dpy, win);
//XIfEvent(dpy, &event, WaitForNotify, (char*)win);
glXMakeCurrent(dpy, win, cx);
vendor=glXQueryServerString(dpy, vi->screen, GLX_VENDOR);
printf("vendor:%s\n",vendor);
return 0;
}