Browse Source

Platform: cleanup in AndroidApplication.

pull/107/head
Vladimír Vondruš 11 years ago
parent
commit
a9aee1935d
  1. 8
      src/Magnum/Platform/AndroidApplication.cpp
  2. 8
      src/Magnum/Platform/AndroidApplication.h

8
src/Magnum/Platform/AndroidApplication.cpp

@ -67,7 +67,7 @@ AndroidApplication::AndroidApplication(const Arguments& arguments, std::nullptr_
AndroidApplication::~AndroidApplication() { AndroidApplication::~AndroidApplication() {
eglMakeCurrent(_display, EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT); eglMakeCurrent(_display, EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT);
eglDestroyContext(_display, _context); eglDestroyContext(_display, _glContext);
eglDestroySurface(_display, _surface); eglDestroySurface(_display, _surface);
eglTerminate(_display); eglTerminate(_display);
} }
@ -127,16 +127,16 @@ bool AndroidApplication::tryCreateContext(const Configuration& configuration) {
#endif #endif
EGL_NONE 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:" Error() << "Platform::AndroidApplication::tryCreateContext(): cannot create EGL context:"
<< Implementation::eglErrorString(eglGetError()); << Implementation::eglErrorString(eglGetError());
return false; return false;
} }
/* Make the context current */ /* 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; return true;
} }

8
src/Magnum/Platform/AndroidApplication.h

@ -310,9 +310,9 @@ class AndroidApplication {
EGLDisplay _display; EGLDisplay _display;
EGLSurface _surface; EGLSurface _surface;
EGLContext _context; EGLContext _glContext;
std::unique_ptr<Platform::Context> _c; std::unique_ptr<Platform::Context> _context;
std::unique_ptr<LogOutput> _logOutput; std::unique_ptr<LogOutput> _logOutput;
CORRADE_ENUMSET_FRIEND_OPERATORS(Flags) CORRADE_ENUMSET_FRIEND_OPERATORS(Flags)
@ -485,7 +485,7 @@ class AndroidApplication::MouseEvent: public InputEvent {
} }
private: private:
MouseEvent(AInputEvent* event): InputEvent(event) {} explicit MouseEvent(AInputEvent* event): InputEvent(event) {}
}; };
/** /**
@ -561,7 +561,7 @@ class AndroidApplication::MouseMoveEvent: public InputEvent {
} }
private: private:
MouseMoveEvent(AInputEvent* event): InputEvent(event) {} explicit MouseMoveEvent(AInputEvent* event): InputEvent(event) {}
}; };
CORRADE_ENUMSET_OPERATORS(AndroidApplication::MouseMoveEvent::Buttons) CORRADE_ENUMSET_OPERATORS(AndroidApplication::MouseMoveEvent::Buttons)

Loading…
Cancel
Save