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

Method initReadbackContext

server/VirtualDrawable.cpp:326–348  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

324
325
326void 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
351static const char *formatString(int glFormat)

Callers

nothing calls this directly

Calls 1

createContextFunction · 0.85

Tested by

no test coverage detected