当前位置: 首页>>代码示例>>C++>>正文


C++ CDrawPort::SetOverlappedRendering方法代码示例

本文整理汇总了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,
//.........这里部分代码省略.........
开发者ID:EgoIncarnate,项目名称:Serious-Engine,代码行数:101,代码来源:ChildFrm.cpp


注:本文中的CDrawPort::SetOverlappedRendering方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。