コード例 #1
0
// swap front and back buffers
bool WIN32Window::doSwap(void)
{
    if(getHdc() == NULL)
        setHdc(GetDC(getHwnd()));

    return SwapBuffers(getHdc());
}
コード例 #2
0
/*! 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);
    }
}
コード例 #3
0
void WIN32Window::doDeactivate ( void )
{
    // unbind the context
    wglMakeCurrent(NULL, NULL);

    // release the hardware device context
    if(getHdc() != NULL) 
    {
        ReleaseDC(getHwnd(), getHdc());
        setHdc(NULL);
    }
}
コード例 #4
0
/*! 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;        
    }
}
コード例 #5
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;
    }
}
コード例 #6
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();
}
コード例 #7
0
// swap front and back buffers
void WIN32Window::swap( void )
{
    SwapBuffers(getHdc());
}