| 37 | |
| 38 | |
| 39 | int VirtualPixmap::init(int width, int height, int depth, VGLFBConfig config_, |
| 40 | const int *attribs) |
| 41 | { |
| 42 | if(!config_ || width < 1 || height < 1) THROW("Invalid argument"); |
| 43 | |
| 44 | CriticalSection::SafeLock l(mutex); |
| 45 | if(oglDraw && oglDraw->getWidth() == width && oglDraw->getHeight() == height |
| 46 | && oglDraw->getDepth() == depth |
| 47 | && FBCID(oglDraw->getFBConfig()) == FBCID(config_)) |
| 48 | return 0; |
| 49 | if(fconfig.egl) |
| 50 | oglDraw = new OGLDrawable(dpy, width, height, config_); |
| 51 | else |
| 52 | oglDraw = new OGLDrawable(width, height, depth, config_, attribs); |
| 53 | if(config && FBCID(config_) != FBCID(config) && ctx) |
| 54 | { |
| 55 | backend::destroyContext(dpy, ctx); ctx = 0; |
| 56 | } |
| 57 | config = config_; |
| 58 | return 1; |
| 59 | } |
| 60 | |
| 61 | |
| 62 | // Returns the X11 Pixmap on the 3D X server corresponding to the GLX Pixmap |
no test coverage detected