Efficient interactions without DirectInput?
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
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.
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.
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,
LPMOUSEMOVEPOINT lppt,
LPMOUSEMOVEPOINT lpptBuf,
nBuffPouints,
DWORD resolution
);
Here is the structure to hold the mouse data:
typedef struct tagMOUSEMOVEPOINT{
int x;
int y;
DWORD time;
DWORD dwExtraInfo;
} FAR* LPMOUSEMOVEPOINT;
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.
Here is the function:
int WINAPI GetMouseMovePoints(
UINT cbSize,
LPMOUSEMOVEPOINT lppt,
LPMOUSEMOVEPOINT lpptBuf,
nBuffPouints,
DWORD resolution
);
Here is the structure to hold the mouse data:
typedef struct tagMOUSEMOVEPOINT{
int x;
int y;
DWORD time;
DWORD dwExtraInfo;
} FAR* LPMOUSEMOVEPOINT;
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.
"Donkey, if it were me, you'd be dead."I cna ytpe 300 wrods pre mniute.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement