Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

Marius

direct input !

This topic is 5761 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I just realized how compilcated microsoft did it just by the love of COM (I dont see any othe reason why u need an interface there and stupid CoCreateInstance that returns void** (this is another story...)). I just looked at direct input stuff. Just to read in real time the KEY''s and Mouse you need a 222Kb header file, a 18K+147+163Kb of dll''s and lib and a parking lot full of GUID''s. Isn''t this crazy.. Guys the keyboard was read in real time centuries ago with few bytes of code there not ober-complicated layers of .. whatever... MCO

Share this post


Link to post
Share on other sites
Advertisement
Yes, it is a bit overkill. Which is probably why a lot of developers don''t even bother with DirectInput any more, except in the really high-speed stuff. But DirectInput does handle joysticks and so on, which can be a little more complex than a keyboard.

[ MSVC Fixes | STL | SDL | Game AI | Sockets | C++ Faq Lite | Boost | Asking Questions | Organising code files | My stuff ]

Share this post


Link to post
Share on other sites
...reason why u need an interface there
To obtain whichever version of the interface suits you from whichever version of the library is present.''

...stupid CoCreateInstance that returns void**
How else do you support two levels of indirection, short of deriving everything from a common "Object" class? IInterface::QueryInterface returns, in this case, IDirectInput, which in turn can return your specific version - say, IDirectInput8.

Just to read in real time the KEY''s and Mouse you need
a 222Kb header file, a 18K+147+163Kb of dll''s and lib and a parking lot full of GUID''s.

DirectInput wasn''t created for keyboards and 3-button mice, specifically. Try reading a 10-button HammerheadFX with dual analog joysticks and a 4-way d-pad "in real time" just based on hacking the game port. Add to that the ability for the device image to be stored in its driver, complete with multi-language property sheets, action maps...

If you didn''t twiddle bits just to read two 4-button gampads/joysticks (no yokes, throttles etc; those required additional drivers, and setup was a bitch), then you might not quite appreciate DirectInput. Yes, it''s bare-bones and low level, but it sure beats interrupt 21h.

Share this post


Link to post
Share on other sites
MS has succeeded in deceiving too many users that DirectX is a low-level/thin layer API. Being ugly does not necessiate higher speed and lower level access.
It performs well and does allow acess to many different controllers with various capabilities. It''s ok, but this is because there is no other available lib/interface that compensate for DirectInput.
I personally use OpenGL, OpenAL, and trying not to rely on DirectInput, use GetAsyncKeyState, ...
The worst is OpenAL under Windows is a DirectSound wrapper.

Share this post


Link to post
Share on other sites
MS has succeeded in deceiving too many users that DirectX is a low-level/thin layer API. Being ugly does not necessiate higher speed and lower level access.
It performs well and does allow acess to many different controllers with various capabilities. It''s ok, but this is because there is no other available lib/interface that compensate for DirectInput.
I personally use OpenGL, OpenAL, and trying not to rely on DirectInput, use GetAsyncKeyState, ...
The worst is OpenAL under Windows is a DirectSound wrapper.

Share this post


Link to post
Share on other sites
MS has succeeded in deceiving too many users that DirectX is a low-level/thin layer API. Being ugly does not necessiate higher speed and lower level access.
It performs well and does allow acess to many different controllers with various capabilities. It''s ok, but this is because there is no other available lib/interface that compensate for DirectInput.
I personally use OpenGL, OpenAL, and trying not to rely on DirectInput, use GetAsyncKeyState, ...
The worst is OpenAL under Windows is a DirectSound wrapper.

Share this post


Link to post
Share on other sites
What''s so bad about that? I can put that on a floppy disk and still have plenty of room. As for complexity, you can use it with just about any input device imaginable. Of course it''s complex. It''s flexibility comes at a cost. If it seems that the cost is too much, then you probably don''t need the flexibility and should consider a different route.

I''m working on a project that''s at about 5000+ lines of code and uses DirectInput for mouse and kb. The .exe is about 80k. It obviously doesn''t create that much overhead in the executable.

- Jay

"I have head-explody!!!" - NNY

Get Tranced!

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!