Hi

The attached code snippet should help.

Regards
Alan Harris

Albino Rodrigues wrote:

Hi Simon,

Thanks for the reply.

I didn’t have much luck with ChangeDisplaySettingsEx

However, I found this http://www.codeguru.com/forum/showthread.php?t=363365 and it’s worked quite well. It’s a “fake” fullscreen where you hide components of your GUI and stretch the drawing window. It needs a bit of tweaking here and there.

Bino

*From:* [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] *On Behalf Of *Simon Hammett
*Sent:* Monday, 3 November 2008 7:11 PM
*To:* OpenSceneGraph Users
*Subject:* Re: [osg-users] OSG MFC Fullscreen

Try

ChangeDisplaySettingsEx

Not sure how that interacts with MFC though.

2008/11/3 Albino Rodrigues <[EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>>

Hi,

I've created an application based off the OSG MFC example.

Does anyone know how to swap the rendering context between non full screen and full screen (where no GUI is visible)?

I haven't had much luck researching on MSDN.

Bino


_______________________________________________
osg-users mailing list
[email protected] <mailto:[email protected]>
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org




--
The truth is out there. Usually in header files.

------------------------------------------------------------------------

_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
/////////////////////////////////////////////////////////////////////////////
// CPhomFrame full screen functions

void CPhomFrame::OnViewFullScreen() 
{
        RECT rectDesktop;
    WINDOWPLACEMENT wpNew;

    if (!m_bFullScreen)
    {
                m_bToolBarVis = m_wndToolBar.IsWindowVisible();
                m_bStatBarVis = m_wndStatusBar.IsWindowVisible();
                // need to hide all status bars
                m_wndStatusBar.ShowWindow(SW_HIDE);
                m_wndToolBar.ShowWindow(SW_HIDE);

                // We'll need these to restore the original state.
                GetWindowPlacement (&m_wpPrev);

                m_wpPrev.length = sizeof m_wpPrev;

                //Adjust RECT to new size of window
                ::GetWindowRect ( ::GetDesktopWindow(), &rectDesktop );
                ::AdjustWindowRectEx(&rectDesktop, GetStyle(), TRUE, 
GetExStyle());

                // Remember this for OnGetMinMaxInfo()
                m_FullScreenWindowRect = rectDesktop;
        
                wpNew = m_wpPrev;
                wpNew.showCmd =  SW_SHOWNORMAL;
                wpNew.rcNormalPosition = rectDesktop;
            
                m_wndFullScrnBar.SetWindowPos(0, 100,100, 0,0,
                                SWP_NOSIZE | SWP_NOZORDER | SWP_NOACTIVATE | 
SWP_SHOWWINDOW);
                FloatControlBar(&m_wndFullScrnBar, CPoint(100,100));
                m_bFullScreen=TRUE;
        }
        else
        {
                m_wndFullScrnBar.SetWindowPos(0, 100,100, 0,0,
                                SWP_NOSIZE | SWP_NOZORDER | SWP_NOACTIVATE | 
SWP_HIDEWINDOW);
                DockControlBar(&m_wndFullScrnBar);
                m_bFullScreen=FALSE;

                // restore status and tool bars
                if (m_bStatBarVis)
                        m_wndStatusBar.ShowWindow(SW_SHOWNORMAL);
                if (m_bToolBarVis)
                        m_wndToolBar.ShowWindow(SW_SHOWNORMAL);
                wpNew = m_wpPrev;
        }
    
        SetWindowPlacement ( &wpNew );
    if (m_bFullScreen)
                FullScreenSplit();
}

void CPhomFrame::OnGetMinMaxInfo(MINMAXINFO FAR* lpMMI) 
{
        if (m_bFullScreen)
        {
                lpMMI->ptMaxSize.y = m_FullScreenWindowRect.Height();
                lpMMI->ptMaxTrackSize.y = lpMMI->ptMaxSize.y;
                lpMMI->ptMaxSize.x = m_FullScreenWindowRect.Width();
                lpMMI->ptMaxTrackSize.x = lpMMI->ptMaxSize.x;
        }
}

BOOL CPhomFrame::IsFullScreen()
{
        return m_bFullScreen;
}

void CPhomFrame::OnUpdateViewFullScreen(CCmdUI* pCmdUI) 
{
        pCmdUI->Enable(!m_pHView->m_bAnimate);
        pCmdUI->SetCheck(m_bFullScreen);
}

// respond to escape key
void CPhomFrame::OnViewFullScreenEsc() 
{
        // only for switching out of full screen mode
    if (m_bFullScreen)
                OnViewFullScreen(); 
}
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to