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

Function glXCreateGLXPixmap

server/faker-glx.cpp:498–544  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

496// it to the "2D pixmap", and return the 3D pixmap handle.
497
498GLXPixmap glXCreateGLXPixmap(Display *dpy, XVisualInfo *vis, Pixmap pm)
499{
500 GLXPixmap drawable = 0; VGLFBConfig config = 0;
501 int x = 0, y = 0; unsigned int width = 0, height = 0, depth = 0;
502 faker::VirtualPixmap *vpm = NULL;
503
504 TRY();
505
506 if(IS_EXCLUDED(dpy))
507 return _glXCreateGLXPixmap(dpy, vis, pm);
508
509 /////////////////////////////////////////////////////////////////////////////
510 OPENTRACE(glXCreateGLXPixmap); PRARGD(dpy); PRARGV(vis); PRARGX(pm);
511 STARTTRACE();
512 /////////////////////////////////////////////////////////////////////////////
513
514 Window root; unsigned int bw;
515 if(!(config = matchConfig(dpy, vis)))
516 {
517 faker::sendGLXError(dpy, X_GLXCreateGLXPixmap, BadValue, true);
518 goto done;
519 }
520 if(!pm
521 || !_XGetGeometry(dpy, pm, &root, &x, &y, &width, &height, &bw, &depth))
522 {
523 faker::sendGLXError(dpy, X_GLXCreateGLXPixmap, BadPixmap, true);
524 goto done;
525 }
526 if((vpm = new faker::VirtualPixmap(dpy, vis->visual, pm)) != NULL)
527 {
528 // Hash the VirtualPixmap instance to the 2D pixmap and also hash the 2D X
529 // display handle to the 3D pixmap.
530 vpm->init(width, height, depth, config, NULL);
531 PMHASH.add(dpy, pm, vpm);
532 GLXDHASH.add(vpm->getGLXDrawable(), dpy);
533 drawable = vpm->getGLXDrawable();
534 }
535
536 done:
537 /////////////////////////////////////////////////////////////////////////////
538 STOPTRACE(); PRARGI(x); PRARGI(y); PRARGI(width); PRARGI(height);
539 PRARGI(depth); PRARGC(config); PRARGX(drawable); CLOSETRACE();
540 /////////////////////////////////////////////////////////////////////////////
541
542 CATCH();
543 return drawable;
544}
545
546
547GLXPixmap glXCreatePixmap(Display *dpy, GLXFBConfig config_, Pixmap pm,

Callers 3

offScreenTestFunction · 0.85
extensionQueryTestFunction · 0.85
drawableInitFunction · 0.85

Calls 4

sendGLXErrorFunction · 0.85
initMethod · 0.45
addMethod · 0.45
getGLXDrawableMethod · 0.45

Tested by 1

drawableInitFunction · 0.68