MCPcopy Create free account
hub / github.com/VirtualGL/virtualgl / glXCreateContext

Function glXCreateContext

server/faker-glx.cpp:297–344  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

295// Create a GLX context on the 3D X server suitable for off-screen rendering.
296
297GLXContext glXCreateContext(Display *dpy, XVisualInfo *vis,
298 GLXContext share_list, Bool direct)
299{
300 GLXContext ctx = 0; VGLFBConfig config = 0;
301
302 TRY();
303
304 if(IS_EXCLUDED(dpy))
305 return _glXCreateContext(dpy, vis, share_list, direct);
306
307 if(!fconfig.allowindirect) direct = True;
308
309 /////////////////////////////////////////////////////////////////////////////
310 OPENTRACE(glXCreateContext); PRARGD(dpy); PRARGV(vis); PRARGX(share_list);
311 PRARGI(direct); STARTTRACE();
312 /////////////////////////////////////////////////////////////////////////////
313
314 if(!(config = matchConfig(dpy, vis)))
315 {
316 faker::sendGLXError(dpy, X_GLXCreateContext, BadValue, true);
317 goto done;
318 }
319 ctx = backend::createContext(dpy, config, share_list, direct, NULL);
320 if(ctx)
321 {
322 int newctxIsDirect = backend::isDirect(ctx);
323 if(!fconfig.egl && !newctxIsDirect && direct)
324 {
325 vglout.println("[VGL] WARNING: The OpenGL rendering context obtained on X display");
326 vglout.println("[VGL] %s is indirect, which may cause performance to suffer.",
327 DisplayString(DPY3D));
328 vglout.println("[VGL] If %s is a local X display, then the framebuffer device",
329 DisplayString(DPY3D));
330 vglout.println("[VGL] permissions may be set incorrectly.");
331 }
332 // Hash the FB config to the context so we can use it in subsequent calls
333 // to glXMake[Context]Current().
334 CTXHASH.add(ctx, config, newctxIsDirect);
335 }
336
337 done:
338 /////////////////////////////////////////////////////////////////////////////
339 STOPTRACE(); PRARGC(config); PRARGX(ctx); CLOSETRACE();
340 /////////////////////////////////////////////////////////////////////////////
341
342 CATCH();
343 return ctx;
344}
345
346
347GLXContext glXCreateContextAttribsARB(Display *dpy, GLXFBConfig config_,

Callers 15

initMethod · 0.85
readbackTestFunction · 0.85
flushTestFunction · 0.85
queryContextTestFunction · 0.85
getFBConfigFromVisualFunction · 0.85
multiThreadTestFunction · 0.85
copyContextTestFunction · 0.85
subWinTestFunction · 0.85
extensionQueryTestFunction · 0.85
mainFunction · 0.85
mainFunction · 0.85
print_screen_infoFunction · 0.85

Calls 5

sendGLXErrorFunction · 0.85
createContextFunction · 0.85
isDirectFunction · 0.85
printlnMethod · 0.80
addMethod · 0.45

Tested by 1

drawableInitFunction · 0.68