Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- diff --git a/libglfork.cpp b/libglfork.cpp
- index 24e952c..b1c7f25 100644
- --- a/libglfork.cpp
- +++ b/libglfork.cpp
- @@ -239,7 +239,6 @@ static struct PrimusInfo {
- // FIXME: there are race conditions in accesses to these
- DrawablesInfo drawables;
- ContextsInfo contexts;
- - GLXFBConfig *dconfigs;
- PrimusInfo():
- adpy_str(getconf(PRIMUS_DISPLAY)),
- @@ -258,9 +257,13 @@ static struct PrimusInfo {
- die_if(!adpy, "failed to open secondary X display\n");
- die_if(!ddpy, "failed to open main X display\n");
- die_if(!needed_global, "failed to load PRIMUS_LOAD_GLOBAL\n");
- + }
- + GLXFBConfig dconfigs(int i)
- + {
- int ncfg, attrs[] = {GLX_DOUBLEBUFFER, GL_TRUE, None};
- + static GLXFBConfig *
- dconfigs = dfns.glXChooseFBConfig(ddpy, 0, attrs, &ncfg);
- - die_if(!ncfg, "broken GLX on main X display\n");
- + return dconfigs[i];
- }
- } primus;
- @@ -343,7 +346,7 @@ static bool test_drawpixels_fast(Display *dpy, GLXContext ctx)
- {
- int width = 1920, height = 1080;
- int pbattrs[] = {GLX_PBUFFER_WIDTH, width, GLX_PBUFFER_HEIGHT, height, GLX_PRESERVED_CONTENTS, True, None};
- - GLXPbuffer pbuffer = primus.dfns.glXCreatePbuffer(dpy, primus.dconfigs[0], pbattrs);
- + GLXPbuffer pbuffer = primus.dfns.glXCreatePbuffer(dpy, primus.dconfigs(0), pbattrs);
- primus.dfns.glXMakeCurrent(dpy, pbuffer, ctx);
- GLuint pbo;
- primus.dfns.glGenBuffers(1, &pbo);
- @@ -385,7 +388,7 @@ static void* display_work(void *vd)
- XSelectInput(ddpy, di.window, StructureNotifyMask);
- note_geometry(ddpy, di.window, &width, &height);
- di.update_geometry(width, height);
- - GLXContext context = primus.dfns.glXCreateNewContext(ddpy, primus.dconfigs[0], GLX_RGBA_TYPE, NULL, True);
- + GLXContext context = primus.dfns.glXCreateNewContext(ddpy, primus.dconfigs(0), GLX_RGBA_TYPE, NULL, True);
- die_if(!primus.dfns.glXIsDirect(ddpy, context),
- "failed to acquire direct rendering context for display thread\n");
- if (!primus.dispmethod)
- @@ -728,7 +731,7 @@ void glXSwapBuffers(Display *dpy, GLXDrawable drawable)
- GLXWindow glXCreateWindow(Display *dpy, GLXFBConfig config, Window win, const int *attribList)
- {
- - GLXWindow glxwin = primus.dfns.glXCreateWindow(dpy, primus.dconfigs[0], win, attribList);
- + GLXWindow glxwin = primus.dfns.glXCreateWindow(dpy, primus.dconfigs(0), win, attribList);
- DrawableInfo &di = primus.drawables[glxwin];
- di.kind = di.Window;
- di.fbconfig = config;
- @@ -753,7 +756,7 @@ void glXDestroyWindow(Display *dpy, GLXWindow window)
- GLXPbuffer glXCreatePbuffer(Display *dpy, GLXFBConfig config, const int *attribList)
- {
- - GLXPbuffer pbuffer = primus.dfns.glXCreatePbuffer(dpy, primus.dconfigs[0], attribList);
- + GLXPbuffer pbuffer = primus.dfns.glXCreatePbuffer(dpy, primus.dconfigs(0), attribList);
- DrawableInfo &di = primus.drawables[pbuffer];
- di.kind = di.Pbuffer;
- di.fbconfig = config;
- @@ -774,7 +777,7 @@ void glXDestroyPbuffer(Display *dpy, GLXPbuffer pbuf)
- GLXPixmap glXCreatePixmap(Display *dpy, GLXFBConfig config, Pixmap pixmap, const int *attribList)
- {
- - GLXPixmap glxpix = primus.dfns.glXCreatePixmap(dpy, primus.dconfigs[0], pixmap, attribList);
- + GLXPixmap glxpix = primus.dfns.glXCreatePixmap(dpy, primus.dconfigs(0), pixmap, attribList);
- DrawableInfo &di = primus.drawables[glxpix];
- di.kind = di.Pixmap;
- di.fbconfig = config;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement