Skip to content

Commit

Permalink
Platform: cleanup in AndroidApplication.
Browse files Browse the repository at this point in the history
  • Loading branch information
mosra committed May 8, 2015
1 parent 5b135cc commit a9aee19
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
8 changes: 4 additions & 4 deletions src/Magnum/Platform/AndroidApplication.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ AndroidApplication::AndroidApplication(const Arguments& arguments, std::nullptr_

AndroidApplication::~AndroidApplication() {
eglMakeCurrent(_display, EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT);
eglDestroyContext(_display, _context);
eglDestroyContext(_display, _glContext);
eglDestroySurface(_display, _surface);
eglTerminate(_display);
}
Expand Down Expand Up @@ -127,16 +127,16 @@ bool AndroidApplication::tryCreateContext(const Configuration& configuration) {
#endif
EGL_NONE
};
if(!(_context = eglCreateContext(_display, config, EGL_NO_CONTEXT, contextAttributes))) {
if(!(_glContext = eglCreateContext(_display, config, EGL_NO_CONTEXT, contextAttributes))) {
Error() << "Platform::AndroidApplication::tryCreateContext(): cannot create EGL context:"
<< Implementation::eglErrorString(eglGetError());
return false;
}

/* Make the context current */
CORRADE_INTERNAL_ASSERT_OUTPUT(eglMakeCurrent(_display, _surface, _surface, _context));
CORRADE_INTERNAL_ASSERT_OUTPUT(eglMakeCurrent(_display, _surface, _surface, _glContext));

_c.reset(new Platform::Context);
_context.reset(new Platform::Context);
return true;
}

Expand Down
8 changes: 4 additions & 4 deletions src/Magnum/Platform/AndroidApplication.h
Original file line number Diff line number Diff line change
Expand Up @@ -310,9 +310,9 @@ class AndroidApplication {

EGLDisplay _display;
EGLSurface _surface;
EGLContext _context;
EGLContext _glContext;

std::unique_ptr<Platform::Context> _c;
std::unique_ptr<Platform::Context> _context;
std::unique_ptr<LogOutput> _logOutput;

CORRADE_ENUMSET_FRIEND_OPERATORS(Flags)
Expand Down Expand Up @@ -485,7 +485,7 @@ class AndroidApplication::MouseEvent: public InputEvent {
}

private:
MouseEvent(AInputEvent* event): InputEvent(event) {}
explicit MouseEvent(AInputEvent* event): InputEvent(event) {}
};

/**
Expand Down Expand Up @@ -561,7 +561,7 @@ class AndroidApplication::MouseMoveEvent: public InputEvent {
}

private:
MouseMoveEvent(AInputEvent* event): InputEvent(event) {}
explicit MouseMoveEvent(AInputEvent* event): InputEvent(event) {}
};

CORRADE_ENUMSET_OPERATORS(AndroidApplication::MouseMoveEvent::Buttons)
Expand Down

0 comments on commit a9aee19

Please sign in to comment.