View previous topic :: View next topic |
Do you Direct? |
Gimme gimme DirectInput baby! |
|
80% |
[ 4 ] |
Software all the way for me! |
|
20% |
[ 1 ] |
|
Total Votes : 5 |
|
Author |
Message |
mh

Joined: 12 Jan 2008 Posts: 909
|
Posted: Tue Jan 13, 2009 10:57 pm Post subject: To DirectInput or not to DirectInput? |
|
|
I'm seriously considering removing the software mouse code from my engine. Advantage 1 is that I can have a simpler input code path with only one API to support. Advantage 2 is that I can construct a lot of reusable code for all input devices. Advantage 3 is that I would no longer have to write everything twice - once for DirectInput and once for software.
I'm interested in how many people really prefer to use software input. I know that there are some, with the main argument being that DirectInput sometimes feels slower, but I've already overcome that by adding an additional boost cvar. Reading MSDN it looks easy enough to also add mouse acceleration if required.
Another argument is that DirectInput may fail to start, but I don't really buy that. May have been valid in 1996 with version 3.0, but it's 2009 and version 8.0 these days. It's a robust, mature, proven-in-the-field API.
Last argument is that MS themselves no longer recommend use of DirectInput, but I'm wondering how much of that is coloured by their push towards the XNA platform.
OK, I'm one of those weird people that enjoys writing input code, and DirectInput is a spectacularly clean API that's just a pleasure to use, but I'm also genuinely interested here.  _________________ DirectQ Engine - New release 1.8.666a, 9th August 2010
MHQuake Blog (General)
Direct3D 8 Quake Engines |
|
Back to top |
|
 |
Baker

Joined: 14 Mar 2006 Posts: 1538
|
Posted: Tue Jan 13, 2009 11:20 pm Post subject: |
|
|
-dinput is overwhelmingly popular among the experienced. I recently learned of an engine that actually uses it by default
I used to use the non-dinput way a few years ago, and then I did some experimentation and realized that with dinput the mouse control actually does what you do with the mouse movement.
It is very sad that Linux and OSX don't have a dinput equivalent.
Quote: | Last argument is that MS themselves no longer recommend use of DirectInput |
But those are the same people that recommend you switch to Vista  |
|
Back to top |
|
 |
mh

Joined: 12 Jan 2008 Posts: 909
|
Posted: Tue Jan 13, 2009 11:45 pm Post subject: |
|
|
OK, I've added mouse acceleration to DirectInput. Go check out Tutorials for the full dirt on the matter. It's a lousy gameplay experience, by the way.
Baker wrote: | It is very sad that Linux and OSX don't have a dinput equivalent. |
I suppose SDL probably has something, but I seriously don't know enough about it. _________________ DirectQ Engine - New release 1.8.666a, 9th August 2010
MHQuake Blog (General)
Direct3D 8 Quake Engines |
|
Back to top |
|
 |
Spike
Joined: 05 Nov 2004 Posts: 944 Location: UK
|
Posted: Wed Jan 14, 2009 5:46 pm Post subject: |
|
|
Baker wrote: | It is very sad that Linux and OSX don't have a dinput equivalent. |
evdev.
vista warning: on my vista laptop, I get periodic input stalls when not using dinput/rawinput.
if you detect vista, you ought to avoid defaulting to detecting mouse movements. Framerates are fine, it just periodically stops receiving inputs.
rawinput (xp/vista but not 2k) will supposedly give lower latency, as well as more than 5 mouse buttons. dinput is now a legacy api. _________________ What's a signature? |
|
Back to top |
|
 |
|