• Advertisement


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

Efficient interactions without DirectInput?

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

Hi, i''ve implemented an OpenGL test environment where the user can move (wheel) and look-around (hold right button) by mouse interactions. All inputs are handled by the Windows MSG-system, but sometime it is not efficient, because i got moving lags... The look-around is realized by using a thread mechanism, which loops until the button is released. The problem is that the first seconds the speed of the mouse is slow down and only accelerates to top speed after some time ... Many people told me, that i should implement DirectInput for efficient mouse interaction, but i will not use the DirectX stuff in an real OpenGL environment... Is there a way to make Windows messages more efficient? Thx 4 any help, Christian

Share this post

Link to post
Share on other sites
Is there something that terrifys you about DirectX? Theres a lot of myths about it. Is there any specific reason that you do not want to use it?

Direct Input is very nice, almost every windows game uses it, well, that I''ve saw anyway. (Quake3, UT, ect)

Also keep in mind that you don''t have to include every part of Direct X - you can pick and choose. For example you can mix Direct Input with Open GL and everything works fine. Its really not that hard to use either.

Share this post

Link to post
Share on other sites
DirectInput is a bit odd to implement in a GLUT application, but you are obviously not using GLUT. I just looked through WINUSER.h, and I think I found a simpler way of using the mouse without letting Windows handle it.
Here is the function:
int WINAPI GetMouseMovePoints(
UINT cbSize,
DWORD resolution

Here is the structure to hold the mouse data:
typedef struct tagMOUSEMOVEPOINT{
int x;
int y;
DWORD time;
DWORD dwExtraInfo;

For your purposes, you may just need the x and y data from the structure that you get from lppt.
Hope this helps, took me a while to find it!

"Donkey, if it were me, you''d be dead."
I cna ytpe 300 wrods pre mniute.

Share this post

Link to post
Share on other sites
Hawkeye i will not use the DirectX Libary because the plattform indipendence is shrink down by using this libary. When i using the standard message system, i must only change this part...

Duncan, thx 4 help, i will try it out ...

Share this post

Link to post
Share on other sites

  • Advertisement