EGLWindow::~EGLWindow(void) { #if 0 if(getHglrc() != NULL) wglDeleteContext(getHglrc()); #endif }
/*! init the window: create the HDC and HGLRC */ void WIN32Window::init(GLInitFunctor oFunc) { setHdc(GetDC(getHwnd())); if(getHglrc() == NULL) { setHglrc(wglCreateContext(getHdc())); if(getHglrc() == NULL) { std::cerr << "WIN32Window::init: failed: " << GetLastError() << std::endl; } } Inherited::init(oFunc); if(getHdc() != NULL) { ReleaseDC(getHwnd(), getHdc()); setHdc(NULL); } }
void WIN32Window::terminate(void) { Inherited::doTerminate(); if(getHglrc() != NULL) { this->doDeactivate(); wglDeleteContext(getHglrc()); setHglrc(NULL); } }
/*! activate the window: set the HDC and bind the OGL context */ void WIN32Window::activate( void ) { setHdc(GetDC(getHwnd())); if(!wglMakeCurrent(getHdc(), getHglrc() ) ) { SFATAL << "WIN32Window::activate: failed: " << GetLastError() << endLog; } }
/*! init the window: create the HDC and HGLRC */ void WIN32Window::init( void ) { setHdc(GetDC(getHwnd())); if(getHglrc() == NULL ) { setHglrc(wglCreateContext(getHdc())); if(getHglrc() == NULL) { SFATAL << "WIN32Window::init: failed: " << GetLastError() << endLog; } } ReleaseDC(getHwnd(),getHdc()); activate(); setupGL(); }
/*! activate the window: set the HDC and bind the OGL context */ void WIN32Window::doActivate( void ) { if(getHdc() == NULL) setHdc(GetDC(getHwnd())); if(!wglMakeCurrent(getHdc(), getHglrc())) { std::cerr << "WIN32Window::activate: failed: " << GetLastError() << std::endl; } }
WIN32Window::~WIN32Window(void) { if(getHglrc() != NULL) wglDeleteContext(getHglrc()); }