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.

Close

#13 glutGetModifiers(): Call anytime

open
nobody
5
2005-08-12
2005-07-30
Richard Rauch
No

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.

Discussion

  • Richard Rauch
    Richard Rauch
    2005-08-12

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

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

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