direct x and keyboard input

Started by
1 comment, last by Dunge 15 years, 8 months ago
I want to move a sprite using direct x and the keyboard but am unsure of how to proceed.
Advertisement
My advice: use the standard windows messages (WM_KEYUP and WM_KEYDOWN), or just use GetKeyState to tell if a particular key is being held down.
Direct3D have nothing to do with inputs, it simply draw to the screen. There are many ways to read inputs, and the simplest one is as MJP said, windows Message (WM_KEYUP) or Win32 api call (GetKeyState). You can also use a library like SDL but it's not much intelligent if you don't use it for rendering. If you want a bit better input than normal Win32 ones, you can use DirectInput which is part of DirectX and support mouse/joystick/force feedback easily. Latest version still use DirectX8. http://msdn.microsoft.com/en-us/library/bb219802(VS.85).aspx

This topic is closed to new replies.

Advertisement