예제 #1
0
/*! Just call the standard OpenGL setup.
 */
void PassiveWindow::init(GLInitFunctor oFunc)
{
#if defined(WIN32)
    Inherited::setHdc  (wglGetCurrentDC     ());
    Inherited::setHglrc(wglGetCurrentContext());
#elif defined(__APPLE__)
    //Inherited::setContext(cocoaWrapperCurrentContext());
    Inherited::setContext(carbonWrapperCurrentContext());
#else
    Inherited::setDisplay(glXGetCurrentDisplay ());
    Inherited::setContext(glXGetCurrentContext ());
    Inherited::setWindow (glXGetCurrentDrawable());
#endif

    this->doActivate();

    Window::init(oFunc);
}
예제 #2
0
// init the window: create the context  
void GLUTWindow::init(GLInitFunctor oFunc)
{
#if defined(WIN32)
    Inherited::setHdc  (wglGetCurrentDC     ());
    Inherited::setHglrc(wglGetCurrentContext());
    Inherited::setHwnd (WindowFromDC(Inherited::getHdc()));
#elif defined(__APPLE__)
    //Inherited::setContext(cocoaWrapperCurrentContext());
    Inherited::setContext(carbonWrapperCurrentContext());
#else
    glutSetWindow(getGlutId());

    Inherited::setDisplay(glXGetCurrentDisplay ());
    Inherited::setContext(glXGetCurrentContext ());
    Inherited::setWindow (glXGetCurrentDrawable());
#endif
    this->doDeactivate();

    Window::init(oFunc);
}