Browse Source

NaClApplication: fixed boolean fuckup.

Now viewportEvent() is called properly on startup _and_ when resizing,
not everytime else.
pull/7/head
Vladimír Vondruš 14 years ago
parent
commit
152eb4e4b4
  1. 5
      src/Platform/NaClApplication.cpp

5
src/Platform/NaClApplication.cpp

@ -51,6 +51,9 @@ NaClApplication::NaClApplication(PP_Instance instance, const Math::Vector2<GLsiz
/* Enable input handling for mouse and keyboard */ /* Enable input handling for mouse and keyboard */
RequestInputEvents(PP_INPUTEVENT_CLASS_MOUSE|PP_INPUTEVENT_CLASS_WHEEL); RequestInputEvents(PP_INPUTEVENT_CLASS_MOUSE|PP_INPUTEVENT_CLASS_WHEEL);
RequestFilteringInputEvents(PP_INPUTEVENT_CLASS_KEYBOARD); RequestFilteringInputEvents(PP_INPUTEVENT_CLASS_KEYBOARD);
/* Make sure viewportEvent() is called for first time */
flags |= Flag::ViewportUpdated;
} }
NaClApplication::~NaClApplication() { NaClApplication::~NaClApplication() {
@ -69,7 +72,7 @@ void NaClApplication::DidChangeView(const pp::View& view) {
} }
/* Update viewport, if changed */ /* Update viewport, if changed */
if(!(flags & Flag::ViewportUpdated)) { if(flags & Flag::ViewportUpdated) {
flags &= ~Flag::ViewportUpdated; flags &= ~Flag::ViewportUpdated;
viewportEvent(size); viewportEvent(size);
} }

Loading…
Cancel
Save