Game Development Stack Exchange is a question and answer site for professional and independent game developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a big question. I started to develop a simple 3D engine (or should I call it framework?). I use OpenGL for rendering and it is developed for Windows. It is all written in C.

But I don't know, how to write an "interface" for the keyboard/mouse input. I would like to keep it as simple as possible and nice - what the Win32 "native" input system is not.

If anyone has suggestions about the topic, please, tell me.

Thanks for everyone, who answers to my question!

share|improve this question

There is more than one one way to skin the cat. If I understand correctly, you want to be able to take input from keyboard and mouse and use that to control stuff in your engine. But to write such interface from scratch, by yourself, would not only be a classic case of reinventing the wheel, but also, a very tedious task (think about it... you want to be able to support PS/2 and USB mice, as well as keyboards and you must admit, testing whether there's something present in a particular port, polling through USB hubs and ports... it's too much hassle when there's already available software to do that for you, right?)

So you will save much time using an already developed interface/framework of that kind. Such a component is a part of already mentioned FreeGLUT, but there is also SDL, which handles not only that, but also window manipulation, threading and more. Check it out. Pay attention to SDL_event struct and SDL_PollEvent function.

share|improve this answer

There are frameworks like FreeGLUT that give a basic input/output abilities with keyboard and mouse, but if you want more there are the Visual C++ APIs for Windows.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.