PDA

View Full Version : using WINAPI procedures with opengl



billy_the_kid
01-30-2011, 08:56 AM
Hi,
My glutMouseFunc() doesn't handle the mouse scrolling.
So in order to handle it Im forced to use some alternative way apart from Glut. I've read about it in msdn but I didn't figure out where and how to get control over the received mouse event messages. Any idea?

remdul
01-30-2011, 12:19 PM
Getting hold of mouse input has always been lacking in Windows. The by Microsoft recommended way to handle this is with DirectInput, but this is a terrible solution as it drags in a large number of dependencies and is outdated as well.

However I've found SDL to be a good alternative. I haven't FreeGLUT or other more recent GLUT clones, but I suspect they also have more complete input support. The original GLUT is so old, scroll wheels didn't even exist back then. :)

ZbuffeR
01-30-2011, 04:13 PM
GLFW supports scroll wheel too.

billy_the_kid
02-04-2011, 03:08 AM
Thanx for the answares guys, but I have another question. Do I need to synchronise the threads of callbacks of those functions?

glutMouseFunc( void (* callback)( int, int, int, int ) );
glutMotionFunc( void (* callback)( int, int ) );
glutDisplayFunc( void (* callback)( void ) );

ZbuffeR
02-04-2011, 06:35 AM
Callback are not threads. Pretty much the opposite, in fact. So no, no need to synchronize anything (unless you add your own threads, but you should not).

billy_the_kid
02-07-2011, 07:42 AM
Two callbacks called from two paralel distinct treads are still treads. If they are called one after another in the same tread then there's no need for tread synchronisation. So are you sure that the synchronisation is not necessary?

Rosario Leonardi
02-17-2011, 03:30 PM
All glut callbacks are called in the event proc from the same function. No synchronization is needed.
The single thread nature of glut is another reason to switch to another framework.