🎉 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!

moving sprites using directx9

Started by
1 comment, last by pbivens67 3 years, 2 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);
}

Advertisement

is there anyone here good at direct x 9?

This topic is closed to new replies.

Advertisement