How do you solve keyboard and mouse input ?

Started by
4 comments, last by Shadow2 20 years, 1 month ago
How do you solve keyboard and mouse input if you are using OpenGL? I heard about GLUT ...but I don''t know how to use it? I mean ..is it better to use DirectX for input or Glut...or something simylar?
Advertisement
you should check out SDL (www.libsdl.org)
its pretty easy to set up your input handling with it.
to get tutorials for SDL just have a look at the website or just google for it.

chaos, panic and disorder - my work here is finished

If u want crossplatfrom then use SDL, if you''re doing win32 you could use DirectInput.
something i switched to today because sdl was a pain in the... glfw. its pretty basic though, window, keyboard, mouse, joystick and thats it, doesnt seem to use directx internally like sdl (the reason i picked it, finally debugging without biting the table).

if you need "more" than just that and want to be more or less platform independent then use sdl.
f@dzhttp://festini.device-zero.de
I switched to glfw as well http://glfw.sourceforge.net
Iam actually using the win32 windows procedure and bools...

i know that some say the windows procedure isn´t fast but it works pretty good

case WM_KEYDOWN:
{

driver.keys[wParam] = TRUE;
return 0;
}

case WM_KEYUP:
{

driver.keys[wParam] = FALSE;
return 0;
}

it works pretty well till now (this is actually the solution from nehe´s OGL page)...

This topic is closed to new replies.

Advertisement