|
|
|
@ -603,16 +603,21 @@ void GlfwApplication::setSwapInterval(const Int interval) { |
|
|
|
int GlfwApplication::exec() { |
|
|
|
int GlfwApplication::exec() { |
|
|
|
CORRADE_ASSERT(_window, "Platform::GlfwApplication::exec(): no window opened", {}); |
|
|
|
CORRADE_ASSERT(_window, "Platform::GlfwApplication::exec(): no window opened", {}); |
|
|
|
|
|
|
|
|
|
|
|
while(!glfwWindowShouldClose(_window)) { |
|
|
|
while(mainLoopIteration()) {} |
|
|
|
if(_flags & Flag::Redraw) { |
|
|
|
|
|
|
|
_flags &= ~Flag::Redraw; |
|
|
|
|
|
|
|
drawEvent(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
glfwPollEvents(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
return _exitCode; |
|
|
|
return _exitCode; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
bool GlfwApplication::mainLoopIteration() { |
|
|
|
|
|
|
|
if(_flags & Flag::Redraw) { |
|
|
|
|
|
|
|
_flags &= ~Flag::Redraw; |
|
|
|
|
|
|
|
drawEvent(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
glfwPollEvents(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return !glfwWindowShouldClose(_window); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
namespace { |
|
|
|
namespace { |
|
|
|
|
|
|
|
|
|
|
|
constexpr Int CursorMap[] { |
|
|
|
constexpr Int CursorMap[] { |
|
|
|
|