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).
- `WITH_GLUTAPPLICATION` @m_class{m-label m-danger} **deprecated** --- Build
the @ref Platform::GlutApplication "GlutApplication" library. Depends on
[GLUT](http://freeglut.sourceforge.net/). Enables also building of the GL
library.
[GLUT](http://freeglut.sourceforge.net/). Requires `TARGET_GL` to be
enabled.
- `WITH_GLXAPPLICATION` --- Build the
@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
@ref Platform::Sdl2Application "Sdl2Application" library. Depends on
[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.
- `WITH_WINDOWLESSCGLAPPLICATION` --- Build the
@ref Platform::WindowlessCglApplication "WindowlessCglApplication" library.
Enables also building of the GL library.
Requires `TARGET_GL` to be enabled.
- `WITH_WINDOWLESSEGLAPPLICATION` --- Build the
@ref Platform::WindowlessEglApplication "WindowlessEglApplication" library.
Enables also building of the GL library.
Requires `TARGET_GL` to be enabled.
- `WITH_WINDOWLESSGLXAPPLICATION` --- Build the
@ref Platform::WindowlessGlxApplication "WindowlessGlxApplication" library.
Enables also building of the GL library.
Requires `TARGET_GL` to be enabled.
- `WITH_WINDOWLESSIOSAPPLICATION` --- Build the
@ref Platform::WindowlessIosApplication "WindowlessIosApplication" library.
Enables also building of the GL library.
Requires `TARGET_GL` to be enabled.
- `WITH_WINDOWLESSWGLAPPLICATION` --- Build the
@ref Platform::WindowlessWglApplication "WindowlessWglApplication" library.
Enables also building of the GL library.
Requires `TARGET_GL` to be enabled.
- `WITH_WINDOWLESSWINDOWSEGLAPPLICATION` --- Build the
@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
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
more information):
- `WITH_CGLCONTEXT` --- Build the CGL context handling library. Enables also
building of the GL library.
- `WITH_EGLCONTEXT` --- Build the EGL context handling library. Enables also
building of the GL library.
- `WITH_GLXCONTEXT` --- Build the GLX context handling library. Enables also
building of the GL library.
- `WITH_WGLCONTEXT` --- Build the WGL context handling library. Enables also
building of the GL library.
- `WITH_CGLCONTEXT` --- Build the CGL context handling library. Requires
`TARGET_GL` to be enabled.
- `WITH_EGLCONTEXT` --- Build the EGL context handling library. Requires
`TARGET_GL` to be enabled.
- `WITH_GLXCONTEXT` --- Build the GLX context handling library. Requires
`TARGET_GL` to be enabled.
- `WITH_WGLCONTEXT` --- Build the WGL context handling library. Requires
`TARGET_GL` to be enabled.
There are also extensions to @ref Corrade::TestSuite::Tester for testing GPU
code:
- `WITH_OPENGLTESTER` --- The @ref GL::OpenGLTester class. Enables also
building of the GL library and one of the windowless application libraries
based on the target platform.
- `WITH_OPENGLTESTER` --- The @ref GL::OpenGLTester class. Requires
`TARGET_GL` to be enabled; enables building of one of the windowless
application libraries based on the target platform.
Magnum also contains a set of dependency-less plugins for importing essential
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.
- `WITH_MAGNUMFONT` --- Build the @ref Text::MagnumFont "MagnumFont" plugin.
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
@ref Text::MagnumFontConverter "MagnumFontConverter" plugin. Enables also
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"
executable, which provides information about the engine OpenGL
capabilities. Enables building of one of the windowless application
libraries based on the target platform.
capabilities. Requires `TARGET_GL` to be enabled; enables building of one
of the windowless application libraries based on the target platform.
- `WITH_AL_INFO` --- Build the @ref magnum-al-info "magnum-al-info"
executable, which provides information about the engine OpenAL
capabilities.
@ -638,12 +639,13 @@ There are also a few command-line utilities, also all disabled by default:
@ref magnum-distancefieldconverter "magnum-distancefieldconverter"
executable for converting black&white images to distance field textures.
Enables also building of the @ref TextureTools library. Available only on
desktop GL. Enables building of one of the windowless application libraries
based on the target platform.
desktop GL. Requires `TARGET_GL` to be enabled; enables building of one of
the windowless application libraries based on the target platform.
- `WITH_FONTCONVERTER` --- Build the @ref magnum-fontconverter "magnum-fontconverter"
executable for converting fonts of different formats. Enables also building
of the @ref Text library. Available only on desktop GL. Enables building of
one of the windowless application libraries based on the target platform.
of the @ref Text library. Available only on desktop GL. Requires
`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"
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
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)
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()
*/
#include "Magnum/configure.h"
#ifdef MAGNUM_TARGET_GL
#include <Corrade/TestSuite/Tester.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,
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.
@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 {
public:
@ -297,5 +304,8 @@ typedef CORRADE_DEPRECATED("use GL::OpenGLTester instead") Magnum::GL::OpenGLTes
#endif
}
#else
#error this header is available only in the OpenGL build
#endif
#endif

10
src/Magnum/Platform/AbstractXApplication.h

@ -29,6 +29,9 @@
* @brief Class @ref Magnum::Platform::AbstractXApplication
*/
#include "Magnum/configure.h"
#ifdef MAGNUM_TARGET_GL
#include <Corrade/Containers/EnumSet.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
@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 {
public:
@ -663,5 +670,8 @@ class AbstractXApplication::MouseMoveEvent: public AbstractXApplication::InputEv
};
}}
#else
#error this header is available only in the OpenGL build
#endif
#endif

52
src/Magnum/Platform/CMakeLists.txt

@ -308,6 +308,10 @@ endif()
# GLX application
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_GLXCONTEXTHANDLER 1)
set(NEED_GLXCONTEXT 1)
@ -351,6 +355,10 @@ endif()
# X/EGL application
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_EGLCONTEXTHANDLER 1)
set(NEED_EGLCONTEXT 1)
@ -394,6 +402,10 @@ endif()
# Windowless EGL application
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(MagnumWindowlessEglApplication_SRCS
@ -429,6 +441,10 @@ endif()
# Windowless GLX application
if(WITH_WINDOWLESSGLXAPPLICATION)
if(NOT TARGET_GL)
message(SEND_ERROR "WindowlessGlxApplication is available only if TARGET_GL is enabled")
endif()
set(NEED_GLXCONTEXT 1)
find_package(X11)
@ -471,6 +487,10 @@ endif()
# Windowless iOS application
if(WITH_WINDOWLESSIOSAPPLICATION)
if(NOT TARGET_GL)
message(SEND_ERROR "WindowlessIosApplication is available only if TARGET_GL is enabled")
endif()
set(NEED_EGLCONTEXT 1)
# We need to link to Foundation framework to use ObjC
@ -509,6 +529,10 @@ endif()
# Windowless WGL application
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(MagnumWindowlessWglApplication_SRCS
@ -540,6 +564,10 @@ endif()
# Windowless Windows/EGL application
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(MagnumWindowlessWindowsEglApplication_SRCS
@ -575,6 +603,10 @@ endif()
# Windowless CGL application
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(MagnumWindowlessCglApplication_SRCS
@ -706,6 +738,10 @@ if(NEED_CGLCONTEXT OR WITH_CGLCONTEXT)
# Also create proper static library, if requested
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
# consisted only of $<TARGET_OBJECTS> entries, thus compiling the
# sources again in this case
@ -747,6 +783,10 @@ if(NEED_EGLCONTEXT OR WITH_EGLCONTEXT)
# Also create proper static library, if requested
if(WITH_EGLCONTEXT)
if(NOT TARGET_GL)
message(SEND_ERROR "EglContext is available only if TARGET_GL is enabled")
endif()
add_library(MagnumEglContext STATIC
$<TARGET_OBJECTS:MagnumEglContextObjects>
${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
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>)
set_target_properties(MagnumGlxContext PROPERTIES
DEBUG_POSTFIX "-d"
@ -816,6 +860,10 @@ if(NEED_WGLCONTEXT OR WITH_WGLCONTEXT)
# Also create proper static library, if requested
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>)
set_target_properties(MagnumWglContext PROPERTIES
DEBUG_POSTFIX "-d"
@ -837,6 +885,10 @@ endif()
# Magnum 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)
target_link_libraries(magnum-gl-info PRIVATE MagnumGL)
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.
*/
#include "Magnum/configure.h"
#ifdef MAGNUM_TARGET_GL
#include <string>
#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
@cpp Platform::Application @ce and the macro is aliased to
@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 {
public:
@ -883,5 +890,8 @@ CORRADE_ENUMSET_OPERATORS(GlutApplication::MouseMoveEvent::Buttons)
CORRADE_IGNORE_DEPRECATED_POP
}}
#else
#error this header is available only in the OpenGL build
#endif
#endif

10
src/Magnum/Platform/GlxApplication.h

@ -29,6 +29,9 @@
* @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/Platform.h"
@ -82,6 +85,10 @@ MAGNUM_GLXAPPLICATION_MAIN(MyApplication)
If no other application header is included, this class is also aliased to
@cpp Platform::Application @ce and the macro is aliased to
@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 {
public:
@ -145,5 +152,8 @@ typedef BasicScreenedApplication<GlxApplication> ScreenedApplication;
#endif
}}
#else
#error this header is available only in the OpenGL build
#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()
*/
#include "Magnum/configure.h"
#ifdef MAGNUM_TARGET_GL
#include <Corrade/Containers/Pointer.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
other application header is included, this class is also aliased to
@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 {
public:
@ -194,6 +201,10 @@ MAGNUM_WINDOWLESSCGLAPPLICATION_MAIN(MyApplication)
If no other application header is included, this class is also aliased to
@cpp Platform::WindowlessApplication @ce and the macro is aliased to
@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 {
public:
@ -334,5 +345,8 @@ typedef WindowlessCglContext WindowlessGLContext;
#endif
}}
#else
#error this header is available only in the OpenGL build
#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()
*/
#include "Magnum/configure.h"
#ifdef MAGNUM_TARGET_GL
#include <EGL/egl.h>
#include <EGL/eglext.h>
/* 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
other application header is included, this class is also aliased to
@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 {
public:
@ -473,5 +480,8 @@ typedef WindowlessEglContext WindowlessGLContext;
#endif
}}
#else
#error this header is available only in the OpenGL build
#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()
*/
#include "Magnum/configure.h"
#ifdef MAGNUM_TARGET_GL
#include <Corrade/Containers/EnumSet.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
other application header is included, this class is also aliased to
@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 {
public:
@ -289,6 +296,10 @@ MAGNUM_WINDOWLESSGLXAPPLICATION_MAIN(MyApplication)
If no other application header is included, this class is also aliased to
@cpp Platform::WindowlessApplication @ce and the macro is aliased to
@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 {
public:
@ -429,5 +440,8 @@ typedef WindowlessGlxContext WindowlessGLContext;
#endif
}}
#else
#error this header is available only in the OpenGL build
#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()
*/
#include "Magnum/configure.h"
#ifdef MAGNUM_TARGET_GL
#include <Corrade/Containers/EnumSet.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
other application header is included, this class is also aliased to
@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 {
public:
@ -192,6 +199,10 @@ MAGNUM_WINDOWLESSIOSAPPLICATION_MAIN(MyApplication)
If no other application header is included, this class is also aliased to
@cpp Platform::WindowlessApplication @ce and the macro is aliased to
@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 {
public:
@ -332,5 +343,8 @@ typedef WindowlessIosContext WindowlessGLContext;
#endif
}}
#else
#error this header is available only in the OpenGL build
#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()
*/
#include "Magnum/configure.h"
#ifdef MAGNUM_TARGET_GL
#ifndef DOXYGEN_GENERATING_OUTPUT
#define WIN32_LEAN_AND_MEAN 1
#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
other application header is included, this class is also aliased to
@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 {
public:
@ -287,6 +294,10 @@ MAGNUM_WINDOWLESSWGLAPPLICATION_MAIN(MyApplication)
If no other application header is included, this class is also aliased to
@cpp Platform::WindowlessApplication @ce and the macro is aliased to
@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 {
public:
@ -427,5 +438,8 @@ typedef WindowlessWglContext WindowlessGLContext;
#endif
}}
#else
#error this header is available only in the OpenGL build
#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()
*/
#include "Magnum/configure.h"
#ifdef MAGNUM_TARGET_GL
#ifndef DOXYGEN_GENERATING_OUTPUT
#define WIN32_LEAN_AND_MEAN 1
#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
other application header is included, this class is also aliased to
@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 {
public:
@ -260,6 +267,10 @@ MAGNUM_WINDOWLESSWINDOWSEGLAPPLICATION_MAIN(MyApplication)
If no other application header is included, this class is also aliased to
@cpp Platform::WindowlessApplication @ce and the macro is aliased to
@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 {
public:
@ -398,5 +409,8 @@ typedef WindowlessWindowsEglContext WindowlessGLContext;
#endif
}}
#else
#error this header is available only in the OpenGL build
#endif
#endif

10
src/Magnum/Platform/XEglApplication.h

@ -29,6 +29,9 @@
* @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/AbstractXApplication.h"
@ -83,6 +86,10 @@ MAGNUM_XEGLAPPLICATION_MAIN(MyApplication)
If no other application header is included, this class is also aliased to
@cpp Platform::Application @ce and the macro is aliased to
@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 {
public:
@ -146,5 +153,8 @@ typedef BasicScreenedApplication<XEglApplication> ScreenedApplication;
#endif
}}
#else
#error this header is available only in the OpenGL build
#endif
#endif

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

@ -181,6 +181,9 @@ Vendor extension support:
...
@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 {

4
src/Magnum/Shaders/CMakeLists.txt

@ -23,6 +23,10 @@
# 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)
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)
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)
target_link_libraries(magnum-fontconverter PRIVATE
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
current directory. You can then load and use them via the
@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 {

4
src/Magnum/TextureTools/CMakeLists.txt

@ -67,6 +67,10 @@ install(TARGETS MagnumTextureTools
install(FILES ${MagnumTextureTools_HEADERS} DESTINATION ${MAGNUM_INCLUDE_INSTALL_DIR}/TextureTools)
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)
target_link_libraries(magnum-distancefieldconverter PRIVATE
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
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 {

6
src/MagnumPlugins/MagnumFont/CMakeLists.txt

@ -23,6 +23,12 @@
# 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)
if(BUILD_PLUGINS_STATIC)

Loading…
Cancel
Save