Jump to content
  • Advertisement
Sign in to follow this  
smallGame

OpenGL Using keyboard / mouse with API

This topic is 3627 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 am using a win API, with my own openGL DLL to display, I started to use keyboard and mouse from API but it's pretty bad, I am wondering which library to use to manage keyboard and mouse to have a better reactivity. I suppose I can't use glut keyboard and mouse function because I am using window API, then I have the intuition it's not a good idea to use DirectInput :) Thanks,

Share this post


Link to post
Share on other sites
Advertisement
I didn't get any answer on this topic. :[

If you develop in openGl can you tell just tell how do you manage mouse and keyboard? SDL, glut, QT??? Nobody are using a winMain with windows.h ??

It's sure sounds really bad, why to use a windows main with a library multiplatform?

In my case it's because, I progam in DirectX10 and openGl, so I have an EXE, and in function of the DLL I use with my EXE it's Direct3D or openGl.

An idea to resolve my problem it's to put the main function with the graphic library, in this way I will have two EXE and a DLL for the game. I think that's really strange conception, evryone will agree that it's better to have only one EXE, and in function of the DLL you're using the program will change.


Any idea or advise that could help me?

Thanks

Share this post


Link to post
Share on other sites
Quote:
Original post by smallGame
If you develop in openGl can you tell just tell how do you manage mouse and keyboard?
Myself? Pyglet.
Quote:
SDL, glut, QT???
If you are using one of these for windowing, then you should use it for events as well.
Quote:
Nobody are using a winMain with windows.h ??
Almost every windows-specific (or windows backend for a cross platform engine) is implemented in this way. If you need sample code, all of NeHe's tutorials use this method.

Share this post


Link to post
Share on other sites
Quote:
Original post by swiftcoder
Quote:
Original post by smallGame
SDL, glut, QT???
If you are using one of these for windowing, then you should use it for events as well.

No I am not

Quote:
Original post by swiftcoder
Quote:
Original post by smallGame
Nobody are using a winMain with windows.h ??


Almost every windows-specific (or windows backend for a cross platform engine) is implemented in this way. If you need sample code, all of NeHe's tutorials use this method.


Yes I have seen it, but the keyboard and mouse output are not efficient. I am using it with DirectX as well but for peripheric I use DirectInput. A good solution it would be to have an equivalent GLInput.

Actually my problem is when I maintain a virtual key for exemple VK_HOME, I have a big lag. I don't get this problem if I maintain a letter or a digit. But I am not in the good forum to speak about that.

Share this post


Link to post
Share on other sites
This isn't much of an openGL question, however since you're using winAPI, you'll get good "reactivity", as you call it, with GetAsyncKeyState and, unlike glut, it will let you easily support events where multiple keys are pressed, like walking forward and strafing at the same time, as for FPS example.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • 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!