| 389 | |
| 390 | |
| 391 | GLXContext glXCreateNewContext(Display *dpy, GLXFBConfig config_, |
| 392 | int render_type, GLXContext share_list, Bool direct) |
| 393 | { |
| 394 | GLXContext ctx = 0; |
| 395 | VGLFBConfig config = (VGLFBConfig)config_; |
| 396 | |
| 397 | TRY(); |
| 398 | |
| 399 | if(IS_EXCLUDED(dpy)) |
| 400 | return _glXCreateNewContext(dpy, config_, render_type, share_list, direct); |
| 401 | |
| 402 | if(!fconfig.allowindirect) direct = True; |
| 403 | |
| 404 | ///////////////////////////////////////////////////////////////////////////// |
| 405 | OPENTRACE(glXCreateNewContext); PRARGD(dpy); PRARGC(config); |
| 406 | PRARGI(render_type); PRARGX(share_list); PRARGI(direct); STARTTRACE(); |
| 407 | ///////////////////////////////////////////////////////////////////////////// |
| 408 | |
| 409 | ctx = backend::createContext(dpy, config, share_list, direct, NULL); |
| 410 | if(ctx) |
| 411 | { |
| 412 | int newctxIsDirect = backend::isDirect(ctx); |
| 413 | if(!fconfig.egl && !newctxIsDirect && direct) |
| 414 | { |
| 415 | vglout.println("[VGL] WARNING: The OpenGL rendering context obtained on X display"); |
| 416 | vglout.println("[VGL] %s is indirect, which may cause performance to suffer.", |
| 417 | DisplayString(DPY3D)); |
| 418 | vglout.println("[VGL] If %s is a local X display, then the framebuffer device", |
| 419 | DisplayString(DPY3D)); |
| 420 | vglout.println("[VGL] permissions may be set incorrectly."); |
| 421 | } |
| 422 | CTXHASH.add(ctx, config, newctxIsDirect); |
| 423 | } |
| 424 | |
| 425 | ///////////////////////////////////////////////////////////////////////////// |
| 426 | STOPTRACE(); PRARGX(ctx); CLOSETRACE(); |
| 427 | ///////////////////////////////////////////////////////////////////////////// |
| 428 | |
| 429 | CATCH(); |
| 430 | return ctx; |
| 431 | } |
| 432 | |
| 433 | // On Linux, GLXFBConfigSGIX is typedef'd to GLXFBConfig |
| 434 | |