本文整理汇总了C++中CDrawPort::SetOverlappedRendering方法的典型用法代码示例。如果您正苦于以下问题:C++ CDrawPort::SetOverlappedRendering方法的具体用法?C++ CDrawPort::SetOverlappedRendering怎么用?C++ CDrawPort::SetOverlappedRendering使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CDrawPort
的用法示例。
在下文中一共展示了CDrawPort::SetOverlappedRendering方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: TestGame
void CChildFrame::TestGame( BOOL bFullScreen)
{
// turn off info window
CMainFrame* pMainFrame = STATIC_DOWNCAST(CMainFrame, AfxGetMainWnd());
pMainFrame->HideInfoWindow();
CWorldEditorView *pPerspectiveView = GetPerspectiveView();
ASSERT( pPerspectiveView != NULL);
SetActiveView( pPerspectiveView, FALSE);
CWorldEditorDoc* pDoc = pPerspectiveView->GetDocument();
CTFileName fnmWorldToPlay;
CTFileName fnmTempWorld = CTString("Temp\\TestGame.wld");
// if the world was never saved or if it is modified
if( (!pDoc->m_bWasEverSaved && wed_bSaveTestGameFirstTime) || pDoc->IsModified())
{ // save world under temporary name
ASSERT_VALID(pDoc);
try {
pDoc->m_woWorld.Save_t(fnmTempWorld);
fnmWorldToPlay = fnmTempWorld;
} catch( char *strError) {
AfxMessageBox( CString(strError));
pPerspectiveView->EnableToolTips(TRUE);
return;
}
// if the world is not modified (it is saved on disk)
} else
{ // use the saved world
fnmWorldToPlay = CTString(CStringA(pDoc->GetPathName()));
try {
fnmWorldToPlay.RemoveApplicationPath_t();
} catch( char *strError) {
AfxMessageBox( CString(strError));
pPerspectiveView->EnableToolTips(TRUE);
return;
}
}
// set rendering preferences
_wrpWorldRenderPrefs = pPerspectiveView->m_vpViewPrefs.m_wrpWorldRenderPrefs;
_mrpModelRenderPrefs = pPerspectiveView->m_vpViewPrefs.m_mrpModelRenderPrefs;
_wrpWorldRenderPrefs.SetShadowsType( pPerspectiveView->GetChildFrame()->m_stShadowType);
_wrpWorldRenderPrefs.SetSelectedEntityModel( theApp.m_pEntityMarkerModelObject);
_wrpWorldRenderPrefs.SetSelectedPortalModel( theApp.m_pPortalMarkerModelObject);
_wrpWorldRenderPrefs.SetEmptyBrushModel( theApp.m_pEmptyBrushModelObject);
_wrpWorldRenderPrefs.SetTextureLayerOn( theApp.m_bTexture1, 0);
_wrpWorldRenderPrefs.SetTextureLayerOn( theApp.m_bTexture2, 1);
_wrpWorldRenderPrefs.SetTextureLayerOn( theApp.m_bTexture3, 2);
_wrpWorldRenderPrefs.DisableVisTweaks(FALSE);
_wrpWorldRenderPrefs.SetSelectedEntityModel( theApp.m_pEntityMarkerModelObject);
_wrpWorldRenderPrefs.SetSelectedPortalModel( theApp.m_pPortalMarkerModelObject);
_wrpWorldRenderPrefs.SetEmptyBrushModel( theApp.m_pEmptyBrushModelObject);
// prepare test game view/draw ports
CViewPort *pvp = pPerspectiveView->m_pvpViewPort;
CDrawPort *pdp = pPerspectiveView->m_pdpDrawPort;
pdp->SetOverlappedRendering(FALSE); // we are not rendering scene over already rendered scene (used for CSG layer)
// if full screen mode is required
HWND hWndFullScreen=NULL;
HINSTANCE hInstanceFullScreen;
WNDCLASSEX wcFullScreen;
char achWindowTitle[256]; // current window title
if( bFullScreen)
{
// get full screen display mode info
const PIX pixSizeI = theApp.m_dmFullScreen.dm_pixSizeI;
const PIX pixSizeJ = theApp.m_dmFullScreen.dm_pixSizeJ;
const DisplayDepth dd = theApp.m_dmFullScreen.dm_ddDepth;
const GfxAPIType gat = theApp.m_gatFullScreen;
// set OpenGL fullscreen (before window)
if( gat==GAT_OGL) {
const BOOL bRes = _pGfx->SetDisplayMode( gat, 0, pixSizeI, pixSizeJ, dd);
if( !bRes) {
WarningMessage( "Unable to setup full screen display.");
return;
}
} // register the window class
hInstanceFullScreen = AfxGetInstanceHandle();
ASSERT( hInstanceFullScreen!=NULL);
wcFullScreen.cbSize = sizeof(wcFullScreen);
wcFullScreen.style = CS_HREDRAW | CS_VREDRAW;
wcFullScreen.lpfnWndProc = ::DefWindowProc;
wcFullScreen.cbClsExtra = 0;
wcFullScreen.cbWndExtra = 0;
wcFullScreen.hInstance = hInstanceFullScreen;
wcFullScreen.hIcon = LoadIcon( hInstanceFullScreen, (LPCTSTR)IDR_MAINFRAME );
wcFullScreen.hCursor = NULL;
wcFullScreen.hbrBackground = NULL;
wcFullScreen.lpszMenuName = CString(APPLICATION_NAME);
wcFullScreen.lpszClassName = CString(APPLICATION_NAME);
wcFullScreen.hIconSm = NULL;
RegisterClassEx(&wcFullScreen);
// create a window, invisible initially
hWndFullScreen = CreateWindowExA(
WS_EX_TOPMOST,
APPLICATION_NAME,
//.........这里部分代码省略.........