glutSetCursor()

I want mouse events like say clicking to call the glut function glutSetCursor() and change the cursor depending on which button is pressed. However when I try to call the function and pass the value, GLUT_CURSOR_RIGHT_ARROW, I get a segmentation fault and a core dump. When I take the same line of code out its all good, no segfault. I can also call the function multiple times if I pass GLUT_CURSOR_NONE without any troubles. What’s up with this funky function?

GLUT just requests that the OS should change the cursor so this depends on what system you are running. It should change for the current window so you must of course have a current window.