| 68 | |
| 69 | |
| 70 | void 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 | |
| 106 | void ClientWin::initX11(void) |