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

Method initGL

client/ClientWin.cpp:70–103  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

68
69
70void ClientWin::initGL(void)
71{
72 GLFrame *newfb = NULL;
73 char dpystr[80];
74 snprintf(dpystr, 80, ":%d.0", dpynum);
75 CriticalSection::SafeLock l(mutex);
76
77 if(drawMethod == RR_DRAWOGL)
78 {
79 try
80 {
81 newfb = new GLFrame(dpystr, window);
82 if(!newfb) throw("Could not allocate class instance");
83 }
84 catch(std::exception &e)
85 {
86 vglout.println("OpenGL error-- %s\nUsing X11 drawing instead", e.what());
87 delete newfb; newfb = NULL;
88 drawMethod = RR_DRAWX11;
89 vglout.PRINTLN("Stereo requires OpenGL drawing. Disabling stereo.");
90 stereo = false;
91 return;
92 }
93 }
94 if(newfb)
95 {
96 if(fb)
97 {
98 if(fb->isGL) delete ((GLFrame *)fb);
99 else delete ((FBXFrame *)fb);
100 }
101 fb = (Frame *)newfb;
102 }
103}
104
105
106void ClientWin::initX11(void)

Callers

nothing calls this directly

Calls 3

printlnMethod · 0.80
whatMethod · 0.80
PRINTLNMethod · 0.80

Tested by

no test coverage detected