Browse Source

Platform: gracefully fail GlfwApplication::exec() if no window was opened

Signed-off-by: Squareys <squareys@googlemail.com>
pull/272/merge
Squareys 8 years ago committed by Vladimír Vondruš
parent
commit
f832c8df51
  1. 3
      doc/changelog.dox
  2. 2
      src/Magnum/Platform/GlfwApplication.cpp

3
doc/changelog.dox

@ -287,6 +287,9 @@ See also:
- @ref Platform::GlfwApplication::InputEvent::Modifier::Super is properly
reported for both left and right modifier (Windows/⌘) key instead of just
the right one
- @ref Platform::GlfwApplication::exec() now asserts instead of crashing if
the constructor fails to create a window (see [mosra/magnum#192](https://github.com/mosra/magnum/issues/192),
[mosra/magnum#272](https://github.com/mosra/magnum/pull/272))
@subsection changelog-latest-docs Documentation

2
src/Magnum/Platform/GlfwApplication.cpp

@ -436,6 +436,8 @@ void GlfwApplication::setSwapInterval(const Int interval) {
}
int GlfwApplication::exec() {
CORRADE_ASSERT(_window, "Platform::GlfwApplication::exec(): no window opened", {});
while(!glfwWindowShouldClose(_window)) {
if(_flags & Flag::Redraw) {
_flags &= ~Flag::Redraw;

Loading…
Cancel
Save