🎉 Celebrating 25 Years of GameDev.net! 🎉

Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!

more directx9 tutorial

Started by
10 comments, last by pbivens67 3 years, 3 months ago

I am trying to get my paddle sprite to move but it won't move at all. Here is my keyboard input code.

//WindowProc - Handles input sent to the window.
LRESULT CALLBACK WindowProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
{
	switch(message)
	{
	case WM_DESTROY:
		{
			PostQuitMessage(0);
			return 0;
		} break;
	case WM_CLOSE:
		{
			PostQuitMessage(0);
			return 0;
		} break;
	case WM_KEYDOWN:
	{
		switch (wParam)
		{
		case VK_LEFT:
			move_x--;
			InvalidateRect(hWnd, NULL, FALSE);
			break;
		case VK_RIGHT:
			move_x++;
			InvalidateRect(hWnd, NULL, FALSE);
			break;
		} break;
	} break;

	}

	return DefWindowProc(hWnd, message, wParam, lParam);
}

This topic is closed to new replies.

Advertisement