Skip to main content
GameDev.net gamedev.net
🔒 Locked

moving sprites using directx9

Started by pbivens67 Mar 21, 2021 at 10:38 PM 1 replies 3.9k views
Original Post
pbivens67
pbivens67

I am building a breakout game using directx9. I am able to draw the paddle but I cannot move it, I am new to directx9 so go easy on me. here is the code where I get keyboard input from. I am unsure of where my problem is at.

//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--;
			break;
		case VK_RIGHT:
			move_x++;
			break;
		} break;
	} break;

	}

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

is there anyone here good at direct x 9?

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.