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

Method init

server/VirtualDrawable.cpp:260–278  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

258
259
260int VirtualDrawable::init(int width, int height, VGLFBConfig config_)
261{
262 if(!config_ || width < 1 || height < 1) THROW("Invalid argument");
263
264 if(edpy != EGL_NO_DISPLAY)
265 THROW("VirtualDrawable::init() method not supported with EGL/X11");
266
267 CriticalSection::SafeLock l(mutex);
268 if(oglDraw && oglDraw->getWidth() == width && oglDraw->getHeight() == height
269 && FBCID(oglDraw->getFBConfig()) == FBCID(config_))
270 return 0;
271 oglDraw = new OGLDrawable(dpy, width, height, config_);
272 if(config && FBCID(config_) != FBCID(config) && ctx)
273 {
274 backend::destroyContext(dpy, ctx); ctx = 0;
275 }
276 config = config_;
277 return 1;
278}
279
280
281void VirtualDrawable::setDirect(Bool direct_)

Callers

nothing calls this directly

Calls 4

destroyContextFunction · 0.85
getWidthMethod · 0.45
getHeightMethod · 0.45
getFBConfigMethod · 0.45

Tested by

no test coverage detected