예제 #1
0
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);
     }
}
예제 #4
0
/*! 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;
    }
}
예제 #5
0
/*! 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;        
    }
}
예제 #7
0
WIN32Window::~WIN32Window(void)
{
    if(getHglrc() != NULL)
        wglDeleteContext(getHglrc());
}