Browse Source

Document and print helpful error messages for GL-dependent features.

pull/325/head
Vladimír Vondruš 7 years ago
parent
commit
8e8010c40b
  1. 56
      doc/building.dox
  2. 4
      src/Magnum/GL/CMakeLists.txt
  3. 10
      src/Magnum/GL/OpenGLTester.h
  4. 10
      src/Magnum/Platform/AbstractXApplication.h
  5. 52
      src/Magnum/Platform/CMakeLists.txt
  6. 10
      src/Magnum/Platform/GlutApplication.h
  7. 10
      src/Magnum/Platform/GlxApplication.h
  8. 14
      src/Magnum/Platform/WindowlessCglApplication.h
  9. 10
      src/Magnum/Platform/WindowlessEglApplication.h
  10. 14
      src/Magnum/Platform/WindowlessGlxApplication.h
  11. 14
      src/Magnum/Platform/WindowlessIosApplication.h
  12. 14
      src/Magnum/Platform/WindowlessWglApplication.h
  13. 14
      src/Magnum/Platform/WindowlessWindowsEglApplication.h
  14. 10
      src/Magnum/Platform/XEglApplication.h
  15. 3
      src/Magnum/Platform/gl-info.cpp
  16. 4
      src/Magnum/Shaders/CMakeLists.txt
  17. 4
      src/Magnum/Text/CMakeLists.txt
  18. 4
      src/Magnum/Text/fontconverter.cpp
  19. 4
      src/Magnum/TextureTools/CMakeLists.txt
  20. 3
      src/Magnum/TextureTools/distancefieldconverter.cpp
  21. 6
      src/MagnumPlugins/MagnumFont/CMakeLists.txt

56
doc/building.dox

@ -543,11 +543,11 @@ going to build any of the @ref example-index "examples", you'll need it.
[GLFW](http://glfw.org). [GLFW](http://glfw.org).
- `WITH_GLUTAPPLICATION` @m_class{m-label m-danger} **deprecated** --- Build - `WITH_GLUTAPPLICATION` @m_class{m-label m-danger} **deprecated** --- Build
the @ref Platform::GlutApplication "GlutApplication" library. Depends on the @ref Platform::GlutApplication "GlutApplication" library. Depends on
[GLUT](http://freeglut.sourceforge.net/). Enables also building of the GL [GLUT](http://freeglut.sourceforge.net/). Requires `TARGET_GL` to be
library. enabled.
- `WITH_GLXAPPLICATION` --- Build the - `WITH_GLXAPPLICATION` --- Build the
@ref Platform::GlxApplication "GlxApplication" library. Depends on **X11**. @ref Platform::GlxApplication "GlxApplication" library. Depends on **X11**.
Enables also building of the GL library. Requires `TARGET_GL` to be enabled.
- `WITH_SDL2APPLICATION` --- Build the - `WITH_SDL2APPLICATION` --- Build the
@ref Platform::Sdl2Application "Sdl2Application" library. Depends on @ref Platform::Sdl2Application "Sdl2Application" library. Depends on
[SDL2](http://www.libsdl.org). [SDL2](http://www.libsdl.org).
@ -556,43 +556,43 @@ going to build any of the @ref example-index "examples", you'll need it.
building of the GL library. building of the GL library.
- `WITH_WINDOWLESSCGLAPPLICATION` --- Build the - `WITH_WINDOWLESSCGLAPPLICATION` --- Build the
@ref Platform::WindowlessCglApplication "WindowlessCglApplication" library. @ref Platform::WindowlessCglApplication "WindowlessCglApplication" library.
Enables also building of the GL library. Requires `TARGET_GL` to be enabled.
- `WITH_WINDOWLESSEGLAPPLICATION` --- Build the - `WITH_WINDOWLESSEGLAPPLICATION` --- Build the
@ref Platform::WindowlessEglApplication "WindowlessEglApplication" library. @ref Platform::WindowlessEglApplication "WindowlessEglApplication" library.
Enables also building of the GL library. Requires `TARGET_GL` to be enabled.
- `WITH_WINDOWLESSGLXAPPLICATION` --- Build the - `WITH_WINDOWLESSGLXAPPLICATION` --- Build the
@ref Platform::WindowlessGlxApplication "WindowlessGlxApplication" library. @ref Platform::WindowlessGlxApplication "WindowlessGlxApplication" library.
Enables also building of the GL library. Requires `TARGET_GL` to be enabled.
- `WITH_WINDOWLESSIOSAPPLICATION` --- Build the - `WITH_WINDOWLESSIOSAPPLICATION` --- Build the
@ref Platform::WindowlessIosApplication "WindowlessIosApplication" library. @ref Platform::WindowlessIosApplication "WindowlessIosApplication" library.
Enables also building of the GL library. Requires `TARGET_GL` to be enabled.
- `WITH_WINDOWLESSWGLAPPLICATION` --- Build the - `WITH_WINDOWLESSWGLAPPLICATION` --- Build the
@ref Platform::WindowlessWglApplication "WindowlessWglApplication" library. @ref Platform::WindowlessWglApplication "WindowlessWglApplication" library.
Enables also building of the GL library. Requires `TARGET_GL` to be enabled.
- `WITH_WINDOWLESSWINDOWSEGLAPPLICATION` --- Build the - `WITH_WINDOWLESSWINDOWSEGLAPPLICATION` --- Build the
@ref Platform::WindowlessWindowsEglApplication "WindowlessWindowsEglApplication" @ref Platform::WindowlessWindowsEglApplication "WindowlessWindowsEglApplication"
library. Enables also building of the GL library. library. Requires `TARGET_GL` to be enabled.
None of the context libraries is built by default. Similarly to the application None of the context libraries is built by default. Similarly to the application
libraries, they are always built as static. You need them only if you chose to libraries, they are always built as static. You need them only if you chose to
not use any of the application libraries above (see @ref platform-custom for not use any of the application libraries above (see @ref platform-custom for
more information): more information):
- `WITH_CGLCONTEXT` --- Build the CGL context handling library. Enables also - `WITH_CGLCONTEXT` --- Build the CGL context handling library. Requires
building of the GL library. `TARGET_GL` to be enabled.
- `WITH_EGLCONTEXT` --- Build the EGL context handling library. Enables also - `WITH_EGLCONTEXT` --- Build the EGL context handling library. Requires
building of the GL library. `TARGET_GL` to be enabled.
- `WITH_GLXCONTEXT` --- Build the GLX context handling library. Enables also - `WITH_GLXCONTEXT` --- Build the GLX context handling library. Requires
building of the GL library. `TARGET_GL` to be enabled.
- `WITH_WGLCONTEXT` --- Build the WGL context handling library. Enables also - `WITH_WGLCONTEXT` --- Build the WGL context handling library. Requires
building of the GL library. `TARGET_GL` to be enabled.
There are also extensions to @ref Corrade::TestSuite::Tester for testing GPU There are also extensions to @ref Corrade::TestSuite::Tester for testing GPU
code: code:
- `WITH_OPENGLTESTER` --- The @ref GL::OpenGLTester class. Enables also - `WITH_OPENGLTESTER` --- The @ref GL::OpenGLTester class. Requires
building of the GL library and one of the windowless application libraries `TARGET_GL` to be enabled; enables building of one of the windowless
based on the target platform. application libraries based on the target platform.
Magnum also contains a set of dependency-less plugins for importing essential Magnum also contains a set of dependency-less plugins for importing essential
file formats. Additional plugins are provided in a separate plugin repository, file formats. Additional plugins are provided in a separate plugin repository,
@ -610,7 +610,8 @@ default.
plugin. Enables also building of the @ref Trade library. plugin. Enables also building of the @ref Trade library.
- `WITH_MAGNUMFONT` --- Build the @ref Text::MagnumFont "MagnumFont" plugin. - `WITH_MAGNUMFONT` --- Build the @ref Text::MagnumFont "MagnumFont" plugin.
Enables also building of the @ref Text library and the Enables also building of the @ref Text library and the
@ref Trade::TgaImporter "TgaImporter" plugin. @ref Trade::TgaImporter "TgaImporter" plugin. Requires `TARGET_GL` to be
enabled.
- `WITH_MAGNUMFONTCONVERTER` --- Build the - `WITH_MAGNUMFONTCONVERTER` --- Build the
@ref Text::MagnumFontConverter "MagnumFontConverter" plugin. Enables also @ref Text::MagnumFontConverter "MagnumFontConverter" plugin. Enables also
building of the @ref Text library and the building of the @ref Text library and the
@ -629,8 +630,8 @@ There are also a few command-line utilities, also all disabled by default:
- `WITH_GL_INFO` --- Build the @ref magnum-gl-info "magnum-gl-info" - `WITH_GL_INFO` --- Build the @ref magnum-gl-info "magnum-gl-info"
executable, which provides information about the engine OpenGL executable, which provides information about the engine OpenGL
capabilities. Enables building of one of the windowless application capabilities. Requires `TARGET_GL` to be enabled; enables building of one
libraries based on the target platform. of the windowless application libraries based on the target platform.
- `WITH_AL_INFO` --- Build the @ref magnum-al-info "magnum-al-info" - `WITH_AL_INFO` --- Build the @ref magnum-al-info "magnum-al-info"
executable, which provides information about the engine OpenAL executable, which provides information about the engine OpenAL
capabilities. capabilities.
@ -638,12 +639,13 @@ There are also a few command-line utilities, also all disabled by default:
@ref magnum-distancefieldconverter "magnum-distancefieldconverter" @ref magnum-distancefieldconverter "magnum-distancefieldconverter"
executable for converting black&white images to distance field textures. executable for converting black&white images to distance field textures.
Enables also building of the @ref TextureTools library. Available only on Enables also building of the @ref TextureTools library. Available only on
desktop GL. Enables building of one of the windowless application libraries desktop GL. Requires `TARGET_GL` to be enabled; enables building of one of
based on the target platform. the windowless application libraries based on the target platform.
- `WITH_FONTCONVERTER` --- Build the @ref magnum-fontconverter "magnum-fontconverter" - `WITH_FONTCONVERTER` --- Build the @ref magnum-fontconverter "magnum-fontconverter"
executable for converting fonts of different formats. Enables also building executable for converting fonts of different formats. Enables also building
of the @ref Text library. Available only on desktop GL. Enables building of of the @ref Text library. Available only on desktop GL. Requires
one of the windowless application libraries based on the target platform. `TARGET_GL` to be enabled; enables building of one of the windowless
application libraries based on the target platform.
- `WITH_IMAGECONVERTER` --- Build the @ref magnum-imageconverter "magnum-imageconverter" - `WITH_IMAGECONVERTER` --- Build the @ref magnum-imageconverter "magnum-imageconverter"
executable for converting images of different formats. executable for converting images of different formats.

4
src/Magnum/GL/CMakeLists.txt

@ -240,6 +240,10 @@ install(FILES ${MagnumGL_HEADERS} DESTINATION ${MAGNUM_INCLUDE_INSTALL_DIR}/GL)
# OpenGLTester class # OpenGLTester class
if(WITH_OPENGLTESTER) if(WITH_OPENGLTESTER)
if(NOT TARGET_GL)
message(SEND_ERROR "OpenGLTester is available only if TARGET_GL is enabled")
endif()
find_package(Corrade REQUIRED TestSuite) find_package(Corrade REQUIRED TestSuite)
set(MagnumOpenGLTester_SRCS OpenGLTester.cpp) set(MagnumOpenGLTester_SRCS OpenGLTester.cpp)

10
src/Magnum/GL/OpenGLTester.h

@ -29,6 +29,9 @@
* @brief Class @ref Magnum::GL::OpenGLTester, macro @ref MAGNUM_VERIFY_NO_GL_ERROR() * @brief Class @ref Magnum::GL::OpenGLTester, macro @ref MAGNUM_VERIFY_NO_GL_ERROR()
*/ */
#include "Magnum/configure.h"
#ifdef MAGNUM_TARGET_GL
#include <Corrade/TestSuite/Tester.h> #include <Corrade/TestSuite/Tester.h>
#include "Magnum/GL/Renderer.h" #include "Magnum/GL/Renderer.h"
@ -134,6 +137,10 @@ on all platforms and not all GL errors are fatal.
This class adds @ref BenchmarkType::GpuTime to the benchmark type enum, This class adds @ref BenchmarkType::GpuTime to the benchmark type enum,
allowing you to measure time spent on GPU as opposed to CPU or wall clock time. allowing you to measure time spent on GPU as opposed to CPU or wall clock time.
@requires_gles GPU time benchmarking is not available on WebGL. @requires_gles GPU time benchmarking is not available on WebGL.
@note This class is available only if Magnum is compiled with
@ref MAGNUM_TARGET_GL enabled (done by default). See @ref building-features
for more information.
*/ */
class OpenGLTester: public TestSuite::Tester { class OpenGLTester: public TestSuite::Tester {
public: public:
@ -297,5 +304,8 @@ typedef CORRADE_DEPRECATED("use GL::OpenGLTester instead") Magnum::GL::OpenGLTes
#endif #endif
} }
#else
#error this header is available only in the OpenGL build
#endif
#endif #endif

10
src/Magnum/Platform/AbstractXApplication.h

@ -29,6 +29,9 @@
* @brief Class @ref Magnum::Platform::AbstractXApplication * @brief Class @ref Magnum::Platform::AbstractXApplication
*/ */
#include "Magnum/configure.h"
#ifdef MAGNUM_TARGET_GL
#include <Corrade/Containers/EnumSet.h> #include <Corrade/Containers/EnumSet.h>
#include <Corrade/Containers/Pointer.h> #include <Corrade/Containers/Pointer.h>
@ -59,6 +62,10 @@ Supports keyboard and mouse handling. See @ref platform for brief introduction.
@note Not meant to be used directly, see the @ref GlxApplication and @note Not meant to be used directly, see the @ref GlxApplication and
@ref XEglApplication subclasses instead. @ref XEglApplication subclasses instead.
@note This class is available only if Magnum is compiled with
@ref MAGNUM_TARGET_GL enabled (done by default). See @ref building-features
for more information.
*/ */
class AbstractXApplication { class AbstractXApplication {
public: public:
@ -663,5 +670,8 @@ class AbstractXApplication::MouseMoveEvent: public AbstractXApplication::InputEv
}; };
}} }}
#else
#error this header is available only in the OpenGL build
#endif
#endif #endif

52
src/Magnum/Platform/CMakeLists.txt

@ -308,6 +308,10 @@ endif()
# GLX application # GLX application
if(WITH_GLXAPPLICATION) if(WITH_GLXAPPLICATION)
if(NOT TARGET_GL)
message(SEND_ERROR "GlxApplication is available only if TARGET_GL is enabled")
endif()
set(NEED_ABSTRACTXAPPLICATION 1) set(NEED_ABSTRACTXAPPLICATION 1)
set(NEED_GLXCONTEXTHANDLER 1) set(NEED_GLXCONTEXTHANDLER 1)
set(NEED_GLXCONTEXT 1) set(NEED_GLXCONTEXT 1)
@ -351,6 +355,10 @@ endif()
# X/EGL application # X/EGL application
if(WITH_XEGLAPPLICATION) if(WITH_XEGLAPPLICATION)
if(NOT TARGET_GL)
message(SEND_ERROR "XEglApplication is available only if TARGET_GL is enabled")
endif()
set(NEED_ABSTRACTXAPPLICATION 1) set(NEED_ABSTRACTXAPPLICATION 1)
set(NEED_EGLCONTEXTHANDLER 1) set(NEED_EGLCONTEXTHANDLER 1)
set(NEED_EGLCONTEXT 1) set(NEED_EGLCONTEXT 1)
@ -394,6 +402,10 @@ endif()
# Windowless EGL application # Windowless EGL application
if(WITH_WINDOWLESSEGLAPPLICATION) if(WITH_WINDOWLESSEGLAPPLICATION)
if(NOT TARGET_GL)
message(SEND_ERROR "WindowlessEglApplication is available only if TARGET_GL is enabled")
endif()
set(NEED_EGLCONTEXT 1) set(NEED_EGLCONTEXT 1)
set(MagnumWindowlessEglApplication_SRCS set(MagnumWindowlessEglApplication_SRCS
@ -429,6 +441,10 @@ endif()
# Windowless GLX application # Windowless GLX application
if(WITH_WINDOWLESSGLXAPPLICATION) if(WITH_WINDOWLESSGLXAPPLICATION)
if(NOT TARGET_GL)
message(SEND_ERROR "WindowlessGlxApplication is available only if TARGET_GL is enabled")
endif()
set(NEED_GLXCONTEXT 1) set(NEED_GLXCONTEXT 1)
find_package(X11) find_package(X11)
@ -471,6 +487,10 @@ endif()
# Windowless iOS application # Windowless iOS application
if(WITH_WINDOWLESSIOSAPPLICATION) if(WITH_WINDOWLESSIOSAPPLICATION)
if(NOT TARGET_GL)
message(SEND_ERROR "WindowlessIosApplication is available only if TARGET_GL is enabled")
endif()
set(NEED_EGLCONTEXT 1) set(NEED_EGLCONTEXT 1)
# We need to link to Foundation framework to use ObjC # We need to link to Foundation framework to use ObjC
@ -509,6 +529,10 @@ endif()
# Windowless WGL application # Windowless WGL application
if(WITH_WINDOWLESSWGLAPPLICATION) if(WITH_WINDOWLESSWGLAPPLICATION)
if(NOT TARGET_GL)
message(SEND_ERROR "WindowlessWglApplication is available only if TARGET_GL is enabled")
endif()
set(NEED_WGLCONTEXT 1) set(NEED_WGLCONTEXT 1)
set(MagnumWindowlessWglApplication_SRCS set(MagnumWindowlessWglApplication_SRCS
@ -540,6 +564,10 @@ endif()
# Windowless Windows/EGL application # Windowless Windows/EGL application
if(WITH_WINDOWLESSWINDOWSEGLAPPLICATION) if(WITH_WINDOWLESSWINDOWSEGLAPPLICATION)
if(NOT TARGET_GL)
message(SEND_ERROR "WindowlessWindowsEglApplication is available only if TARGET_GL is enabled")
endif()
set(NEED_EGLCONTEXT 1) set(NEED_EGLCONTEXT 1)
set(MagnumWindowlessWindowsEglApplication_SRCS set(MagnumWindowlessWindowsEglApplication_SRCS
@ -575,6 +603,10 @@ endif()
# Windowless CGL application # Windowless CGL application
if(WITH_WINDOWLESSCGLAPPLICATION) if(WITH_WINDOWLESSCGLAPPLICATION)
if(NOT TARGET_GL)
message(SEND_ERROR "WindowlessCglApplication is available only if TARGET_GL is enabled")
endif()
set(NEED_CGLCONTEXT 1) set(NEED_CGLCONTEXT 1)
set(MagnumWindowlessCglApplication_SRCS set(MagnumWindowlessCglApplication_SRCS
@ -706,6 +738,10 @@ if(NEED_CGLCONTEXT OR WITH_CGLCONTEXT)
# Also create proper static library, if requested # Also create proper static library, if requested
if(WITH_CGLCONTEXT) if(WITH_CGLCONTEXT)
if(NOT TARGET_GL)
message(SEND_ERROR "CglContext is available only if TARGET_GL is enabled")
endif()
# CMake-generated XCode projects had some problems when library # CMake-generated XCode projects had some problems when library
# consisted only of $<TARGET_OBJECTS> entries, thus compiling the # consisted only of $<TARGET_OBJECTS> entries, thus compiling the
# sources again in this case # sources again in this case
@ -747,6 +783,10 @@ if(NEED_EGLCONTEXT OR WITH_EGLCONTEXT)
# Also create proper static library, if requested # Also create proper static library, if requested
if(WITH_EGLCONTEXT) if(WITH_EGLCONTEXT)
if(NOT TARGET_GL)
message(SEND_ERROR "EglContext is available only if TARGET_GL is enabled")
endif()
add_library(MagnumEglContext STATIC add_library(MagnumEglContext STATIC
$<TARGET_OBJECTS:MagnumEglContextObjects> $<TARGET_OBJECTS:MagnumEglContextObjects>
${PROJECT_SOURCE_DIR}/src/dummy.cpp) # XCode workaround, see file comment for details ${PROJECT_SOURCE_DIR}/src/dummy.cpp) # XCode workaround, see file comment for details
@ -782,6 +822,10 @@ if(NEED_GLXCONTEXT OR WITH_GLXCONTEXT)
# Also create proper static library, if requested # Also create proper static library, if requested
if(WITH_GLXCONTEXT) if(WITH_GLXCONTEXT)
if(NOT TARGET_GL)
message(SEND_ERROR "GlxContext is available only if TARGET_GL is enabled")
endif()
add_library(MagnumGlxContext STATIC $<TARGET_OBJECTS:MagnumGlxContextObjects>) add_library(MagnumGlxContext STATIC $<TARGET_OBJECTS:MagnumGlxContextObjects>)
set_target_properties(MagnumGlxContext PROPERTIES set_target_properties(MagnumGlxContext PROPERTIES
DEBUG_POSTFIX "-d" DEBUG_POSTFIX "-d"
@ -816,6 +860,10 @@ if(NEED_WGLCONTEXT OR WITH_WGLCONTEXT)
# Also create proper static library, if requested # Also create proper static library, if requested
if(WITH_WGLCONTEXT) if(WITH_WGLCONTEXT)
if(NOT TARGET_GL)
message(SEND_ERROR "WglContext is available only if TARGET_GL is enabled")
endif()
add_library(MagnumWglContext STATIC $<TARGET_OBJECTS:MagnumWglContextObjects>) add_library(MagnumWglContext STATIC $<TARGET_OBJECTS:MagnumWglContextObjects>)
set_target_properties(MagnumWglContext PROPERTIES set_target_properties(MagnumWglContext PROPERTIES
DEBUG_POSTFIX "-d" DEBUG_POSTFIX "-d"
@ -837,6 +885,10 @@ endif()
# Magnum GL Info # Magnum GL Info
if(WITH_GL_INFO) if(WITH_GL_INFO)
if(NOT TARGET_GL)
message(SEND_ERROR "magnum-gl-info is available only if TARGET_GL is enabled")
endif()
add_executable(magnum-gl-info gl-info.cpp) add_executable(magnum-gl-info gl-info.cpp)
target_link_libraries(magnum-gl-info PRIVATE MagnumGL) target_link_libraries(magnum-gl-info PRIVATE MagnumGL)
if(MAGNUM_TARGET_HEADLESS OR CORRADE_TARGET_EMSCRIPTEN OR CORRADE_TARGET_ANDROID) if(MAGNUM_TARGET_HEADLESS OR CORRADE_TARGET_EMSCRIPTEN OR CORRADE_TARGET_ANDROID)

10
src/Magnum/Platform/GlutApplication.h

@ -34,6 +34,9 @@
as soon as possible. as soon as possible.
*/ */
#include "Magnum/configure.h"
#ifdef MAGNUM_TARGET_GL
#include <string> #include <string>
#include <Corrade/Containers/Pointer.h> #include <Corrade/Containers/Pointer.h>
@ -115,6 +118,10 @@ MAGNUM_GLUTAPPLICATION_MAIN(MyApplication)
If no other application header is included, this class is also aliased to If no other application header is included, this class is also aliased to
@cpp Platform::Application @ce and the macro is aliased to @cpp Platform::Application @ce and the macro is aliased to
@cpp MAGNUM_APPLICATION_MAIN() @ce to simplify porting. @cpp MAGNUM_APPLICATION_MAIN() @ce to simplify porting.
@note This class is available only if Magnum is compiled with
@ref MAGNUM_TARGET_GL enabled (done by default). See @ref building-features
for more information.
*/ */
class CORRADE_DEPRECATED("scheduled for removal, consider switching to Sdl2Application or GlfwApplication instead") GlutApplication { class CORRADE_DEPRECATED("scheduled for removal, consider switching to Sdl2Application or GlfwApplication instead") GlutApplication {
public: public:
@ -883,5 +890,8 @@ CORRADE_ENUMSET_OPERATORS(GlutApplication::MouseMoveEvent::Buttons)
CORRADE_IGNORE_DEPRECATED_POP CORRADE_IGNORE_DEPRECATED_POP
}} }}
#else
#error this header is available only in the OpenGL build
#endif
#endif #endif

10
src/Magnum/Platform/GlxApplication.h

@ -29,6 +29,9 @@
* @brief Class @ref Magnum::Platform::GlxApplication, macro @ref MAGNUM_GLXAPPLICATION_MAIN() * @brief Class @ref Magnum::Platform::GlxApplication, macro @ref MAGNUM_GLXAPPLICATION_MAIN()
*/ */
#include "Magnum/configure.h"
#ifdef MAGNUM_TARGET_GL
#include "Magnum/Platform/AbstractXApplication.h" #include "Magnum/Platform/AbstractXApplication.h"
#include "Magnum/Platform/Platform.h" #include "Magnum/Platform/Platform.h"
@ -82,6 +85,10 @@ MAGNUM_GLXAPPLICATION_MAIN(MyApplication)
If no other application header is included, this class is also aliased to If no other application header is included, this class is also aliased to
@cpp Platform::Application @ce and the macro is aliased to @cpp Platform::Application @ce and the macro is aliased to
@cpp MAGNUM_APPLICATION_MAIN() @ce to simplify porting. @cpp MAGNUM_APPLICATION_MAIN() @ce to simplify porting.
@note This class is available only if Magnum is compiled with
@ref MAGNUM_TARGET_GL enabled (done by default). See @ref building-features
for more information.
*/ */
class GlxApplication: public AbstractXApplication { class GlxApplication: public AbstractXApplication {
public: public:
@ -145,5 +152,8 @@ typedef BasicScreenedApplication<GlxApplication> ScreenedApplication;
#endif #endif
}} }}
#else
#error this header is available only in the OpenGL build
#endif
#endif #endif

14
src/Magnum/Platform/WindowlessCglApplication.h

@ -31,6 +31,9 @@
* @brief Class @ref Magnum::Platform::WindowlessCglApplication, @ref Magnum::Platform::WindowlessCglContext, macro @ref MAGNUM_WINDOWLESSCGLAPPLICATION_MAIN() * @brief Class @ref Magnum::Platform::WindowlessCglApplication, @ref Magnum::Platform::WindowlessCglContext, macro @ref MAGNUM_WINDOWLESSCGLAPPLICATION_MAIN()
*/ */
#include "Magnum/configure.h"
#ifdef MAGNUM_TARGET_GL
#include <Corrade/Containers/Pointer.h> #include <Corrade/Containers/Pointer.h>
#include "Magnum/Magnum.h" #include "Magnum/Magnum.h"
@ -55,6 +58,10 @@ Meant to be used when there is a need to manage (multiple) GL contexts
manually. See @ref platform-windowless-contexts for more information. If no manually. See @ref platform-windowless-contexts for more information. If no
other application header is included, this class is also aliased to other application header is included, this class is also aliased to
@cpp Platform::WindowlessGLContext @ce. @cpp Platform::WindowlessGLContext @ce.
@note This class is available only if Magnum is compiled with
@ref MAGNUM_TARGET_GL enabled (done by default). See @ref building-features
for more information.
*/ */
class WindowlessCglContext { class WindowlessCglContext {
public: public:
@ -194,6 +201,10 @@ MAGNUM_WINDOWLESSCGLAPPLICATION_MAIN(MyApplication)
If no other application header is included, this class is also aliased to If no other application header is included, this class is also aliased to
@cpp Platform::WindowlessApplication @ce and the macro is aliased to @cpp Platform::WindowlessApplication @ce and the macro is aliased to
@cpp MAGNUM_WINDOWLESSAPPLICATION_MAIN() @ce to simplify porting. @cpp MAGNUM_WINDOWLESSAPPLICATION_MAIN() @ce to simplify porting.
@note This class is available only if Magnum is compiled with
@ref MAGNUM_TARGET_GL enabled (done by default). See @ref building-features
for more information.
*/ */
class WindowlessCglApplication { class WindowlessCglApplication {
public: public:
@ -334,5 +345,8 @@ typedef WindowlessCglContext WindowlessGLContext;
#endif #endif
}} }}
#else
#error this header is available only in the OpenGL build
#endif
#endif #endif

10
src/Magnum/Platform/WindowlessEglApplication.h

@ -29,6 +29,9 @@
* @brief Class @ref Magnum::Platform::WindowlessEglApplication, @ref Magnum::Platform::WindowlessEglContext, macro @ref MAGNUM_WINDOWLESSEGLAPPLICATION_MAIN() * @brief Class @ref Magnum::Platform::WindowlessEglApplication, @ref Magnum::Platform::WindowlessEglContext, macro @ref MAGNUM_WINDOWLESSEGLAPPLICATION_MAIN()
*/ */
#include "Magnum/configure.h"
#ifdef MAGNUM_TARGET_GL
#include <EGL/egl.h> #include <EGL/egl.h>
#include <EGL/eglext.h> #include <EGL/eglext.h>
/* undef Xlib nonsense to avoid conflicts */ /* undef Xlib nonsense to avoid conflicts */
@ -57,6 +60,10 @@ Meant to be used when there is a need to manage (multiple) GL contexts
manually. See @ref platform-windowless-contexts for more information. If no manually. See @ref platform-windowless-contexts for more information. If no
other application header is included, this class is also aliased to other application header is included, this class is also aliased to
@cpp Platform::WindowlessGLContext @ce. @cpp Platform::WindowlessGLContext @ce.
@note This class is available only if Magnum is compiled with
@ref MAGNUM_TARGET_GL enabled (done by default). See @ref building-features
for more information.
*/ */
class WindowlessEglContext { class WindowlessEglContext {
public: public:
@ -473,5 +480,8 @@ typedef WindowlessEglContext WindowlessGLContext;
#endif #endif
}} }}
#else
#error this header is available only in the OpenGL build
#endif
#endif #endif

14
src/Magnum/Platform/WindowlessGlxApplication.h

@ -29,6 +29,9 @@
* @brief Class @ref Magnum::Platform::WindowlessGlxApplication, @ref Magnum::Platform::WindowlessGlxContext, macro @ref MAGNUM_WINDOWLESSGLXAPPLICATION_MAIN() * @brief Class @ref Magnum::Platform::WindowlessGlxApplication, @ref Magnum::Platform::WindowlessGlxContext, macro @ref MAGNUM_WINDOWLESSGLXAPPLICATION_MAIN()
*/ */
#include "Magnum/configure.h"
#ifdef MAGNUM_TARGET_GL
#include <Corrade/Containers/EnumSet.h> #include <Corrade/Containers/EnumSet.h>
#include <Corrade/Containers/Pointer.h> #include <Corrade/Containers/Pointer.h>
@ -61,6 +64,10 @@ Meant to be used when there is a need to manage (multiple) GL contexts
manually. See @ref platform-windowless-contexts for more information. If no manually. See @ref platform-windowless-contexts for more information. If no
other application header is included, this class is also aliased to other application header is included, this class is also aliased to
@cpp Platform::WindowlessGLContext @ce. @cpp Platform::WindowlessGLContext @ce.
@note This class is available only if Magnum is compiled with
@ref MAGNUM_TARGET_GL enabled (done by default). See @ref building-features
for more information.
*/ */
class WindowlessGlxContext { class WindowlessGlxContext {
public: public:
@ -289,6 +296,10 @@ MAGNUM_WINDOWLESSGLXAPPLICATION_MAIN(MyApplication)
If no other application header is included, this class is also aliased to If no other application header is included, this class is also aliased to
@cpp Platform::WindowlessApplication @ce and the macro is aliased to @cpp Platform::WindowlessApplication @ce and the macro is aliased to
@cpp MAGNUM_WINDOWLESSAPPLICATION_MAIN() @ce to simplify porting. @cpp MAGNUM_WINDOWLESSAPPLICATION_MAIN() @ce to simplify porting.
@note This class is available only if Magnum is compiled with
@ref MAGNUM_TARGET_GL enabled (done by default). See @ref building-features
for more information.
*/ */
class WindowlessGlxApplication { class WindowlessGlxApplication {
public: public:
@ -429,5 +440,8 @@ typedef WindowlessGlxContext WindowlessGLContext;
#endif #endif
}} }}
#else
#error this header is available only in the OpenGL build
#endif
#endif #endif

14
src/Magnum/Platform/WindowlessIosApplication.h

@ -29,6 +29,9 @@
* @brief Class @ref Magnum::Platform::WindowlessIosApplication, @ref Magnum::Platform::WindowlessIosContext, macro @ref MAGNUM_WINDOWLESSIOSAPPLICATION_MAIN() * @brief Class @ref Magnum::Platform::WindowlessIosApplication, @ref Magnum::Platform::WindowlessIosContext, macro @ref MAGNUM_WINDOWLESSIOSAPPLICATION_MAIN()
*/ */
#include "Magnum/configure.h"
#ifdef MAGNUM_TARGET_GL
#include <Corrade/Containers/EnumSet.h> #include <Corrade/Containers/EnumSet.h>
#include <Corrade/Containers/Pointer.h> #include <Corrade/Containers/Pointer.h>
@ -56,6 +59,10 @@ Meant to be used when there is a need to manage (multiple) GL contexts
manually. See @ref platform-windowless-contexts for more information. If no manually. See @ref platform-windowless-contexts for more information. If no
other application header is included, this class is also aliased to other application header is included, this class is also aliased to
@cpp Platform::WindowlessGLContext @ce. @cpp Platform::WindowlessGLContext @ce.
@note This class is available only if Magnum is compiled with
@ref MAGNUM_TARGET_GL enabled (done by default). See @ref building-features
for more information.
*/ */
class WindowlessIosContext { class WindowlessIosContext {
public: public:
@ -192,6 +199,10 @@ MAGNUM_WINDOWLESSIOSAPPLICATION_MAIN(MyApplication)
If no other application header is included, this class is also aliased to If no other application header is included, this class is also aliased to
@cpp Platform::WindowlessApplication @ce and the macro is aliased to @cpp Platform::WindowlessApplication @ce and the macro is aliased to
@cpp MAGNUM_WINDOWLESSAPPLICATION_MAIN() @ce to simplify porting. @cpp MAGNUM_WINDOWLESSAPPLICATION_MAIN() @ce to simplify porting.
@note This class is available only if Magnum is compiled with
@ref MAGNUM_TARGET_GL enabled (done by default). See @ref building-features
for more information.
*/ */
class WindowlessIosApplication { class WindowlessIosApplication {
public: public:
@ -332,5 +343,8 @@ typedef WindowlessIosContext WindowlessGLContext;
#endif #endif
}} }}
#else
#error this header is available only in the OpenGL build
#endif
#endif #endif

14
src/Magnum/Platform/WindowlessWglApplication.h

@ -29,6 +29,9 @@
* @brief Class @ref Magnum::Platform::WindowlessWglApplication, @ref Magnum::Platform::WindowlessWglContext, macro @ref MAGNUM_WINDOWLESSWGLAPPLICATION_MAIN() * @brief Class @ref Magnum::Platform::WindowlessWglApplication, @ref Magnum::Platform::WindowlessWglContext, macro @ref MAGNUM_WINDOWLESSWGLAPPLICATION_MAIN()
*/ */
#include "Magnum/configure.h"
#ifdef MAGNUM_TARGET_GL
#ifndef DOXYGEN_GENERATING_OUTPUT #ifndef DOXYGEN_GENERATING_OUTPUT
#define WIN32_LEAN_AND_MEAN 1 #define WIN32_LEAN_AND_MEAN 1
#define VC_EXTRALEAN #define VC_EXTRALEAN
@ -61,6 +64,10 @@ Meant to be used when there is a need to manage (multiple) GL contexts
manually. See @ref platform-windowless-contexts for more information. If no manually. See @ref platform-windowless-contexts for more information. If no
other application header is included, this class is also aliased to other application header is included, this class is also aliased to
@cpp Platform::WindowlessGLContext @ce. @cpp Platform::WindowlessGLContext @ce.
@note This class is available only if Magnum is compiled with
@ref MAGNUM_TARGET_GL enabled (done by default). See @ref building-features
for more information.
*/ */
class WindowlessWglContext { class WindowlessWglContext {
public: public:
@ -287,6 +294,10 @@ MAGNUM_WINDOWLESSWGLAPPLICATION_MAIN(MyApplication)
If no other application header is included, this class is also aliased to If no other application header is included, this class is also aliased to
@cpp Platform::WindowlessApplication @ce and the macro is aliased to @cpp Platform::WindowlessApplication @ce and the macro is aliased to
@cpp MAGNUM_WINDOWLESSAPPLICATION_MAIN() @ce to simplify porting. @cpp MAGNUM_WINDOWLESSAPPLICATION_MAIN() @ce to simplify porting.
@note This class is available only if Magnum is compiled with
@ref MAGNUM_TARGET_GL enabled (done by default). See @ref building-features
for more information.
*/ */
class WindowlessWglApplication { class WindowlessWglApplication {
public: public:
@ -427,5 +438,8 @@ typedef WindowlessWglContext WindowlessGLContext;
#endif #endif
}} }}
#else
#error this header is available only in the OpenGL build
#endif
#endif #endif

14
src/Magnum/Platform/WindowlessWindowsEglApplication.h

@ -29,6 +29,9 @@
* @brief Class @ref Magnum::Platform::WindowlessWindowsEglApplication, @ref Magnum::Platform::WindowlessWindowsEglContext, macro @ref MAGNUM_WINDOWLESSWINDOWSEGLAPPLICATION_MAIN() * @brief Class @ref Magnum::Platform::WindowlessWindowsEglApplication, @ref Magnum::Platform::WindowlessWindowsEglContext, macro @ref MAGNUM_WINDOWLESSWINDOWSEGLAPPLICATION_MAIN()
*/ */
#include "Magnum/configure.h"
#ifdef MAGNUM_TARGET_GL
#ifndef DOXYGEN_GENERATING_OUTPUT #ifndef DOXYGEN_GENERATING_OUTPUT
#define WIN32_LEAN_AND_MEAN 1 #define WIN32_LEAN_AND_MEAN 1
#define VC_EXTRALEAN #define VC_EXTRALEAN
@ -56,6 +59,10 @@ Meant to be used when there is a need to manage (multiple) GL contexts
manually. See @ref platform-windowless-contexts for more information. If no manually. See @ref platform-windowless-contexts for more information. If no
other application header is included, this class is also aliased to other application header is included, this class is also aliased to
@cpp Platform::WindowlessGLContext @ce. @cpp Platform::WindowlessGLContext @ce.
@note This class is available only if Magnum is compiled with
@ref MAGNUM_TARGET_GL enabled (done by default). See @ref building-features
for more information.
*/ */
class WindowlessWindowsEglContext { class WindowlessWindowsEglContext {
public: public:
@ -260,6 +267,10 @@ MAGNUM_WINDOWLESSWINDOWSEGLAPPLICATION_MAIN(MyApplication)
If no other application header is included, this class is also aliased to If no other application header is included, this class is also aliased to
@cpp Platform::WindowlessApplication @ce and the macro is aliased to @cpp Platform::WindowlessApplication @ce and the macro is aliased to
@cpp MAGNUM_WINDOWLESSAPPLICATION_MAIN() @ce to simplify porting. @cpp MAGNUM_WINDOWLESSAPPLICATION_MAIN() @ce to simplify porting.
@note This class is available only if Magnum is compiled with
@ref MAGNUM_TARGET_GL enabled (done by default). See @ref building-features
for more information.
*/ */
class WindowlessWindowsEglApplication { class WindowlessWindowsEglApplication {
public: public:
@ -398,5 +409,8 @@ typedef WindowlessWindowsEglContext WindowlessGLContext;
#endif #endif
}} }}
#else
#error this header is available only in the OpenGL build
#endif
#endif #endif

10
src/Magnum/Platform/XEglApplication.h

@ -29,6 +29,9 @@
* @brief Class @ref Magnum::Platform::XEglApplication, macro @ref MAGNUM_XEGLAPPLICATION_MAIN() * @brief Class @ref Magnum::Platform::XEglApplication, macro @ref MAGNUM_XEGLAPPLICATION_MAIN()
*/ */
#include "Magnum/configure.h"
#ifdef MAGNUM_TARGET_GL
#include "Magnum/Platform/Platform.h" #include "Magnum/Platform/Platform.h"
#include "Magnum/Platform/AbstractXApplication.h" #include "Magnum/Platform/AbstractXApplication.h"
@ -83,6 +86,10 @@ MAGNUM_XEGLAPPLICATION_MAIN(MyApplication)
If no other application header is included, this class is also aliased to If no other application header is included, this class is also aliased to
@cpp Platform::Application @ce and the macro is aliased to @cpp Platform::Application @ce and the macro is aliased to
@cpp MAGNUM_APPLICATION_MAIN() @ce to simplify porting. @cpp MAGNUM_APPLICATION_MAIN() @ce to simplify porting.
@note This class is available only if Magnum is compiled with
@ref MAGNUM_TARGET_GL enabled (done by default). See @ref building-features
for more information.
*/ */
class XEglApplication: public AbstractXApplication { class XEglApplication: public AbstractXApplication {
public: public:
@ -146,5 +153,8 @@ typedef BasicScreenedApplication<XEglApplication> ScreenedApplication;
#endif #endif
}} }}
#else
#error this header is available only in the OpenGL build
#endif
#endif #endif

3
src/Magnum/Platform/gl-info.cpp

@ -181,6 +181,9 @@ Vendor extension support:
... ...
@endcode @endcode
@note This executable is available only if Magnum is compiled with
@ref MAGNUM_TARGET_GL enabled (done by default). See @ref building-features
for more information.
*/ */
class MagnumInfo: public Platform::WindowlessApplication { class MagnumInfo: public Platform::WindowlessApplication {

4
src/Magnum/Shaders/CMakeLists.txt

@ -23,6 +23,10 @@
# DEALINGS IN THE SOFTWARE. # DEALINGS IN THE SOFTWARE.
# #
if(NOT WITH_GL)
message(SEND_ERROR "Shaders are available only if WITH_GL is enabled")
endif()
corrade_add_resource(MagnumShaders_RCS resources.conf) corrade_add_resource(MagnumShaders_RCS resources.conf)
set_target_properties(MagnumShaders_RCS-dependencies PROPERTIES FOLDER "Magnum/Shaders") set_target_properties(MagnumShaders_RCS-dependencies PROPERTIES FOLDER "Magnum/Shaders")

4
src/Magnum/Text/CMakeLists.txt

@ -104,6 +104,10 @@ install(TARGETS MagnumText
install(FILES ${MagnumText_HEADERS} DESTINATION ${MAGNUM_INCLUDE_INSTALL_DIR}/Text) install(FILES ${MagnumText_HEADERS} DESTINATION ${MAGNUM_INCLUDE_INSTALL_DIR}/Text)
if(WITH_FONTCONVERTER) if(WITH_FONTCONVERTER)
if(NOT TARGET_GL)
message(SEND_ERROR "magnum-fontconverter is available only if TARGET_GL is enabled")
endif()
add_executable(magnum-fontconverter fontconverter.cpp) add_executable(magnum-fontconverter fontconverter.cpp)
target_link_libraries(magnum-fontconverter PRIVATE target_link_libraries(magnum-fontconverter PRIVATE
Magnum Magnum

4
src/Magnum/Text/fontconverter.cpp

@ -120,6 +120,10 @@ According to @ref Text::MagnumFontConverter "MagnumFontConverter" plugin
documentation, this will generate files `myfont.conf` and `myfont.tga` in documentation, this will generate files `myfont.conf` and `myfont.tga` in
current directory. You can then load and use them via the current directory. You can then load and use them via the
@ref Text::MagnumFont "MagnumFont" plugin. @ref Text::MagnumFont "MagnumFont" plugin.
@note This executable is available only if Magnum is compiled with
@ref MAGNUM_TARGET_GL enabled (done by default). See @ref building-features
for more information.
*/ */
namespace Text { namespace Text {

4
src/Magnum/TextureTools/CMakeLists.txt

@ -67,6 +67,10 @@ install(TARGETS MagnumTextureTools
install(FILES ${MagnumTextureTools_HEADERS} DESTINATION ${MAGNUM_INCLUDE_INSTALL_DIR}/TextureTools) install(FILES ${MagnumTextureTools_HEADERS} DESTINATION ${MAGNUM_INCLUDE_INSTALL_DIR}/TextureTools)
if(WITH_DISTANCEFIELDCONVERTER) if(WITH_DISTANCEFIELDCONVERTER)
if(NOT TARGET_GL)
message(SEND_ERROR "magnum-distancefieldconverter is available only if TARGET_GL is enabled")
endif()
add_executable(magnum-distancefieldconverter distancefieldconverter.cpp) add_executable(magnum-distancefieldconverter distancefieldconverter.cpp)
target_link_libraries(magnum-distancefieldconverter PRIVATE target_link_libraries(magnum-distancefieldconverter PRIVATE
Magnum Magnum

3
src/Magnum/TextureTools/distancefieldconverter.cpp

@ -124,6 +124,9 @@ This will open monochrome `logo-src.png` image using any plugin that can open
PNG files and converts it to 256x256 distance field `logo.png` using any plugin PNG files and converts it to 256x256 distance field `logo.png` using any plugin
that can write PNG files. that can write PNG files.
@note This executable is available only if Magnum is compiled with
@ref MAGNUM_TARGET_GL enabled (done by default). See @ref building-features
for more information.
*/ */
namespace TextureTools { namespace TextureTools {

6
src/MagnumPlugins/MagnumFont/CMakeLists.txt

@ -23,6 +23,12 @@
# DEALINGS IN THE SOFTWARE. # DEALINGS IN THE SOFTWARE.
# #
if(NOT TARGET_GL)
# TODO: remove (and update all other docs) when we have better
# createGlyphCache() APIs
message(SEND_ERROR "MagnumFont is available only if TARGET_GL is enabled")
endif()
find_package(Corrade REQUIRED PluginManager) find_package(Corrade REQUIRED PluginManager)
if(BUILD_PLUGINS_STATIC) if(BUILD_PLUGINS_STATIC)

Loading…
Cancel
Save