Inside3D!
     

To DirectInput or not to DirectInput?

 
Post new topic   Reply to topic    Inside3d Forums Forum Index -> Engine Programming
View previous topic :: View next topic  

Do you Direct?
Gimme gimme DirectInput baby!
80%
 80%  [ 4 ]
Software all the way for me!
20%
 20%  [ 1 ]
Total Votes : 5

Author Message
mh



Joined: 12 Jan 2008
Posts: 909

PostPosted: Tue Jan 13, 2009 10:57 pm    Post subject: To DirectInput or not to DirectInput? Reply with quote

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. Very Happy
_________________
DirectQ Engine - New release 1.8.666a, 9th August 2010
MHQuake Blog (General)
Direct3D 8 Quake Engines
Back to top
View user's profile Send private message Visit poster's website
Baker



Joined: 14 Mar 2006
Posts: 1538

PostPosted: Tue Jan 13, 2009 11:20 pm    Post subject: Reply with quote

-dinput is overwhelmingly popular among the experienced. I recently learned of an engine that actually uses it by default Wink

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 Wink
Back to top
View user's profile Send private message
mh



Joined: 12 Jan 2008
Posts: 909

PostPosted: Tue Jan 13, 2009 11:45 pm    Post subject: Reply with quote

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. Laughing

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
View user's profile Send private message Visit poster's website
Spike



Joined: 05 Nov 2004
Posts: 944
Location: UK

PostPosted: Wed Jan 14, 2009 5:46 pm    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    Inside3d Forums Forum Index -> Engine Programming All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2004 phpBB Group