• Welcome to Dark Bit Factory & Gravity.
 

DirectInput framework for C++

Started by Jim, March 14, 2007

Previous topic - Next topic

0 Members and 0 Guests are viewing this topic.

Jim

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
Challenge Trophies Won:

rdc


benny!

Cool. Works like a charm.

Is there any differents or pro/contra using dinput instead of processing WM_KEYXXX/wparam ?
[ mycroBLOG - POUET :: whatever keeps us longing - for another breath of air - is getting rare ]

Challenge Trophies Won:

Jim

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
Challenge Trophies Won:

benny!

Thanks for the info, Jim!
[ mycroBLOG - POUET :: whatever keeps us longing - for another breath of air - is getting rare ]

Challenge Trophies Won:

Shockwave

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.
Shockwave ^ Codigos
Challenge Trophies Won:

benny!

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 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.
[ mycroBLOG - POUET :: whatever keeps us longing - for another breath of air - is getting rare ]

Challenge Trophies Won: