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()
# 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)
endif()
@ -226,7 +226,7 @@ if(CORRADE_TARGET_EMSCRIPTEN)
endif()
if(WITH_OPENGLTESTER)
if(MAGNUM_TARGET_HEADLESS)
if(MAGNUM_TARGET_HEADLESS OR CORRADE_TARGET_ANDROID)
set(WITH_WINDOWLESSEGLAPPLICATION ON)
set(OPENGLTESTER_APPLICATION MagnumWindowlessEglApplication)
elseif(CORRADE_TARGET_IOS)

2
package/archlinux/PKGBUILD-android-arm64

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

15
src/Magnum/OpenGLTester.h

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

2
src/Magnum/Platform/CMakeLists.txt

@ -727,7 +727,7 @@ endif()
if(WITH_MAGNUMINFO)
add_executable(magnum-info info.cpp)
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)
elseif(CORRADE_TARGET_IOS)
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 library is in theory available for all platforms for which EGL
works (Linux desktop or ES, iOS and also @ref CORRADE_TARGET_EMSCRIPTEN "Emscripten").
See other `Windowless*Application` classes for an alternative. It is built if
works (Linux desktop or ES, @ref CORRADE_TARGET_IOS "iOS",
@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.
@section Platform-WindowlessEglApplication-bootstrap Bootstrap application

2
src/Magnum/Platform/info.cpp

@ -56,7 +56,7 @@
#include "Magnum/TransformFeedback.h"
#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"
#elif defined(CORRADE_TARGET_IOS)
#include "Magnum/Platform/WindowlessIosApplication.h"

Loading…
Cancel
Save