Exemplo n.º 1
0
// Run the demo
void Demo::Run()
{
	// Get the instance
	Demo *p = Demo::privGetInstance();

	p->running = true;

	p->privReset();

	// Main message loop
	MSG msg = { 0 };

	// Game Loop until an exit
	while (p->running)
	{
		// Check messages
		if (PeekMessage(&msg, nullptr, 0, 0, PM_REMOVE))
		{
			TranslateMessage(&msg);
			DispatchMessage(&msg);

			if (WM_QUIT == msg.message)
			{
				p->Quit();
				continue;
			}
		}
		else
		{
			// called once per frame, update data, transformations, etc
			p->Update();

			// called once per frame, only do rendering here
			p->Draw();
		}
	}
};