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

Method init

server/VirtualPixmap.cpp:39–59  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

37
38
39int 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

Callers 1

readbackMethod · 0.45

Calls 5

destroyContextFunction · 0.85
getDepthMethod · 0.80
getWidthMethod · 0.45
getHeightMethod · 0.45
getFBConfigMethod · 0.45

Tested by

no test coverage detected