示例#1
0
文件: Core.cpp 项目: A671DR218/ppsspp
void Core_RunLoop() {
	while ((globalUIState != UISTATE_INGAME || !PSP_IsInited()) && globalUIState != UISTATE_EXIT) {
		time_update();

#if defined(_WIN32) && !defined(USING_QT_UI)
		double startTime = time_now_d();
		UpdateRunLoop();

		// Simple throttling to not burn the GPU in the menu.
		time_update();
		double diffTime = time_now_d() - startTime;
		int sleepTime = (int) (1000000.0 / 60.0) - (int) (diffTime * 1000000.0);
		if (sleepTime > 0)
			Sleep(sleepTime / 1000);
		GL_SwapBuffers();
#else
		UpdateRunLoop();
#endif
	}

	while (!coreState && globalUIState == UISTATE_INGAME) {
		time_update();
		UpdateRunLoop();
#if defined(_WIN32) && !defined(USING_QT_UI)
		if (!Core_IsStepping()) {
			GL_SwapBuffers();
		}
#endif
	}
}
示例#2
0
文件: Core.cpp 项目: Bennieboj/ppsspp
void Core_RunLoop()
{
	while (!coreState) {
		time_update();
		double startTime = time_now_d();
		UpdateScreenScale();
		{
			{
#ifdef _WIN32
				lock_guard guard(input_state.lock);
				input_state.pad_buttons = 0;
				input_state.pad_lstick_x = 0;
				input_state.pad_lstick_y = 0;
				input_state.pad_rstick_x = 0;
				input_state.pad_rstick_y = 0;
				// Temporary hack.
				if (GetAsyncKeyState(VK_ESCAPE)) {
					input_state.pad_buttons |= PAD_BUTTON_MENU;
				}
				host->PollControllers(input_state);
				UpdateInputState(&input_state);
#endif
			}
			NativeUpdate(input_state);
			EndInputState(&input_state);
		}
		NativeRender();
		time_update();
		// Simple throttling to not burn the GPU in the menu.
#ifdef _WIN32
		if (globalUIState != UISTATE_INGAME) {
			double sleepTime = 16.666 - (time_now_d() - startTime) * 1000.0;
			if (sleepTime > 0.0)
				Sleep((int)sleepTime);
			GL_SwapBuffers();
		} else if (!Core_IsStepping()) {
			GL_SwapBuffers();
		}
#endif
	}
}
示例#3
0
文件: Core.cpp 项目: Bulkman/ppsspp
void Core_RunLoop()
{
	while (!coreState) {
		time_update();
		double startTime = time_now_d();
		UpdateScreenScale();
		{
			{
#ifdef _WIN32
				lock_guard guard(input_state.lock);
				input_state.pad_buttons = 0;
				input_state.pad_lstick_x = 0;
				input_state.pad_lstick_y = 0;
				input_state.pad_rstick_x = 0;
				input_state.pad_rstick_y = 0;
				host->PollControllers(input_state);
				UpdateInputState(&input_state);
#endif
			}
			NativeUpdate(input_state);
			EndInputState(&input_state);
		}
		NativeRender();
		time_update();
		// Simple throttling to not burn the GPU in the menu.
#ifdef _WIN32
		if (globalUIState != UISTATE_INGAME) {
			double diffTime = time_now_d() - startTime;
			int sleepTime = (int) (1000000.0 / 60.0) - (int) (diffTime * 1000000.0);
			if (sleepTime > 0)
				Sleep(sleepTime / 1000);
			GL_SwapBuffers();
		} else if (!Core_IsStepping()) {
			GL_SwapBuffers();
		}
#endif
	}
}
示例#4
0
void Display_Func()
{
    // No images have come in from the server yet
    if (!GVRec) return; 
    
    // Setup camera 
    GVRec->DrawCam();
 
    // draw each tile
    Display_Tile_List.Iterate(TileDisplay, NULL);
    
    GL_SwapBuffers();
    
    // Load any waiting texture image
    LoadTexture();
    
}
示例#5
0
void GL_EndRendering (void)
{
	if (r_swapInterval.modified) {
		if (r_swapInterval.integer == 0) {
			if (SDL_GL_SetSwapInterval(0)) {
				Con_Printf("vsync: Failed to disable vsync...\n");
			}
		} else if (r_swapInterval.integer == -1) {
			if (SDL_GL_SetSwapInterval(-1)) {
				Con_Printf("vsync: Failed to enable late swap tearing (vid_vsync -1), setting vid_vsync 1 instead...\n");
				Cvar_SetValueByName("vid_vsync", 1);
			}
		}

		if (r_swapInterval.integer == 1) {
			if (SDL_GL_SetSwapInterval(1)) {
				Con_Printf("vsync: Failed to enable vsync...\n");
			}
		}

		r_swapInterval.modified = false;
        }

	if (!scr_skipupdate || block_drawing) {
		// Multiview - Only swap the back buffer to front when all views have been drawn in multiview.
		if (cl_multiview.value && cls.mvdplayback) {
			if (CURRVIEW != 1) {
				return;
			}
		}

		if (vid_vsync_lag_fix.integer > 0) {
			GL_SwapBuffersWithVsyncFix();
		} else {
			GL_SwapBuffers(); 
		}
	}
}