Advertisement

moving sprites using directx9

Started by March 21, 2021 10:38 PM
1 comment, last by pbivens67 3 years, 7 months ago

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);
}

is there anyone here good at direct x 9?

This topic is closed to new replies.

Advertisement