Jump to content
  • Advertisement

Archived

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

Unliterate

what are the advantages of using DirectInput8 over Windows funcitons

This topic is 5230 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

Other than support for game pads and such, is there an advantage to using direct input over stuff like GetAsyncKeyState() and GetCursorPos? (namely in terms of speed)

Share this post


Link to post
Share on other sites
Advertisement
You get more up-to-the-picosecond information (DirectInput working directly with the hardware, rather than through abstraction layers), plus you get things like buffered input that you don''t get with GetAsyncKeyState().

So yes, better speed.

Share this post


Link to post
Share on other sites
DI lets you, in effect, setup an interrupt handler for input devices (via event notification). It is almost as close to the metal as you can get in a protected-mode system, such as Win32.

-Nik

Share this post


Link to post
Share on other sites
What versions of the .lib and .h files should i be using? i get these errors:

INPUT.OBJ : error LNK2001: unresolved external symbol _GUID_SysMouse
INPUT.OBJ : error LNK2001: unresolved external symbol _GUID_SysKeyboard
INPUT.OBJ : error LNK2001: unresolved external symbol _IID_IDirectInput8A
dinput8.lib(dilib5.obj) : error LNK2001: unresolved external symbol _GUID_ZAxis
dinput8.lib(dilib5.obj) : error LNK2001: unresolved external symbol _GUID_YAxis
dinput8.lib(dilib5.obj) : error LNK2001: unresolved external symbol _GUID_XAxis
dinput8.lib(dilib2.obj) : error LNK2001: unresolved external symbol _GUID_Key
Debug/Unreal 2D.exe : fatal error LNK1120: 7 unresolved externals
Error executing link.exe.


using dinput.h and dinput8.lib

Share this post


Link to post
Share on other sites
dxguid.lib

"A soldier is a part of the 1% of the population that keeps the other 99% free" - Lt. Colonel Todd, 1/38th Infantry, Ft. Benning, GA

Share this post


Link to post
Share on other sites
1) link with dxguid.lib to make the errors go away

2) if you need TEXT input, DO NOT use DirectInput, use WM_CHAR messages.

3) if you need control input (ie. key X = move player right), then DirectInput is suitable.


Simon O''Connor
Game Programmer &
Microsoft DirectX MVP

Share this post


Link to post
Share on other sites
holy hell, fast responces! thanks.

ok i guess they just seemed fast,i hadnt checked the times. (i just experienced a time lapse or something)

[edited by - unliterate on May 30, 2004 7:30:04 PM]

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.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!