bool OglContext::makeCurrent() { if (current != this) { current = this; if (!wglMakeContextCurrentARB(hPBufferDC, hPBufferDC, hPBufferRC)) { msSetError(MS_OGLERR, "Can't Activate The GL Rendering pbuffer.", "OglContext::makeCurrent()"); return FALSE; } } return true; }
void DestroyCameras (void) { int i; tCamera *pc = gameData.cameras.cameras; #if RENDER2TEXTURE == 1 if (gameStates.ogl.bRender2TextureOk) # ifdef _WIN32 wglMakeContextCurrentARB (hGlDC, hGlDC, hGlRC); # else glXMakeCurrent (hGlDC, hGlWindow, hGlRC); # endif #endif LogErr ("Destroying cameras\n"); for (i = gameData.cameras.nCameras; i; i--, pc++) DestroyCamera (pc); if (gameData.cameras.nSides) memset (gameData.cameras.nSides, 0xFF, MAX_SEGMENTS * 6 * sizeof (*gameData.cameras.nSides)); gameData.cameras.nCameras = 0; }
void PixelBuffer::disable(void) { //wglMakeCurrent(platform::getDC(), platform::getRC()); //wglGetCurrentDC(), wglGetCurrentContext()); wglMakeContextCurrentARB(platform::getDC(), platform::getDC(), platform::getRC()); glDrawBuffer(GL_BACK); glReadBuffer(GL_BACK); platform::forceResize(platform::getScreenWidth(), platform::getScreenHeight()); }
void PixelBuffer::enable(void) { //wglMakeCurrent(dc, platform::getRC()); //wglGetCurrentContext()); wglMakeContextCurrentARB(dc, dc, platform::getRC()); glDrawBuffer(GL_FRONT); glReadBuffer(GL_FRONT); glViewport(0, 0, width, height); }