Exemplo n.º 1
0
// handles window messages				
LRESULT CALLBACK WndProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
{

	switch (message)
	{
		case WM_CREATE:
			break;

		case WM_SIZE:
			scene.Resize();
			break;

		case WM_KEYDOWN:
			input.SetKeyDown(wParam);
			break;

		case WM_KEYUP:
			input.SetKeyUp(wParam);
			break;

		case WM_MOUSEMOVE:
			input.setMouseX(LOWORD(lParam));
			input.setMouseY(HIWORD(lParam));
			break;

		case WM_DESTROY:
			PostQuitMessage(0);
			break;
	}

	return DefWindowProc(hwnd, message, wParam, lParam);

}
Exemplo n.º 2
0
bool TestKeys()
{
	if (input.isKeyDown(VK_ESCAPE)) // if ESC is pressed
	{
		input.SetKeyUp(VK_ESCAPE); // force unpressing of ESC
		return false;
	}
	else {
		return true;
	}
}