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


C++ GraphicsContext::Resume方法代码示例

本文整理汇总了C++中GraphicsContext::Resume方法的典型用法代码示例。如果您正苦于以下问题:C++ GraphicsContext::Resume方法的具体用法?C++ GraphicsContext::Resume怎么用?C++ GraphicsContext::Resume使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在GraphicsContext的用法示例。


在下文中一共展示了GraphicsContext::Resume方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: ToggleFullscreen

	void ToggleFullscreen(HWND hWnd, bool goingFullscreen) {
		GraphicsContext *graphicsContext = PSP_CoreParameter().graphicsContext;
		// Make sure no rendering is happening during the switch.
		if (graphicsContext) {
			graphicsContext->Pause();
		}

		WINDOWPLACEMENT placement = { sizeof(WINDOWPLACEMENT) };
		GetWindowPlacement(hwndMain, &placement);

		int oldWindowState = g_WindowState;
		inFullscreenResize = true;
		g_IgnoreWM_SIZE = true;

		DWORD dwStyle;

		if (!goingFullscreen) {
			dwStyle = ::GetWindowLong(hWnd, GWL_STYLE);

			// Remove popup
			dwStyle &= ~WS_POPUP;
			// Re-add caption and border styles.
			dwStyle |= WS_OVERLAPPEDWINDOW;
			
			// Put back the menu bar.
			::SetMenu(hWnd, menu);
		} else {
			// If the window was maximized before going fullscreen, make sure to restore first
			// in order not to have the taskbar show up on top of PPSSPP.
			if (oldWindowState == SIZE_MAXIMIZED || placement.showCmd == SW_SHOWMAXIMIZED) {
				ShowWindow(hwndMain, SW_RESTORE);
			}

			// Remove caption and border styles.
			dwStyle = ::GetWindowLong(hWnd, GWL_STYLE);
			dwStyle &= ~WS_OVERLAPPEDWINDOW;
			// Add Popup
			dwStyle |= WS_POPUP;
		}

		::SetWindowLong(hWnd, GWL_STYLE, dwStyle);

		// Remove the menu bar. This can trigger WM_SIZE
		::SetMenu(hWnd, goingFullscreen ? NULL : menu);

		g_Config.bFullScreen = goingFullscreen;

		g_IgnoreWM_SIZE = false;

		// Resize to the appropriate view.
		// If we're returning to window mode, re-apply the appropriate size setting.
		if (goingFullscreen) {
			if (g_Config.bFullScreenMulti) {
				// Maximize isn't enough to display on all monitors.
				// Remember that negative coordinates may be valid.
				int totalX = GetSystemMetrics(SM_XVIRTUALSCREEN);
				int totalY = GetSystemMetrics(SM_YVIRTUALSCREEN);
				int totalWidth = GetSystemMetrics(SM_CXVIRTUALSCREEN);
				int totalHeight = GetSystemMetrics(SM_CYVIRTUALSCREEN);
				MoveWindow(hwndMain, totalX, totalY, totalWidth, totalHeight, TRUE);
				HandleSizeChange(oldWindowState);
			} else {
				ShowWindow(hwndMain, SW_MAXIMIZE);
			}
		} else {
			ShowWindow(hwndMain, oldWindowState == SIZE_MAXIMIZED ? SW_MAXIMIZE : SW_RESTORE);
			if (g_Config.bFullScreenMulti && oldWindowState != SIZE_MAXIMIZED) {
				// Return the screen to where it was.
				MoveWindow(hwndMain, g_Config.iWindowX, g_Config.iWindowY, g_Config.iWindowWidth, g_Config.iWindowHeight, TRUE);
			}
			if (oldWindowState == SIZE_MAXIMIZED) {
				// WM_SIZE wasn't sent, since the size didn't change (it was full screen before and after.)
				HandleSizeChange(oldWindowState);
			}
		}

		inFullscreenResize = false;
		CorrectCursor();

		ShowOwnedPopups(hwndMain, goingFullscreen ? FALSE : TRUE);
		W32Util::MakeTopMost(hwndMain, g_Config.bTopMost);

		WindowsRawInput::NotifyMenu();

		if (graphicsContext) {
			graphicsContext->Resume();
		}
	}
开发者ID:hrydgard,项目名称:ppsspp,代码行数:88,代码来源:MainWindow.cpp

示例2: ToggleFullscreen

	void ToggleFullscreen(HWND hWnd, bool goingFullscreen) {
		GraphicsContext *graphicsContext = PSP_CoreParameter().graphicsContext;
		// Make sure no rendering is happening during the switch.
		if (graphicsContext) {
			graphicsContext->Pause();
		}

		int oldWindowState = g_WindowState;
		g_IgnoreWM_SIZE = true;

		DWORD dwStyle;

		if (!goingFullscreen) {
			dwStyle = ::GetWindowLong(hWnd, GWL_STYLE);

			// Remove popup
			dwStyle &= ~WS_POPUP;
			// Re-add caption and border styles.
			dwStyle |= WS_OVERLAPPEDWINDOW;
			
			// Put back the menu bar.
			::SetMenu(hWnd, menu);
		} else {
			// If the window was maximized before going fullscreen, make sure to restore first
			// in order not to have the taskbar show up on top of PPSSPP.
			if (oldWindowState == SIZE_MAXIMIZED) {
				ShowWindow(hwndMain, SW_RESTORE);
			}
			// Remember the normal window rectangle.
			::GetWindowRect(hWnd, &g_normalRC);

			// Remove caption and border styles.
			dwStyle = ::GetWindowLong(hWnd, GWL_STYLE);
			dwStyle &= ~WS_OVERLAPPEDWINDOW;
			// Add Popup
			dwStyle |= WS_POPUP;
		}

		::SetWindowLong(hWnd, GWL_STYLE, dwStyle);

		// Remove the menu bar. This can trigger WM_SIZE
		::SetMenu(hWnd, goingFullscreen ? NULL : menu);

		g_Config.bFullScreen = goingFullscreen;

		g_IgnoreWM_SIZE = false;

		// Resize to the appropriate view.
		// If we're returning to window mode, re-apply the appropriate size setting.
		if (goingFullscreen) {
			ShowWindow(hwndMain, SW_MAXIMIZE);
		} else {
			ShowWindow(hwndMain, oldWindowState == SIZE_MAXIMIZED ? SW_MAXIMIZE : SW_RESTORE);
			if (oldWindowState == SIZE_MAXIMIZED) {
				// WM_SIZE wasn't sent, since the size didn't change (it was full screen before and after.)
				HandleSizeChange(oldWindowState);
			}
		}

		CorrectCursor();

		ShowOwnedPopups(hwndMain, goingFullscreen ? FALSE : TRUE);
		W32Util::MakeTopMost(hwndMain, g_Config.bTopMost);

		WindowsRawInput::NotifyMenu();

		if (graphicsContext) {
			graphicsContext->Resume();
		}
	}
开发者ID:ChrisJong,项目名称:ppsspp,代码行数:70,代码来源:MainWindow.cpp


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