Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.


#13 glutGetModifiers(): Call anytime

Richard Rauch

For reasons that elude me, freeglut prohibits clients
from calling glutGetModifiers() outside of an
input-processing callback.

This means that if the client wants to track input
modifiers, it must do so in its own state variable---one
which conceivably won't be updated as often as the
library might be able to get updated information from
the OS.

Meanwhile, the library goes to some lengths to carefully
throw away collected information about the state of
modifier keys.

The result both is surprising (to me, as a user) and is
more code than would be required if we allowed the
modifer state info to persist.

I'm connsidering removing the lines that "disable" the
modifer state, and setting the initial modifier state to
0 (all modifers assumed not to be pressed). This would
mean changing the initialization (and perhaps cleanup)
code trivially, deleting the lines that "disable" the
modifier state, and deletig the lies to check for the
"disabled" condition.

Given that OpenGLEAN must collect this info, I see no
reason to discard it wantonly.


  • Richard Rauch
    Richard Rauch

    • summary: Allow glutGetModifiers() to be called anytime. --> glutGetModifiers(): Callable anytime
  • Richard Rauch
    Richard Rauch

    • summary: glutGetModifiers(): Callable anytime --> glutGetModifiers(): Called anytime
  • Richard Rauch
    Richard Rauch

    • summary: glutGetModifiers(): Called anytime --> glutGetModifiers(): Call anytime