Browse Source

Merge branch 'master' into compatibility

Vladimír Vondruš 11 years ago
parent
commit
373b2df505
  1. 18
      doc/building.dox
  2. 4
      package/ci/jenkins-android.xml
  3. 11
      src/Magnum/Platform/AndroidApplication.cpp
  4. 10
      src/Magnum/Platform/AndroidApplication.h
  5. 2
      toolchains

18
doc/building.dox

@ -432,9 +432,9 @@ Emscripten supports dynamic libraries only to simplify porting and they are
generally slower, thus `BUILD_STATIC` is implicitly enabled. generally slower, thus `BUILD_STATIC` is implicitly enabled.
Then create build directory and run cmake and build command in it. The Then create build directory and run cmake and build command in it. The
toolchain needs access to its platform file, so be sure to properly set toolchain needs access to its platform file, so be sure to properly set **absolute**
**absolute** path to `modules/` directory containing `Platform/Emscripten.cmake`. path to `modules/` directory containing `Platform/Emscripten.cmake`. Also set
Also set `CMAKE_INSTALL_PREFIX` to path contained in `EMSCRIPTEN_TOOLCHAIN_PATH`. `CMAKE_INSTALL_PREFIX` to path contained in `EMSCRIPTEN_TOOLCHAIN_PATH`.
mkdir build-emscripten && cd build-emscripten mkdir build-emscripten && cd build-emscripten
cmake .. \ cmake .. \
@ -508,9 +508,9 @@ named `PKGBUILD-android-arm` and `PKGBUILD-android-x86`, see
In `package/ci/` there are `jenkins.xml` and `jenkins-gltests.xml` files In `package/ci/` there are `jenkins.xml` and `jenkins-gltests.xml` files
containing job configuration, one for build and non-GL tests and the other for containing job configuration, one for build and non-GL tests and the other for
GL tests only. Setup your Jenkins server, enable the **Git** and GL tests only. Setup your Jenkins server, enable the **Git** and **Text-finder**
**Text-finder** plugin and download the CLI application from here (replace plugin and download the CLI application from here (replace `localhost:8080`
`localhost:8080` with your server name): with your server name):
http://localhost:8080/cli http://localhost:8080/cli
@ -522,9 +522,9 @@ replace `localhost:8080` with your server name, replace `update-job` with
java -jar ~/jenkins-cli.jar -s http://localhost:8080 update-job Magnum-Compatibility-GLTests < package/ci/jenkins-gltests.xml java -jar ~/jenkins-cli.jar -s http://localhost:8080 update-job Magnum-Compatibility-GLTests < package/ci/jenkins-gltests.xml
Build is done using **Ninja** build system and everything possible is enabled, Build is done using **Ninja** build system and everything possible is enabled,
thus you need also **SDL2**, **GLUT** and **OpenAL** libraries. It expects that thus you need also **SDL2**, **GLUT** and **OpenAL** libraries. It expects
**GCC** >= 4.8.1, 4.7, 4.6, 4.5, 4.4 and **Clang** are installed and there are that **GCC** >= 4.8.1, 4.7, 4.6, 4.5, 4.4 and **Clang** are installed and there
**OpenGL**, **OpenGL ES 2.0** and **OpenGL ES 3.0** librares as it tries to are **OpenGL**, **OpenGL ES 2.0** and **OpenGL ES 3.0** librares as it tries to
compile the library with every combination of them. You can add/remove the axes compile the library with every combination of them. You can add/remove the axes
in `axes/hudson.matrix.TextAxis` or via the web interface later. in `axes/hudson.matrix.TextAxis` or via the web interface later.

4
package/ci/jenkins-android.xml

@ -67,8 +67,8 @@ else
deprecated_build_flag=OFF deprecated_build_flag=OFF
fi fi
mkdir -p build-nacl-${toolchain}-${compatibility} mkdir -p build-android-${toolchain}-${compatibility}
cd build-nacl-${toolchain}-${compatibility} cd build-android-${toolchain}-${compatibility}
cmake .. \ cmake .. \
-DCMAKE_BUILD_TYPE=Release \ -DCMAKE_BUILD_TYPE=Release \

11
src/Magnum/Platform/AndroidApplication.cpp

@ -70,7 +70,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);
} }
@ -135,16 +135,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;
} }
@ -261,7 +261,4 @@ void AndroidApplication::exec(android_app* state, std::unique_ptr<AndroidApplica
state->userData = nullptr; state->userData = nullptr;
} }
template class BasicScreen<AndroidApplication>;
template class BasicScreenedApplication<AndroidApplication>;
}} }}

10
src/Magnum/Platform/AndroidApplication.h

@ -312,9 +312,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)
@ -487,7 +487,7 @@ class AndroidApplication::MouseEvent: public InputEvent {
} }
private: private:
MouseEvent(AInputEvent* event): InputEvent(event) {} explicit MouseEvent(AInputEvent* event): InputEvent(event) {}
}; };
/** /**
@ -563,7 +563,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)
@ -587,8 +587,6 @@ header is included this macro is also aliased to `MAGNUM_APPLICATION_MAIN()`.
#ifndef DOXYGEN_GENERATING_OUTPUT #ifndef DOXYGEN_GENERATING_OUTPUT
#ifndef MAGNUM_APPLICATION_MAIN #ifndef MAGNUM_APPLICATION_MAIN
typedef AndroidApplication Application; typedef AndroidApplication Application;
typedef BasicScreen<AndroidApplication> Screen;
typedef BasicScreenedApplication<AndroidApplication> ScreenedApplication;
#define MAGNUM_APPLICATION_MAIN(className) MAGNUM_ANDROIDAPPLICATION_MAIN(className) #define MAGNUM_APPLICATION_MAIN(className) MAGNUM_ANDROIDAPPLICATION_MAIN(className)
#else #else
#undef MAGNUM_APPLICATION_MAIN #undef MAGNUM_APPLICATION_MAIN

2
toolchains

@ -1 +1 @@
Subproject commit 02f028c94f68b352d81509593fa5f64ac2eca244 Subproject commit a4683ed5662754a6498e64f30064b9f118f78285
Loading…
Cancel
Save