| 324 | |
| 325 | |
| 326 | void VirtualDrawable::initReadbackContext(void) |
| 327 | { |
| 328 | CriticalSection::SafeLock l(mutex); |
| 329 | if(!ctx) |
| 330 | { |
| 331 | if(!isInit()) |
| 332 | THROW("VirtualDrawable instance has not been fully initialized"); |
| 333 | if(edpy != EGL_NO_DISPLAY) |
| 334 | { |
| 335 | EGLenum api = _eglQueryAPI(); |
| 336 | _eglBindAPI(EGL_OPENGL_API); |
| 337 | if((ctx = (GLXContext)_eglCreateContext(edpy, (EGLConfig)config, NULL, |
| 338 | NULL)) == 0) |
| 339 | THROW_EGL("eglCreateContext()"); |
| 340 | if(api != EGL_NONE) _eglBindAPI(api); |
| 341 | } |
| 342 | else |
| 343 | { |
| 344 | if((ctx = backend::createContext(dpy, config, NULL, direct, NULL)) == 0) |
| 345 | THROW("Could not create OpenGL context for readback"); |
| 346 | } |
| 347 | } |
| 348 | } |
| 349 | |
| 350 | |
| 351 | static const char *formatString(int glFormat) |
nothing calls this directly
no test coverage detected