Dark Bit Factory & Gravity

PROGRAMMING => C / C++ /C# => Topic started by: Jim on March 14, 2007

Title: DirectInput framework for C++
Post by: Jim on March 14, 2007
Here's a basic framework for using DirectInput.  It shows how to use the keyboard, mouse and joystick.
Myself, I prefer to use Windows messages to handle mouse and keyboard and winmm.lib to handle joysticks, but here's the DirectX method.

Jim
Title: Re: DirectInput framework for C++
Post by: rdc on March 14, 2007
Another nice one Jim. :)
Title: Re: DirectInput framework for C++
Post by: benny! on March 14, 2007
Cool. Works like a charm.

Is there any differents or pro/contra using dinput instead of processing WM_KEYXXX/wparam ?
Title: Re: DirectInput framework for C++
Post by: Jim on March 14, 2007
Yeah, the key handling doesn't let you get what order the keys were pressed in.
DirectInput lets you poll the mouse instead of waiting for events, which might make processing relative movements easier.
Jim
Title: Re: DirectInput framework for C++
Post by: benny! on March 14, 2007
Thanks for the info, Jim!
Title: Re: DirectInput framework for C++
Post by: Shockwave on March 14, 2007
I'm looking forward to knowing the syntax enough to be able to try all these nice frameworks you have posted Jim.

I just want to say thank you for taking the time to do it, I appreciate it, I appreciate it very much.
Title: Re: DirectInput framework for C++
Post by: benny! on March 14, 2007
Definately. Those frameworks are outstanding. Especially when you are new
to this DirectX stuff - it saves you from a lot of headaches when it come to
detail.

Especially Direct3D (http://dbfinteractive.com/index.php?topic=1536.0) framework has so many cool things already implanted.
Texture generation, fullscreen/window switch, basic WinApi stuff in WindowProc
and of course the basic 3D functions.

I really tend to start spending some time with DirectX - but on the other hand
I have too much other things to do - which is really a shame. If I had more
time I would definately start coding upon Jim's frameworks.