| 496 | // it to the "2D pixmap", and return the 3D pixmap handle. |
| 497 | |
| 498 | GLXPixmap 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 | |
| 547 | GLXPixmap glXCreatePixmap(Display *dpy, GLXFBConfig config_, Pixmap pm, |