views:

29

answers:

1

So I just built an OpenGL application on a Mac for the first time. I'm using GLUT to get keyboard input. The trouble is, I've discovered that if I'm moving the mouse at the same time I push a button on the keyboard, my keyboard function doesn't get called! If I push a button when the mouse isn't moving, it gets called just fine. The same goes for my keyUp function. Why could this be?

I'm also having trouble with the mouse motionFunc - it seems to not be getting called every frame and lead to choppy mouse input ...

+1  A: 

Can you provide a code sample? It sounds like a bug in your event handling code.

That said, GLUT is no longer developed and you should not be using it. There are numerous better alternatives, the most popular being SDL. Others include GLFW and SFML, and you can even use Qt.

amro
That's good to know. I'm using the GLUT framework that came with XCode. I found that calling glutWarpPointer on a mouse move (to do a freelook) is what was causing the keyboard input to not go through. I'll look at these others. Thanks!
Chris