Browse Source

Port WindowlessEglApplication, OpenGLTester and magnum-info to Android.

pull/205/head
Vladimír Vondruš 8 years ago
parent
commit
3a5b03ac5b
  1. 4
      CMakeLists.txt
  2. 2
      package/archlinux/PKGBUILD-android-arm64
  3. 15
      src/Magnum/OpenGLTester.h
  4. 2
      src/Magnum/Platform/CMakeLists.txt
  5. 6
      src/Magnum/Platform/WindowlessEglApplication.h
  6. 2
      src/Magnum/Platform/info.cpp

4
CMakeLists.txt

@ -178,7 +178,7 @@ if(BUILD_TESTS)
endif() endif()
# OpenGLTester library, built by default only if GL tests are enabled # OpenGLTester library, built by default only if GL tests are enabled
if(NOT CORRADE_TARGET_ANDROID AND NOT CORRADE_TARGET_EMSCRIPTEN) if(NOT CORRADE_TARGET_EMSCRIPTEN)
cmake_dependent_option(WITH_OPENGLTESTER "Build OpenGLTester library" OFF "NOT BUILD_GL_TESTS" ON) cmake_dependent_option(WITH_OPENGLTESTER "Build OpenGLTester library" OFF "NOT BUILD_GL_TESTS" ON)
endif() endif()
@ -226,7 +226,7 @@ if(CORRADE_TARGET_EMSCRIPTEN)
endif() endif()
if(WITH_OPENGLTESTER) if(WITH_OPENGLTESTER)
if(MAGNUM_TARGET_HEADLESS) if(MAGNUM_TARGET_HEADLESS OR CORRADE_TARGET_ANDROID)
set(WITH_WINDOWLESSEGLAPPLICATION ON) set(WITH_WINDOWLESSEGLAPPLICATION ON)
set(OPENGLTESTER_APPLICATION MagnumWindowlessEglApplication) set(OPENGLTESTER_APPLICATION MagnumWindowlessEglApplication)
elseif(CORRADE_TARGET_IOS) elseif(CORRADE_TARGET_IOS)

2
package/archlinux/PKGBUILD-android-arm64

@ -37,6 +37,8 @@ build() {
-DWITH_TGAIMPORTER=ON \ -DWITH_TGAIMPORTER=ON \
-DWITH_ANDROIDAPPLICATION=ON \ -DWITH_ANDROIDAPPLICATION=ON \
-DWITH_EGLCONTEXT=ON \ -DWITH_EGLCONTEXT=ON \
-DWITH_WINDOWLESSEGLAPPLICATION=ON \
-DWITH_MAGNUMINFO=ON \
-DBUILD_TESTS=ON -DBUILD_TESTS=ON
ninja ninja
} }

15
src/Magnum/OpenGLTester.h

@ -34,7 +34,7 @@
#include "Magnum/Renderer.h" #include "Magnum/Renderer.h"
#include "Magnum/TimeQuery.h" #include "Magnum/TimeQuery.h"
#ifdef MAGNUM_TARGET_HEADLESS #if defined(MAGNUM_TARGET_HEADLESS) || defined(CORRADE_TARGET_ANDROID)
#include "Magnum/Platform/WindowlessEglApplication.h" #include "Magnum/Platform/WindowlessEglApplication.h"
#elif defined(CORRADE_TARGET_IOS) #elif defined(CORRADE_TARGET_IOS)
#include "Magnum/Platform/WindowlessIosApplication.h" #include "Magnum/Platform/WindowlessIosApplication.h"
@ -67,13 +67,12 @@ the base features.
This class is available only on platforms with corresponding This class is available only on platforms with corresponding
`Platform::Windowless*Application` implementation. That currently means all `Platform::Windowless*Application` implementation. That currently means all
platforms except @ref CORRADE_TARGET_ANDROID "Android" and platforms except @ref CORRADE_TARGET_EMSCRIPTEN "Emscripten". It is built into
@ref CORRADE_TARGET_EMSCRIPTEN "Emscripten". It is built into a separate static a separate static library and only if `WITH_OPENGLTESTER` is enabled when
library and only if `WITH_OPENGLTESTER` is enabled when building Magnum. To use building Magnum. To use it with CMake, you need to request the `OpenGLTester`
it with CMake, you need to request the `OpenGLTester` component of the `Magnum` component of the `Magnum` package. Derive your test class from this class
package. Derive your test class from this class instead of instead of @ref Corrade::TestSuite::Tester and either link to
@ref Corrade::TestSuite::Tester and either link to `Magnum::OpenGLTester` `Magnum::OpenGLTester` target or add it to the `LIBRARIES` section of the
target or add it to the `LIBRARIES` section of the
@ref corrade-cmake-add-test "corrade_add_test()" macro: @ref corrade-cmake-add-test "corrade_add_test()" macro:
@code{.cmake} @code{.cmake}

2
src/Magnum/Platform/CMakeLists.txt

@ -727,7 +727,7 @@ endif()
if(WITH_MAGNUMINFO) if(WITH_MAGNUMINFO)
add_executable(magnum-info info.cpp) add_executable(magnum-info info.cpp)
target_link_libraries(magnum-info Magnum) target_link_libraries(magnum-info Magnum)
if(MAGNUM_TARGET_HEADLESS OR CORRADE_TARGET_EMSCRIPTEN) if(MAGNUM_TARGET_HEADLESS OR CORRADE_TARGET_EMSCRIPTEN OR CORRADE_TARGET_ANDROID)
target_link_libraries(magnum-info MagnumWindowlessEglApplication) target_link_libraries(magnum-info MagnumWindowlessEglApplication)
elseif(CORRADE_TARGET_IOS) elseif(CORRADE_TARGET_IOS)
target_link_libraries(magnum-info MagnumWindowlessIosApplication) target_link_libraries(magnum-info MagnumWindowlessIosApplication)

6
src/Magnum/Platform/WindowlessEglApplication.h

@ -184,8 +184,10 @@ class WindowlessEglContext::Configuration {
Application for offscreen rendering using @ref WindowlessEglContext. This Application for offscreen rendering using @ref WindowlessEglContext. This
application library is in theory available for all platforms for which EGL application library is in theory available for all platforms for which EGL
works (Linux desktop or ES, iOS and also @ref CORRADE_TARGET_EMSCRIPTEN "Emscripten"). works (Linux desktop or ES, @ref CORRADE_TARGET_IOS "iOS",
See other `Windowless*Application` classes for an alternative. It is built if @ref CORRADE_TARGET_ANDROID "Android" and also
@ref CORRADE_TARGET_EMSCRIPTEN "Emscripten"). See other
`Windowless*Application` classes for an alternative. It is built if
`WITH_WINDOWLESSEGLAPPLICATION` is enabled in CMake. `WITH_WINDOWLESSEGLAPPLICATION` is enabled in CMake.
@section Platform-WindowlessEglApplication-bootstrap Bootstrap application @section Platform-WindowlessEglApplication-bootstrap Bootstrap application

2
src/Magnum/Platform/info.cpp

@ -56,7 +56,7 @@
#include "Magnum/TransformFeedback.h" #include "Magnum/TransformFeedback.h"
#endif #endif
#if defined(MAGNUM_TARGET_HEADLESS) || defined(CORRADE_TARGET_EMSCRIPTEN) #if defined(MAGNUM_TARGET_HEADLESS) || defined(CORRADE_TARGET_EMSCRIPTEN) || defined(CORRADE_TARGET_ANDROID)
#include "Magnum/Platform/WindowlessEglApplication.h" #include "Magnum/Platform/WindowlessEglApplication.h"
#elif defined(CORRADE_TARGET_IOS) #elif defined(CORRADE_TARGET_IOS)
#include "Magnum/Platform/WindowlessIosApplication.h" #include "Magnum/Platform/WindowlessIosApplication.h"

Loading…
Cancel
Save