Browse Source

Make it possible to run GL tests on Windows/EGL.

pull/110/head
Vladimír Vondruš 11 years ago
parent
commit
eb590c7f47
  1. 9
      CMakeLists.txt
  2. 6
      src/Magnum/Test/AbstractOpenGLTester.h

9
CMakeLists.txt

@ -189,8 +189,13 @@ if(BUILD_GL_TESTS)
set(WITH_WINDOWLESSGLXAPPLICATION ON) set(WITH_WINDOWLESSGLXAPPLICATION ON)
set(GL_TEST_LIBRARIES Magnum MagnumWindowlessGlxApplication) set(GL_TEST_LIBRARIES Magnum MagnumWindowlessGlxApplication)
elseif(CORRADE_TARGET_WINDOWS) elseif(CORRADE_TARGET_WINDOWS)
set(WITH_WINDOWLESSWGLAPPLICATION ON) if(NOT MAGNUM_TARGET_GLES OR MAGNUM_TARGET_DESKTOP_GLES)
set(GL_TEST_LIBRARIES Magnum MagnumWindowlessWglApplication) set(WITH_WINDOWLESSWGLAPPLICATION ON)
set(GL_TEST_LIBRARIES Magnum MagnumWindowlessWglApplication)
else()
set(WITH_WINDOWLESSWINDOWSEGLAPPLICATION ON)
set(GL_TEST_LIBRARIES Magnum MagnumWindowlessWindowsEglApplication)
endif()
else() else()
message(FATAL_ERROR "Cannot run tests for OpenGL code on this platform. Set BUILD_GL_TESTS to OFF to skip building them.") message(FATAL_ERROR "Cannot run tests for OpenGL code on this platform. Set BUILD_GL_TESTS to OFF to skip building them.")
endif() endif()

6
src/Magnum/Test/AbstractOpenGLTester.h

@ -37,8 +37,12 @@
#elif defined(CORRADE_TARGET_UNIX) && (!defined(MAGNUM_TARGET_GLES) || defined(MAGNUM_TARGET_DESKTOP_GLES)) #elif defined(CORRADE_TARGET_UNIX) && (!defined(MAGNUM_TARGET_GLES) || defined(MAGNUM_TARGET_DESKTOP_GLES))
#include "Magnum/Platform/WindowlessGlxApplication.h" #include "Magnum/Platform/WindowlessGlxApplication.h"
#elif defined(CORRADE_TARGET_WINDOWS) #elif defined(CORRADE_TARGET_WINDOWS)
#if !defined(MAGNUM_TARGET_GLES) || defined(MAGNUM_TARGET_DESKTOP_GLES)
#include "Magnum/Platform/WindowlessWglApplication.h" #include "Magnum/Platform/WindowlessWglApplication.h"
#else #else
#include "Magnum/Platform/WindowlessWindowsEglApplication.h"
#endif
#else
#error cannot run OpenGL tests on this platform #error cannot run OpenGL tests on this platform
#endif #endif
@ -101,7 +105,7 @@ std::optional<Platform::WindowlessApplication::Arguments> AbstractOpenGLTester::
} \ } \
int main(int argc, char** argv) { \ int main(int argc, char** argv) { \
Magnum::Test::AbstractOpenGLTester::_windowlessApplicationArguments.emplace(argc, argv, nullptr); \ Magnum::Test::AbstractOpenGLTester::_windowlessApplicationArguments.emplace(argc, argv, nullptr); \
return Magnum::Platform::WindowlessWglApplication::create(windowProcedure); \ return Magnum::Platform::WindowlessApplication::create(windowProcedure); \
} }
#endif #endif

Loading…
Cancel
Save