Example #1
0
void RunFrame ()
{
	CountFPS();

	// keep till last
	display();
	SwapBuffers(ghDC);
}
Example #2
0
void MainLoop()
{

#ifdef _DEBUG_TIMINGS
	mainlooptime = GetTickCount() - mainlooptime_prv;
#endif

	while(PeekMessage(&msg, NULL, NULL, NULL, PM_REMOVE))
	{
			DispatchMessage(&msg);

				if (keys[VK_F11])
				{
					LogToFile("Saving screenshot...");
					if(gui)
						gui->LogOnScreen("Saving screenshot");
					if(!SaveScreenshot(cfg.scr_width, cfg.scr_height, cfg.scr_bpp))
						LogToFile("Failed save screenshot");
				}

				if (keys[VK_ESCAPE])
				{
					current_state = GAME_EXITING;
				}

				if (keys[VK_F5])
				{
					cfg.debug = !cfg.debug;
				}

	}

	current_time = (GetTickCount() - startup_time);

	if(gui) gui->Process();
	
	CountFPS();	

#ifdef _DEBUG_TIMINGS

	mainlooptime_prv = GetTickCount();

	mainlooptime_med += mainlooptime;

#endif
}
Example #3
0
void scene::MainLoop()
{
	current_time = (GetTickCount() - startup_time);

	ProcessKeyboard();

	if(TERMINATE_IICHAN)
	{
		delete iichan;
		iichan = NULL;
	}

	if(iichan)
		iichan->Move();
	if(gui)
		gui->Process();

	
	CountFPS();	
}