Browse Source

Split the OpenGL layer out, pt 23: adapted Platform.

pull/233/head
Vladimír Vondruš 8 years ago
parent
commit
298e7c20a7
  1. 2
      doc/snippets/MagnumPlatform-windowless.cpp
  2. 4
      doc/snippets/MagnumPlatform.cpp
  3. 10
      src/Magnum/Platform/AbstractXApplication.cpp
  4. 9
      src/Magnum/Platform/AbstractXApplication.h
  5. 6
      src/Magnum/Platform/AndroidApplication.cpp
  6. 4
      src/Magnum/Platform/AndroidApplication.h
  7. 31
      src/Magnum/Platform/GLContext.h
  8. 14
      src/Magnum/Platform/GlfwApplication.cpp
  9. 15
      src/Magnum/Platform/GlfwApplication.h
  10. 14
      src/Magnum/Platform/GlutApplication.cpp
  11. 16
      src/Magnum/Platform/GlutApplication.h
  12. 3
      src/Magnum/Platform/GlxApplication.cpp
  13. 10
      src/Magnum/Platform/Implementation/EglContextHandler.cpp
  14. 8
      src/Magnum/Platform/Implementation/GlxContextHandler.cpp
  15. 2
      src/Magnum/Platform/Implementation/GlxContextHandler.h
  16. 16
      src/Magnum/Platform/Sdl2Application.cpp
  17. 40
      src/Magnum/Platform/Sdl2Application.h
  18. 8
      src/Magnum/Platform/WindowlessCglApplication.cpp
  19. 15
      src/Magnum/Platform/WindowlessCglApplication.h
  20. 10
      src/Magnum/Platform/WindowlessEglApplication.cpp
  21. 11
      src/Magnum/Platform/WindowlessEglApplication.h
  22. 10
      src/Magnum/Platform/WindowlessGlxApplication.cpp
  23. 23
      src/Magnum/Platform/WindowlessGlxApplication.h
  24. 7
      src/Magnum/Platform/WindowlessIosApplication.h
  25. 8
      src/Magnum/Platform/WindowlessWglApplication.cpp
  26. 13
      src/Magnum/Platform/WindowlessWglApplication.h
  27. 6
      src/Magnum/Platform/WindowlessWindowsEglApplication.cpp
  28. 13
      src/Magnum/Platform/WindowlessWindowsEglApplication.h
  29. 379
      src/Magnum/Platform/gl-info.cpp

2
doc/snippets/MagnumPlatform-windowless.cpp

@ -24,7 +24,7 @@
*/ */
/* [windowless] */ /* [windowless] */
#include <Magnum/Context.h> #include <Magnum/GL/Context.h>
#include <Magnum/Platform/WindowlessEglApplication.h> #include <Magnum/Platform/WindowlessEglApplication.h>
using namespace Magnum; using namespace Magnum;

4
doc/snippets/MagnumPlatform.cpp

@ -24,8 +24,8 @@
*/ */
/* [windowed] */ /* [windowed] */
#include <Magnum/DefaultFramebuffer.h> #include <Magnum/GL/DefaultFramebuffer.h>
#include <Magnum/Renderer.h> #include <Magnum/GL/Renderer.h>
#include <Magnum/Math/Color.h> #include <Magnum/Math/Color.h>
#include <Magnum/Platform/Sdl2Application.h> #include <Magnum/Platform/Sdl2Application.h>
#include <Magnum/Platform/Context.h> #include <Magnum/Platform/Context.h>

10
src/Magnum/Platform/AbstractXApplication.cpp

@ -27,8 +27,8 @@
#include <Corrade/Utility/System.h> #include <Corrade/Utility/System.h>
#include "Magnum/Platform/Context.h" #include "Magnum/GL/Version.h"
#include "Magnum/Version.h" #include "Magnum/Platform/GLContext.h"
#include "Implementation/AbstractContextHandler.h" #include "Implementation/AbstractContextHandler.h"
@ -41,7 +41,7 @@ AbstractXApplication::AbstractXApplication(Implementation::AbstractContextHandle
createContext(configuration); createContext(configuration);
} }
AbstractXApplication::AbstractXApplication(Implementation::AbstractContextHandler<Configuration, Display*, VisualID, Window>* contextHandler, const Arguments& arguments, NoCreateT): _contextHandler{contextHandler}, _context{new Context{NoCreate, arguments.argc, arguments.argv}}, _flags{Flag::Redraw} {} AbstractXApplication::AbstractXApplication(Implementation::AbstractContextHandler<Configuration, Display*, VisualID, Window>* contextHandler, const Arguments& arguments, NoCreateT): _contextHandler{contextHandler}, _context{new GLContext{NoCreate, arguments.argc, arguments.argv}}, _flags{Flag::Redraw} {}
void AbstractXApplication::createContext() { createContext({}); } void AbstractXApplication::createContext() { createContext({}); }
@ -50,7 +50,7 @@ void AbstractXApplication::createContext(const Configuration& configuration) {
} }
bool AbstractXApplication::tryCreateContext(const Configuration& configuration) { bool AbstractXApplication::tryCreateContext(const Configuration& configuration) {
CORRADE_ASSERT(_context->version() == Version::None, "Platform::AbstractXApplication::tryCreateContext(): context already created", false); CORRADE_ASSERT(_context->version() == GL::Version::None, "Platform::AbstractXApplication::tryCreateContext(): context already created", false);
_viewportSize = configuration.size(); _viewportSize = configuration.size();
@ -175,7 +175,7 @@ void AbstractXApplication::mousePressEvent(MouseEvent&) {}
void AbstractXApplication::mouseReleaseEvent(MouseEvent&) {} void AbstractXApplication::mouseReleaseEvent(MouseEvent&) {}
void AbstractXApplication::mouseMoveEvent(MouseMoveEvent&) {} void AbstractXApplication::mouseMoveEvent(MouseMoveEvent&) {}
AbstractXApplication::Configuration::Configuration(): _title("Magnum X Application"), _size(800, 600), _version(Version::None) {} AbstractXApplication::Configuration::Configuration(): _title("Magnum X Application"), _size(800, 600), _version(GL::Version::None) {}
AbstractXApplication::Configuration::~Configuration() = default; AbstractXApplication::Configuration::~Configuration() = default;
}} }}

9
src/Magnum/Platform/AbstractXApplication.h

@ -42,6 +42,7 @@
#include "Magnum/Magnum.h" #include "Magnum/Magnum.h"
#include "Magnum/Tags.h" #include "Magnum/Tags.h"
#include "Magnum/GL/GL.h"
#include "Magnum/Math/Vector2.h" #include "Magnum/Math/Vector2.h"
#include "Magnum/Platform/Platform.h" #include "Magnum/Platform/Platform.h"
@ -188,7 +189,7 @@ class AbstractXApplication {
Atom _deleteWindow; Atom _deleteWindow;
std::unique_ptr<Implementation::AbstractContextHandler<Configuration, Display*, VisualID, Window>> _contextHandler; std::unique_ptr<Implementation::AbstractContextHandler<Configuration, Display*, VisualID, Window>> _contextHandler;
std::unique_ptr<Platform::Context> _context; std::unique_ptr<Platform::GLContext> _context;
/** @todo Get this from the created window */ /** @todo Get this from the created window */
Vector2i _viewportSize; Vector2i _viewportSize;
@ -240,10 +241,10 @@ class AbstractXApplication::Configuration {
} }
/** @copydoc Sdl2Application::Configuration::version() */ /** @copydoc Sdl2Application::Configuration::version() */
Version version() const { return _version; } GL::Version version() const { return _version; }
/** @copydoc Sdl2Application::Configuration::setVersion() */ /** @copydoc Sdl2Application::Configuration::setVersion() */
Configuration& setVersion(Version version) { Configuration& setVersion(GL::Version version) {
_version = version; _version = version;
return *this; return *this;
} }
@ -251,7 +252,7 @@ class AbstractXApplication::Configuration {
private: private:
std::string _title; std::string _title;
Vector2i _size; Vector2i _size;
Version _version; GL::Version _version;
}; };
/** /**

6
src/Magnum/Platform/AndroidApplication.cpp

@ -29,8 +29,8 @@
#include <Corrade/Utility/Debug.h> #include <Corrade/Utility/Debug.h>
#include <android_native_app_glue.h> #include <android_native_app_glue.h>
#include "Magnum/Version.h" #include "Magnum/GL/Version.h"
#include "Magnum/Platform/Context.h" #include "Magnum/Platform/GLContext.h"
#include "Implementation/Egl.h" #include "Implementation/Egl.h"
@ -66,7 +66,7 @@ AndroidApplication::AndroidApplication(const Arguments& arguments, const Configu
createContext(configuration); createContext(configuration);
} }
AndroidApplication::AndroidApplication(const Arguments& arguments, NoCreateT): _state{arguments}, _context{new Context{NoCreate, 0, nullptr}} { AndroidApplication::AndroidApplication(const Arguments& arguments, NoCreateT): _state{arguments}, _context{new GLContext{NoCreate, 0, nullptr}} {
/* Redirect debug output to Android log */ /* Redirect debug output to Android log */
_logOutput.reset(new LogOutput); _logOutput.reset(new LogOutput);
} }

4
src/Magnum/Platform/AndroidApplication.h

@ -338,8 +338,8 @@ class AndroidApplication::Configuration {
* @brief Set context version * @brief Set context version
* *
* @note This function does nothing and is included only for * @note This function does nothing and is included only for
* compatibility with other toolkits. @ref Version::GLES200 or * compatibility with other toolkits. @ref GL::Version::GLES200 or
* @ref Version::GLES300 is used based on engine compile-time * @ref GL::Version::GLES300 is used based on engine compile-time
* settings. * settings.
*/ */
Configuration& setVersion(Version) { return *this; } Configuration& setVersion(Version) { return *this; }

31
src/Magnum/Platform/GLContext.h

@ -61,9 +61,10 @@ class GLContext: public GL::Context {
* platform-specific API, does initial setup, detects available * platform-specific API, does initial setup, detects available
* features and enables them throughout the engine. If detected version * features and enables them throughout the engine. If detected version
* is unsupported or any other error occurs, a message is printed to * is unsupported or any other error occurs, a message is printed to
* output and the application exits. See @ref Context(NoCreateT, Int, char**) * output and the application exits. See
* and @ref tryCreate() for an alternative. * @ref GLContext(NoCreateT, Int, char**) and @ref tryCreate() for
* @see @ref Context-command-line, @fn_gl{Get} with @def_gl{MAJOR_VERSION}, * an alternative.
* @see @ref GL-Context-command-line, @fn_gl{Get} with @def_gl{MAJOR_VERSION},
* @def_gl{MINOR_VERSION}, @def_gl{CONTEXT_FLAGS}, * @def_gl{MINOR_VERSION}, @def_gl{CONTEXT_FLAGS},
* @def_gl{NUM_EXTENSIONS}, @fn_gl{GetString} with @def_gl{EXTENSIONS} * @def_gl{NUM_EXTENSIONS}, @fn_gl{GetString} with @def_gl{EXTENSIONS}
*/ */
@ -81,7 +82,7 @@ class GLContext: public GL::Context {
* Equivalent to passing @cpp {0, nullptr} @ce to * Equivalent to passing @cpp {0, nullptr} @ce to
* @ref GLContext(Int, const char**). Even if the command-line options * @ref GLContext(Int, const char**). Even if the command-line options
* are not propagated, it's still possible to affect the renderer * are not propagated, it's still possible to affect the renderer
* behavior from the environment. See @ref Context-command-line for * behavior from the environment. See @ref GL-Context-command-line for
* more information. * more information.
*/ */
explicit GLContext(): GLContext{0, nullptr} {} explicit GLContext(): GLContext{0, nullptr} {}
@ -89,10 +90,10 @@ class GLContext: public GL::Context {
/** /**
* @brief Construct the class without doing complete setup * @brief Construct the class without doing complete setup
* *
* Unlike @ref Context(Int, char**) just parses command-line arguments * Unlike @ref GLContext(Int, char**) just parses command-line
* and sets @ref version() to @ref Version::None, everything else is * arguments and sets @ref version() to @ref GL::Version::None,
* left in empty state. Use @ref create() or @ref tryCreate() to * everything else is left in an empty state. Use @ref create() or
* complete the setup. * @ref tryCreate() to complete the setup.
*/ */
explicit GLContext(NoCreateT, Int argc, const char** argv): explicit GLContext(NoCreateT, Int argc, const char** argv):
#ifndef CORRADE_TARGET_EMSCRIPTEN #ifndef CORRADE_TARGET_EMSCRIPTEN
@ -111,10 +112,10 @@ class GLContext: public GL::Context {
* @brief Construct the class without doing complete setup * @brief Construct the class without doing complete setup
* *
* Equivalent to passing @cpp {NoCreate, 0, nullptr} @ce to * Equivalent to passing @cpp {NoCreate, 0, nullptr} @ce to
* @ref Context(NoCreateT, Int, const char**). Even if the command-line * @ref GLContext(NoCreateT, Int, const char**). Even if the
* options are not propagated, it's still possible to affect the * command-line options are not propagated, it's still possible to
* renderer behavior from the environment. See @ref Context-command-line * affect the renderer behavior from the environment. See
* for more information. * @ref GL-Context-command-line for more information.
*/ */
explicit GLContext(NoCreateT): GLContext{NoCreate, 0, nullptr} {} explicit GLContext(NoCreateT): GLContext{NoCreate, 0, nullptr} {}
@ -122,10 +123,10 @@ class GLContext: public GL::Context {
* @brief Complete the context setup and exit on failure * @brief Complete the context setup and exit on failure
* *
* Finalizes the setup after the class was created using * Finalizes the setup after the class was created using
* @ref Context(NoCreateT, Int, char**). If detected version is * @ref GLContext(NoCreateT, Int, char**). If detected version is
* unsupported or any other error occurs, a message is printed to error * unsupported or any other error occurs, a message is printed to error
* output and the application exits. See @ref Context(Int, char**) for * output and the application exits. See @ref GLContext(Int, char**)
* more information and @ref tryCreate() for an alternative. * for more information and @ref tryCreate() for an alternative.
*/ */
void create() { return GL::Context::create(); } void create() { return GL::Context::create(); }

14
src/Magnum/Platform/GlfwApplication.cpp

@ -30,8 +30,8 @@
#include <Corrade/Utility/String.h> #include <Corrade/Utility/String.h>
#include <Corrade/Utility/Unicode.h> #include <Corrade/Utility/Unicode.h>
#include "Magnum/Version.h" #include "Magnum/GL/Version.h"
#include "Magnum/Platform/Context.h" #include "Magnum/Platform/GLContext.h"
#include "Magnum/Platform/ScreenedApplication.hpp" #include "Magnum/Platform/ScreenedApplication.hpp"
namespace Magnum { namespace Platform { namespace Magnum { namespace Platform {
@ -52,7 +52,7 @@ GlfwApplication::GlfwApplication(const Arguments& arguments, const Configuration
} }
GlfwApplication::GlfwApplication(const Arguments& arguments, NoCreateT): GlfwApplication::GlfwApplication(const Arguments& arguments, NoCreateT):
_context{new Context{NoCreate, arguments.argc, arguments.argv}}, _context{new GLContext{NoCreate, arguments.argc, arguments.argv}},
_flags{Flag::Redraw} _flags{Flag::Redraw}
{ {
/* Save global instance */ /* Save global instance */
@ -74,7 +74,7 @@ void GlfwApplication::createContext(const Configuration& configuration) {
} }
bool GlfwApplication::tryCreateContext(const Configuration& configuration) { bool GlfwApplication::tryCreateContext(const Configuration& configuration) {
CORRADE_ASSERT(_context->version() == Version::None, "Platform::GlfwApplication::tryCreateContext(): context already created", false); CORRADE_ASSERT(_context->version() == GL::Version::None, "Platform::GlfwApplication::tryCreateContext(): context already created", false);
/* Window flags */ /* Window flags */
GLFWmonitor* monitor = nullptr; /* Needed for setting fullscreen */ GLFWmonitor* monitor = nullptr; /* Needed for setting fullscreen */
@ -104,13 +104,13 @@ bool GlfwApplication::tryCreateContext(const Configuration& configuration) {
glfwWindowHint(GLFW_STEREO, flags >= Configuration::Flag::Stereo); glfwWindowHint(GLFW_STEREO, flags >= Configuration::Flag::Stereo);
/* Set context version, if requested */ /* Set context version, if requested */
if(configuration.version() != Version::None) { if(configuration.version() != GL::Version::None) {
Int major, minor; Int major, minor;
std::tie(major, minor) = version(configuration.version()); std::tie(major, minor) = version(configuration.version());
glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, major); glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, major);
glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, minor); glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, minor);
#ifndef MAGNUM_TARGET_GLES #ifndef MAGNUM_TARGET_GLES
if(configuration.version() >= Version::GL310) { if(configuration.version() >= GL::Version::GL310) {
glfwWindowHint(GLFW_OPENGL_FORWARD_COMPAT, true); glfwWindowHint(GLFW_OPENGL_FORWARD_COMPAT, true);
glfwWindowHint(GLFW_OPENGL_PROFILE, GLFW_OPENGL_CORE_PROFILE); glfwWindowHint(GLFW_OPENGL_PROFILE, GLFW_OPENGL_CORE_PROFILE);
} }
@ -263,7 +263,7 @@ void GlfwApplication::textInputEvent(TextInputEvent&) {}
GlfwApplication::Configuration::Configuration(): GlfwApplication::Configuration::Configuration():
_title{"Magnum GLFW Application"}, _title{"Magnum GLFW Application"},
_size{800, 600}, _sampleCount{0}, _size{800, 600}, _sampleCount{0},
_version{Version::None}, _version{GL::Version::None},
_windowFlags{WindowFlag::Focused}, _windowFlags{WindowFlag::Focused},
_cursorMode{CursorMode::Normal} {} _cursorMode{CursorMode::Normal} {}

15
src/Magnum/Platform/GlfwApplication.h

@ -36,11 +36,12 @@
#include "Magnum/Magnum.h" #include "Magnum/Magnum.h"
#include "Magnum/Tags.h" #include "Magnum/Tags.h"
#include "Magnum/GL/GL.h"
#include "Magnum/Math/Vector2.h" #include "Magnum/Math/Vector2.h"
#include "Magnum/Platform/Platform.h" #include "Magnum/Platform/Platform.h"
/* We must include our own GL headers first to avoid conflicts */ /* We must include our own GL headers first to avoid conflicts */
#include "Magnum/OpenGL.h" #include "Magnum/GL/OpenGL.h"
#include <GLFW/glfw3.h> #include <GLFW/glfw3.h>
@ -356,7 +357,7 @@ class GlfwApplication {
static GlfwApplication* _instance; static GlfwApplication* _instance;
GLFWwindow* _window; GLFWwindow* _window;
std::unique_ptr<Platform::Context> _context; std::unique_ptr<Platform::GLContext> _context;
Flags _flags; Flags _flags;
}; };
@ -534,7 +535,7 @@ class GlfwApplication::Configuration {
} }
/** @brief Context version */ /** @brief Context version */
Version version() const { return _version; } GL::Version version() const { return _version; }
/** /**
* @brief Set context version * @brief Set context version
@ -542,9 +543,9 @@ class GlfwApplication::Configuration {
* If requesting version greater or equal to OpenGL 3.1, core profile * If requesting version greater or equal to OpenGL 3.1, core profile
* is used. The created context will then have any version which is * is used. The created context will then have any version which is
* backwards-compatible with requested one. Default is * backwards-compatible with requested one. Default is
* @ref Version::None, i.e. any provided version is used. * @ref GL::Version::None, i.e. any provided version is used.
*/ */
Configuration& setVersion(Version version) { Configuration& setVersion(GL::Version version) {
_version = version; _version = version;
return *this; return *this;
} }
@ -558,7 +559,7 @@ class GlfwApplication::Configuration {
* *
* Default is @cpp 0 @ce, thus no multisampling. The actual sample * Default is @cpp 0 @ce, thus no multisampling. The actual sample
* count is ignored, GLFW either enables it or disables. See also * count is ignored, GLFW either enables it or disables. See also
* @ref Renderer::Feature::Multisampling. * @ref GL::Renderer::Feature::Multisampling.
*/ */
Configuration& setSampleCount(Int count) { Configuration& setSampleCount(Int count) {
_sampleCount = count; _sampleCount = count;
@ -583,7 +584,7 @@ class GlfwApplication::Configuration {
std::string _title; std::string _title;
Vector2i _size; Vector2i _size;
Int _sampleCount; Int _sampleCount;
Version _version; GL::Version _version;
Flags _flags; Flags _flags;
WindowFlags _windowFlags; WindowFlags _windowFlags;
CursorMode _cursorMode; CursorMode _cursorMode;

14
src/Magnum/Platform/GlutApplication.cpp

@ -27,8 +27,8 @@
#include <tuple> #include <tuple>
#include "Magnum/Version.h" #include "Magnum/GL/Version.h"
#include "Magnum/Platform/Context.h" #include "Magnum/Platform/GLContext.h"
#include "Magnum/Platform/ScreenedApplication.hpp" #include "Magnum/Platform/ScreenedApplication.hpp"
namespace Magnum { namespace Platform { namespace Magnum { namespace Platform {
@ -43,7 +43,7 @@ GlutApplication::GlutApplication(const Arguments& arguments, const Configuration
createContext(configuration); createContext(configuration);
} }
GlutApplication::GlutApplication(const Arguments& arguments, NoCreateT): _context{new Context{NoCreate, arguments.argc, arguments.argv}} { GlutApplication::GlutApplication(const Arguments& arguments, NoCreateT): _context{new GLContext{NoCreate, arguments.argc, arguments.argv}} {
/* Save global instance */ /* Save global instance */
_instance = this; _instance = this;
@ -59,7 +59,7 @@ void GlutApplication::createContext(const Configuration& configuration) {
} }
bool GlutApplication::tryCreateContext(const Configuration& configuration) { bool GlutApplication::tryCreateContext(const Configuration& configuration) {
CORRADE_ASSERT(_context->version() == Version::None, "Platform::GlutApplication::tryCreateContext(): context already created", false); CORRADE_ASSERT(_context->version() == GL::Version::None, "Platform::GlutApplication::tryCreateContext(): context already created", false);
unsigned int flags = GLUT_DOUBLE|GLUT_RGBA|GLUT_DEPTH|GLUT_STENCIL; unsigned int flags = GLUT_DOUBLE|GLUT_RGBA|GLUT_DEPTH|GLUT_STENCIL;
@ -70,12 +70,12 @@ bool GlutApplication::tryCreateContext(const Configuration& configuration) {
glutInitWindowSize(configuration.size().x(), configuration.size().y()); glutInitWindowSize(configuration.size().x(), configuration.size().y());
/* Set context version, if requested */ /* Set context version, if requested */
if(configuration.version() != Version::None) { if(configuration.version() != GL::Version::None) {
Int major, minor; Int major, minor;
std::tie(major, minor) = version(configuration.version()); std::tie(major, minor) = version(configuration.version());
glutInitContextVersion(major, minor); glutInitContextVersion(major, minor);
#ifndef MAGNUM_TARGET_GLES #ifndef MAGNUM_TARGET_GLES
if(configuration.version() >= Version::GL310) if(configuration.version() >= GL::Version::GL310)
glutInitContextProfile(GLUT_CORE_PROFILE); glutInitContextProfile(GLUT_CORE_PROFILE);
#endif #endif
} }
@ -142,7 +142,7 @@ void GlutApplication::mousePressEvent(MouseEvent&) {}
void GlutApplication::mouseReleaseEvent(MouseEvent&) {} void GlutApplication::mouseReleaseEvent(MouseEvent&) {}
void GlutApplication::mouseMoveEvent(MouseMoveEvent&) {} void GlutApplication::mouseMoveEvent(MouseMoveEvent&) {}
GlutApplication::Configuration::Configuration(): _title("Magnum GLUT Application"), _size(800, 600), _sampleCount(0), _version(Version::None) {} GlutApplication::Configuration::Configuration(): _title("Magnum GLUT Application"), _size(800, 600), _sampleCount(0), _version(GL::Version::None) {}
GlutApplication::Configuration::~Configuration() = default; GlutApplication::Configuration::~Configuration() = default;
template class BasicScreen<GlutApplication>; template class BasicScreen<GlutApplication>;

16
src/Magnum/Platform/GlutApplication.h

@ -34,11 +34,13 @@
#include "Magnum/Magnum.h" #include "Magnum/Magnum.h"
#include "Magnum/Tags.h" #include "Magnum/Tags.h"
#include "Magnum/GL/GL.h"
#include "Magnum/Math/Vector2.h" #include "Magnum/Math/Vector2.h"
#include "Magnum/Platform/Platform.h" #include "Magnum/Platform/Platform.h"
/* We must include our own GL headers first to avoid conflicts */ /* We must include our own GL headers first to avoid conflicts */
#include "Magnum/OpenGL.h" #include "Magnum/GL/OpenGL.h"
#include <GL/freeglut.h> #include <GL/freeglut.h>
namespace Magnum { namespace Platform { namespace Magnum { namespace Platform {
@ -294,7 +296,7 @@ class GlutApplication {
static GlutApplication* _instance; static GlutApplication* _instance;
std::unique_ptr<Platform::Context> _context; std::unique_ptr<Platform::GLContext> _context;
}; };
/** /**
@ -371,7 +373,7 @@ class GlutApplication::Configuration {
} }
/** @brief Context version */ /** @brief Context version */
Version version() const { return _version; } GL::Version version() const { return _version; }
/** /**
* @brief Set context version * @brief Set context version
@ -379,9 +381,9 @@ class GlutApplication::Configuration {
* If requesting version greater or equal to OpenGL 3.1, core profile * If requesting version greater or equal to OpenGL 3.1, core profile
* is used. The created context will then have any version which is * is used. The created context will then have any version which is
* backwards-compatible with requested one. Default is * backwards-compatible with requested one. Default is
* @ref Version::None, i.e. any provided version is used. * @ref GL::Version::None, i.e. any provided version is used.
*/ */
Configuration& setVersion(Version version) { Configuration& setVersion(GL::Version version) {
_version = version; _version = version;
return *this; return *this;
} }
@ -395,7 +397,7 @@ class GlutApplication::Configuration {
* *
* Default is @cpp 0 @ce, thus no multisampling. The actual sample * Default is @cpp 0 @ce, thus no multisampling. The actual sample
* count is ignored, GLUT either enables it or disables. See also * count is ignored, GLUT either enables it or disables. See also
* @ref Renderer::Feature::Multisampling. * @ref GL::Renderer::Feature::Multisampling.
*/ */
Configuration& setSampleCount(Int count) { Configuration& setSampleCount(Int count) {
_sampleCount = count; _sampleCount = count;
@ -406,7 +408,7 @@ class GlutApplication::Configuration {
std::string _title; std::string _title;
Vector2i _size; Vector2i _size;
Int _sampleCount; Int _sampleCount;
Version _version; GL::Version _version;
Flags _flags; Flags _flags;
}; };

3
src/Magnum/Platform/GlxApplication.cpp

@ -26,8 +26,7 @@
#include "GlxApplication.h" #include "GlxApplication.h"
#include "Magnum/Platform/ScreenedApplication.hpp" #include "Magnum/Platform/ScreenedApplication.hpp"
#include "Magnum/Platform/Implementation/GlxContextHandler.h"
#include "Implementation/GlxContextHandler.h"
namespace Magnum { namespace Platform { namespace Magnum { namespace Platform {

10
src/Magnum/Platform/Implementation/EglContextHandler.cpp

@ -29,10 +29,10 @@
#include <EGL/eglext.h> #include <EGL/eglext.h>
#include <Corrade/Utility/Debug.h> #include <Corrade/Utility/Debug.h>
#include "Magnum/Context.h" #include "Magnum/GL/Context.h"
#include "Magnum/Version.h" #include "Magnum/GL/Version.h"
#include "Egl.h" #include "Magnum/Platform/Implementation/Egl.h"
namespace Magnum { namespace Platform { namespace Implementation { namespace Magnum { namespace Platform { namespace Implementation {
@ -111,7 +111,7 @@ void EglContextHandler::createContext(const AbstractXApplication::Configuration&
/* Set context version, if requested. On desktop needs /* Set context version, if requested. On desktop needs
EGL_KHR_create_context. */ EGL_KHR_create_context. */
/** @todo Test for presence of EGL_KHR_create_context extension */ /** @todo Test for presence of EGL_KHR_create_context extension */
if(configuration.version() != Version::None) { if(configuration.version() != GL::Version::None) {
Int major, minor; Int major, minor;
std::tie(major, minor) = version(configuration.version()); std::tie(major, minor) = version(configuration.version());
@ -121,7 +121,7 @@ void EglContextHandler::createContext(const AbstractXApplication::Configuration&
attributes[3] = minor; attributes[3] = minor;
#ifndef MAGNUM_TARGET_GLES #ifndef MAGNUM_TARGET_GLES
if(configuration.version() >= Version::GL310) { if(configuration.version() >= GL::Version::GL310) {
attributes[4] = EGL_CONTEXT_OPENGL_PROFILE_MASK_KHR; attributes[4] = EGL_CONTEXT_OPENGL_PROFILE_MASK_KHR;
attributes[5] = EGL_CONTEXT_OPENGL_CORE_PROFILE_BIT_KHR; attributes[5] = EGL_CONTEXT_OPENGL_CORE_PROFILE_BIT_KHR;
} }

8
src/Magnum/Platform/Implementation/GlxContextHandler.cpp

@ -30,8 +30,8 @@
#include <GL/glxext.h> #include <GL/glxext.h>
#include <Corrade/Utility/Debug.h> #include <Corrade/Utility/Debug.h>
#include "Magnum/Context.h" #include "Magnum/GL/Context.h"
#include "Magnum/Version.h" #include "Magnum/GL/Version.h"
namespace Magnum { namespace Platform { namespace Implementation { namespace Magnum { namespace Platform { namespace Implementation {
@ -85,7 +85,7 @@ void GlxContextHandler::createContext(const AbstractXApplication::Configuration&
}; };
/* Set context version, if requested */ /* Set context version, if requested */
if(configuration.version() != Version::None) { if(configuration.version() != GL::Version::None) {
Int major, minor; Int major, minor;
std::tie(major, minor) = version(configuration.version()); std::tie(major, minor) = version(configuration.version());
@ -95,7 +95,7 @@ void GlxContextHandler::createContext(const AbstractXApplication::Configuration&
attributes[3] = minor; attributes[3] = minor;
#ifndef MAGNUM_TARGET_GLES #ifndef MAGNUM_TARGET_GLES
if(configuration.version() >= Version::GL310) { if(configuration.version() >= GL::Version::GL310) {
attributes[4] = GLX_CONTEXT_PROFILE_MASK_ARB; attributes[4] = GLX_CONTEXT_PROFILE_MASK_ARB;
attributes[5] = GLX_CONTEXT_CORE_PROFILE_BIT_ARB; attributes[5] = GLX_CONTEXT_CORE_PROFILE_BIT_ARB;
} }

2
src/Magnum/Platform/Implementation/GlxContextHandler.h

@ -25,7 +25,7 @@
DEALINGS IN THE SOFTWARE. DEALINGS IN THE SOFTWARE.
*/ */
#include "Magnum/OpenGL.h" #include "Magnum/GL/OpenGL.h"
#define Status int #define Status int
#include <GL/glx.h> #include <GL/glx.h>

16
src/Magnum/Platform/Sdl2Application.cpp

@ -32,9 +32,9 @@
#include <emscripten/emscripten.h> #include <emscripten/emscripten.h>
#endif #endif
#include "Magnum/Version.h" #include "Magnum/GL/Version.h"
#include "Magnum/Math/Range.h" #include "Magnum/Math/Range.h"
#include "Magnum/Platform/Context.h" #include "Magnum/Platform/GLContext.h"
#include "Magnum/Platform/ScreenedApplication.hpp" #include "Magnum/Platform/ScreenedApplication.hpp"
namespace Magnum { namespace Platform { namespace Magnum { namespace Platform {
@ -70,7 +70,7 @@ Sdl2Application::Sdl2Application(const Arguments& arguments, NoCreateT): _glCont
#ifndef CORRADE_TARGET_EMSCRIPTEN #ifndef CORRADE_TARGET_EMSCRIPTEN
_minimalLoopPeriod{0}, _minimalLoopPeriod{0},
#endif #endif
_context{new Context{NoCreate, arguments.argc, arguments.argv}}, _flags{Flag::Redraw} _context{new GLContext{NoCreate, arguments.argc, arguments.argv}}, _flags{Flag::Redraw}
{ {
if(SDL_Init(SDL_INIT_VIDEO) < 0) { if(SDL_Init(SDL_INIT_VIDEO) < 0) {
Error() << "Cannot initialize SDL."; Error() << "Cannot initialize SDL.";
@ -85,7 +85,7 @@ void Sdl2Application::createContext(const Configuration& configuration) {
} }
bool Sdl2Application::tryCreateContext(const Configuration& configuration) { bool Sdl2Application::tryCreateContext(const Configuration& configuration) {
CORRADE_ASSERT(_context->version() == Version::None, "Platform::Sdl2Application::tryCreateContext(): context already created", false); CORRADE_ASSERT(_context->version() == GL::Version::None, "Platform::Sdl2Application::tryCreateContext(): context already created", false);
/* Enable double buffering and 24bt depth buffer */ /* Enable double buffering and 24bt depth buffer */
SDL_GL_SetAttribute(SDL_GL_DOUBLEBUFFER, 1); SDL_GL_SetAttribute(SDL_GL_DOUBLEBUFFER, 1);
@ -103,14 +103,14 @@ bool Sdl2Application::tryCreateContext(const Configuration& configuration) {
/** @todo Remove when Emscripten has proper SDL2 support */ /** @todo Remove when Emscripten has proper SDL2 support */
#ifndef CORRADE_TARGET_EMSCRIPTEN #ifndef CORRADE_TARGET_EMSCRIPTEN
/* Set context version, if user-specified */ /* Set context version, if user-specified */
if(configuration.version() != Version::None) { if(configuration.version() != GL::Version::None) {
Int major, minor; Int major, minor;
std::tie(major, minor) = version(configuration.version()); std::tie(major, minor) = version(configuration.version());
SDL_GL_SetAttribute(SDL_GL_CONTEXT_MAJOR_VERSION, major); SDL_GL_SetAttribute(SDL_GL_CONTEXT_MAJOR_VERSION, major);
SDL_GL_SetAttribute(SDL_GL_CONTEXT_MINOR_VERSION, minor); SDL_GL_SetAttribute(SDL_GL_CONTEXT_MINOR_VERSION, minor);
#ifndef MAGNUM_TARGET_GLES #ifndef MAGNUM_TARGET_GLES
SDL_GL_SetAttribute(SDL_GL_CONTEXT_PROFILE_MASK, configuration.version() >= Version::GL310 ? SDL_GL_SetAttribute(SDL_GL_CONTEXT_PROFILE_MASK, configuration.version() >= GL::Version::GL310 ?
SDL_GL_CONTEXT_PROFILE_CORE : SDL_GL_CONTEXT_PROFILE_COMPATIBILITY); SDL_GL_CONTEXT_PROFILE_CORE : SDL_GL_CONTEXT_PROFILE_COMPATIBILITY);
#else #else
SDL_GL_SetAttribute(SDL_GL_CONTEXT_PROFILE_MASK, SDL_GL_CONTEXT_PROFILE_ES); SDL_GL_SetAttribute(SDL_GL_CONTEXT_PROFILE_MASK, SDL_GL_CONTEXT_PROFILE_ES);
@ -181,7 +181,7 @@ bool Sdl2Application::tryCreateContext(const Configuration& configuration) {
constexpr static const char amdVendorString[] = "ATI Technologies Inc."; constexpr static const char amdVendorString[] = "ATI Technologies Inc.";
const char* vendorString; const char* vendorString;
#endif #endif
if(configuration.version() == Version::None && (!_glContext if(configuration.version() == GL::Version::None && (!_glContext
#ifndef CORRADE_TARGET_APPLE #ifndef CORRADE_TARGET_APPLE
/* Sorry about the UGLY code, HOPEFULLY THERE WON'T BE MORE WORKAROUNDS */ /* Sorry about the UGLY code, HOPEFULLY THERE WON'T BE MORE WORKAROUNDS */
|| (vendorString = reinterpret_cast<const char*>(glGetString(GL_VENDOR)), || (vendorString = reinterpret_cast<const char*>(glGetString(GL_VENDOR)),
@ -538,7 +538,7 @@ Sdl2Application::Configuration::Configuration():
#endif #endif
_windowFlags{}, _sampleCount(0) _windowFlags{}, _sampleCount(0)
#ifndef CORRADE_TARGET_EMSCRIPTEN #ifndef CORRADE_TARGET_EMSCRIPTEN
, _version(Version::None), _sRGBCapable{false} , _version(GL::Version::None), _sRGBCapable{false}
#endif #endif
{} {}

40
src/Magnum/Platform/Sdl2Application.h

@ -36,6 +36,7 @@
#include "Magnum/Magnum.h" #include "Magnum/Magnum.h"
#include "Magnum/Tags.h" #include "Magnum/Tags.h"
#include "Magnum/GL/GL.h"
#include "Magnum/Math/Vector2.h" #include "Magnum/Math/Vector2.h"
#include "Magnum/Platform/Platform.h" #include "Magnum/Platform/Platform.h"
@ -568,16 +569,16 @@ class Sdl2Application {
* @brief Viewport event * @brief Viewport event
* *
* Called when window size changes. The default implementation does * Called when window size changes. The default implementation does
* nothing, if you want to respond to size changes, you should pass the * nothing. If you want to respond to size changes, you should pass the
* new size to @ref DefaultFramebuffer::setViewport() and possibly * new size to @ref GL::DefaultFramebuffer::setViewport() (if using
* elsewhere (to @ref SceneGraph::Camera::setViewport(), other * OpenGL) and possibly elsewhere (to
* framebuffers...). * @ref SceneGraph::Camera::setViewport(), other framebuffers...).
* *
* Note that this function might not get called at all if the window * Note that this function might not get called at all if the window
* size doesn't change. You should configure the initial state of your * size doesn't change. You should configure the initial state of your
* cameras, framebuffers etc. in application constructor rather than * cameras, framebuffers etc. in application constructor rather than
* relying on this function to be called. Viewport of default * relying on this function to be called. Viewport of default
* framebuffer can be retrieved via @ref DefaultFramebuffer::viewport(). * framebuffer can be retrieved via @ref GL::DefaultFramebuffer::viewport().
*/ */
virtual void viewportEvent(const Vector2i& size); virtual void viewportEvent(const Vector2i& size);
@ -585,9 +586,10 @@ class Sdl2Application {
* @brief Draw event * @brief Draw event
* *
* Called when the screen is redrawn. You should clean the framebuffer * Called when the screen is redrawn. You should clean the framebuffer
* using @ref DefaultFramebuffer::clear() and then add your own drawing * using @ref GL::DefaultFramebuffer::clear() (if using OpenGL) and
* functions. After drawing is finished, call @ref swapBuffers(). If * then add your own drawing functions. After drawing is finished, call
* you want to draw immediately again, call also @ref redraw(). * @ref swapBuffers(). If you want to draw immediately again, call also
* @ref redraw().
*/ */
virtual void drawEvent() = 0; virtual void drawEvent() = 0;
@ -765,7 +767,7 @@ class Sdl2Application {
SDL_Surface* _glContext; SDL_Surface* _glContext;
#endif #endif
std::unique_ptr<Platform::Context> _context; std::unique_ptr<Platform::GLContext> _context;
Flags _flags; Flags _flags;
}; };
@ -934,7 +936,7 @@ class Sdl2Application::Configuration {
* @brief Set context flags * @brief Set context flags
* @return Reference to self (for method chaining) * @return Reference to self (for method chaining)
* *
* Default is no flag. See also @ref Context::flags(). * Default is no flag. See also @ref GL::Context::flags().
* @note Not available in @ref CORRADE_TARGET_EMSCRIPTEN "Emscripten". * @note Not available in @ref CORRADE_TARGET_EMSCRIPTEN "Emscripten".
*/ */
Configuration& setFlags(Flags flags) { Configuration& setFlags(Flags flags) {
@ -947,7 +949,7 @@ class Sdl2Application::Configuration {
* *
* @note Not available in @ref CORRADE_TARGET_EMSCRIPTEN "Emscripten". * @note Not available in @ref CORRADE_TARGET_EMSCRIPTEN "Emscripten".
*/ */
Version version() const { return _version; } GL::Version version() const { return _version; }
#endif #endif
/** /**
@ -956,12 +958,13 @@ class Sdl2Application::Configuration {
* If requesting version greater or equal to OpenGL 3.1, core profile * If requesting version greater or equal to OpenGL 3.1, core profile
* is used. The created context will then have any version which is * is used. The created context will then have any version which is
* backwards-compatible with requested one. Default is * backwards-compatible with requested one. Default is
* @ref Version::None, i.e. any provided version is used. * @ref GL::Version::None, i.e. any provided version is used.
* @note In @ref CORRADE_TARGET_EMSCRIPTEN "Emscripten" this function * @note In @ref CORRADE_TARGET_EMSCRIPTEN "Emscripten" this function
* does nothing (@ref Version::GLES200 or @ref Version::GLES300 is * does nothing (@ref GL::Version::GLES200 or
* used implicitly based on the target). * @ref GL::Version::GLES300 is used implicitly based on the
* target).
*/ */
Configuration& setVersion(Version version) { Configuration& setVersion(GL::Version version) {
#ifndef CORRADE_TARGET_EMSCRIPTEN #ifndef CORRADE_TARGET_EMSCRIPTEN
_version = version; _version = version;
#else #else
@ -978,7 +981,7 @@ class Sdl2Application::Configuration {
* @return Reference to self (for method chaining) * @return Reference to self (for method chaining)
* *
* Default is @cpp 0 @ce, thus no multisampling. See also * Default is @cpp 0 @ce, thus no multisampling. See also
* @ref Renderer::Feature::Multisampling. * @ref GL::Renderer::Feature::Multisampling.
*/ */
Configuration& setSampleCount(Int count) { Configuration& setSampleCount(Int count) {
_sampleCount = count; _sampleCount = count;
@ -997,7 +1000,8 @@ class Sdl2Application::Configuration {
* @brief Set sRGB-capable default framebuffer * @brief Set sRGB-capable default framebuffer
* @return Reference to self (for method chaining) * @return Reference to self (for method chaining)
* *
* Default is @cpp false @ce. See also @ref Renderer::Feature::FramebufferSRGB. * Default is @cpp false @ce. See also
* @ref GL::Renderer::Feature::FramebufferSRGB.
* @note Not available in @ref CORRADE_TARGET_EMSCRIPTEN "Emscripten". * @note Not available in @ref CORRADE_TARGET_EMSCRIPTEN "Emscripten".
*/ */
Configuration& setSRGBCapable(bool enabled) { Configuration& setSRGBCapable(bool enabled) {
@ -1014,7 +1018,7 @@ class Sdl2Application::Configuration {
WindowFlags _windowFlags; WindowFlags _windowFlags;
Int _sampleCount; Int _sampleCount;
#ifndef CORRADE_TARGET_EMSCRIPTEN #ifndef CORRADE_TARGET_EMSCRIPTEN
Version _version; GL::Version _version;
Flags _flags; Flags _flags;
bool _sRGBCapable; bool _sRGBCapable;
#endif #endif

8
src/Magnum/Platform/WindowlessCglApplication.cpp

@ -30,12 +30,12 @@
#include <Corrade/Utility/Assert.h> #include <Corrade/Utility/Assert.h>
#include <Corrade/Utility/Debug.h> #include <Corrade/Utility/Debug.h>
#include "Magnum/Version.h" #include "Magnum/GL/Version.h"
#include "Magnum/Platform/Context.h" #include "Magnum/Platform/Context.h"
namespace Magnum { namespace Platform { namespace Magnum { namespace Platform {
WindowlessCglContext::WindowlessCglContext(const Configuration&, Context*) { WindowlessCglContext::WindowlessCglContext(const Configuration&, GLContext*) {
int formatCount; int formatCount;
CGLPixelFormatAttribute attributes32[] = { CGLPixelFormatAttribute attributes32[] = {
kCGLPFAAccelerated, kCGLPFAAccelerated,
@ -105,7 +105,7 @@ WindowlessCglApplication::WindowlessCglApplication(const Arguments& arguments, c
createContext(configuration); createContext(configuration);
} }
WindowlessCglApplication::WindowlessCglApplication(const Arguments& arguments, NoCreateT): _glContext{NoCreate}, _context{new Context{NoCreate, arguments.argc, arguments.argv}} {} WindowlessCglApplication::WindowlessCglApplication(const Arguments& arguments, NoCreateT): _glContext{NoCreate}, _context{new GLContext{NoCreate, arguments.argc, arguments.argv}} {}
WindowlessCglApplication::~WindowlessCglApplication() = default; WindowlessCglApplication::~WindowlessCglApplication() = default;
@ -116,7 +116,7 @@ void WindowlessCglApplication::createContext(const Configuration& configuration)
} }
bool WindowlessCglApplication::tryCreateContext(const Configuration& configuration) { bool WindowlessCglApplication::tryCreateContext(const Configuration& configuration) {
CORRADE_ASSERT(_context->version() == Version::None, "Platform::WindowlessCglApplication::tryCreateContext(): context already created", false); CORRADE_ASSERT(_context->version() == GL::Version::None, "Platform::WindowlessCglApplication::tryCreateContext(): context already created", false);
WindowlessCglContext glContext{configuration, _context.get()}; WindowlessCglContext glContext{configuration, _context.get()};
if(!glContext.isCreated() || !glContext.makeCurrent() || !_context->tryCreate()) if(!glContext.isCreated() || !glContext.makeCurrent() || !_context->tryCreate())

15
src/Magnum/Platform/WindowlessCglApplication.h

@ -33,15 +33,15 @@
#include <memory> #include <memory>
#include "Magnum/OpenGL.h" #include "Magnum/Magnum.h"
#include "Magnum/Tags.h" #include "Magnum/Tags.h"
#include "Magnum/GL/OpenGL.h"
#include "Magnum/Platform/Platform.h"
#include <OpenGL/OpenGL.h> #include <OpenGL/OpenGL.h>
#include <OpenGL/CGLTypes.h> #include <OpenGL/CGLTypes.h>
#include <OpenGL/CGLCurrent.h> #include <OpenGL/CGLCurrent.h>
#include "Magnum/Magnum.h"
#include "Magnum/Platform/Platform.h"
namespace Magnum { namespace Platform { namespace Magnum { namespace Platform {
/** /**
@ -72,10 +72,11 @@ class WindowlessCglContext {
* context. * context.
* *
* Once the context is created, make it current using @ref makeCurrent() * Once the context is created, make it current using @ref makeCurrent()
* and create @ref Platform::Context instance to be able to use Magnum. * and create @ref Platform::GLContext instance to be able to use
* Magnum.
* @see @ref isCreated() * @see @ref isCreated()
*/ */
explicit WindowlessCglContext(const Configuration& configuration, Context* context = nullptr); explicit WindowlessCglContext(const Configuration& configuration, GLContext* context = nullptr);
/** /**
* @brief Construct without creating the context * @brief Construct without creating the context
@ -302,7 +303,7 @@ class WindowlessCglApplication {
private: private:
WindowlessCglContext _glContext; WindowlessCglContext _glContext;
std::unique_ptr<Platform::Context> _context; std::unique_ptr<Platform::GLContext> _context;
}; };
/** @hideinitializer /** @hideinitializer

10
src/Magnum/Platform/WindowlessEglApplication.cpp

@ -28,14 +28,14 @@
#include <Corrade/Utility/Assert.h> #include <Corrade/Utility/Assert.h>
#include <Corrade/Utility/Debug.h> #include <Corrade/Utility/Debug.h>
#include "Magnum/Version.h" #include "Magnum/GL/Version.h"
#include "Magnum/Platform/Context.h" #include "Magnum/Platform/GLContext.h"
#include "Implementation/Egl.h" #include "Implementation/Egl.h"
namespace Magnum { namespace Platform { namespace Magnum { namespace Platform {
WindowlessEglContext::WindowlessEglContext(const Configuration& configuration, Context*) { WindowlessEglContext::WindowlessEglContext(const Configuration& configuration, GLContext*) {
/* Initialize */ /* Initialize */
_display = eglGetDisplay(EGL_DEFAULT_DISPLAY); _display = eglGetDisplay(EGL_DEFAULT_DISPLAY);
if(!eglInitialize(_display, nullptr, nullptr)) { if(!eglInitialize(_display, nullptr, nullptr)) {
@ -147,7 +147,7 @@ WindowlessEglApplication::WindowlessEglApplication(const Arguments& arguments, c
createContext(configuration); createContext(configuration);
} }
WindowlessEglApplication::WindowlessEglApplication(const Arguments& arguments, NoCreateT): _glContext{NoCreate}, _context{new Context{NoCreate, arguments.argc, arguments.argv}} {} WindowlessEglApplication::WindowlessEglApplication(const Arguments& arguments, NoCreateT): _glContext{NoCreate}, _context{new GLContext{NoCreate, arguments.argc, arguments.argv}} {}
void WindowlessEglApplication::createContext() { createContext({}); } void WindowlessEglApplication::createContext() { createContext({}); }
@ -156,7 +156,7 @@ void WindowlessEglApplication::createContext(const Configuration& configuration)
} }
bool WindowlessEglApplication::tryCreateContext(const Configuration& configuration) { bool WindowlessEglApplication::tryCreateContext(const Configuration& configuration) {
CORRADE_ASSERT(_context->version() == Version::None, "Platform::WindowlessEglApplication::tryCreateContext(): context already created", false); CORRADE_ASSERT(_context->version() == GL::Version::None, "Platform::WindowlessEglApplication::tryCreateContext(): context already created", false);
WindowlessEglContext glContext{configuration, _context.get()}; WindowlessEglContext glContext{configuration, _context.get()};
if(!glContext.isCreated() || !glContext.makeCurrent() || !_context->tryCreate()) if(!glContext.isCreated() || !glContext.makeCurrent() || !_context->tryCreate())

11
src/Magnum/Platform/WindowlessEglApplication.h

@ -40,7 +40,7 @@
#undef Status #undef Status
#include "Magnum/Magnum.h" #include "Magnum/Magnum.h"
#include "Magnum/OpenGL.h" #include "Magnum/GL/OpenGL.h"
#include "Magnum/Tags.h" #include "Magnum/Tags.h"
#include "Magnum/Platform/Platform.h" #include "Magnum/Platform/Platform.h"
@ -69,10 +69,11 @@ class WindowlessEglContext {
* using @ref NoCreate to manage driver workarounds * using @ref NoCreate to manage driver workarounds
* *
* Once the context is created, make it current using @ref makeCurrent() * Once the context is created, make it current using @ref makeCurrent()
* and create @ref Platform::Context instance to be able to use Magnum. * and create @ref Platform::GLContext instance to be able to use
* Magnum.
* @see @ref isCreated() * @see @ref isCreated()
*/ */
explicit WindowlessEglContext(const Configuration& configuration, Context* context = nullptr); explicit WindowlessEglContext(const Configuration& configuration, GLContext* context = nullptr);
/** /**
* @brief Construct without creating the context * @brief Construct without creating the context
@ -164,7 +165,7 @@ class WindowlessEglContext::Configuration {
* @brief Set context flags * @brief Set context flags
* @return Reference to self (for method chaining) * @return Reference to self (for method chaining)
* *
* Default is no flag. See also @ref Context::flags(). * Default is no flag. See also @ref GL::Context::flags().
* @requires_gles Context flags are not available in WebGL. * @requires_gles Context flags are not available in WebGL.
*/ */
Configuration& setFlags(Flags flags) { Configuration& setFlags(Flags flags) {
@ -431,7 +432,7 @@ class WindowlessEglApplication {
private: private:
WindowlessEglContext _glContext; WindowlessEglContext _glContext;
std::unique_ptr<Platform::Context> _context; std::unique_ptr<Platform::GLContext> _context;
}; };
/** @hideinitializer /** @hideinitializer

10
src/Magnum/Platform/WindowlessGlxApplication.cpp

@ -29,15 +29,15 @@
#include <Corrade/Utility/Assert.h> #include <Corrade/Utility/Assert.h>
#include <Corrade/Utility/Debug.h> #include <Corrade/Utility/Debug.h>
#include "Magnum/Version.h" #include "Magnum/GL/Version.h"
#include "Magnum/Platform/Context.h" #include "Magnum/Platform/GLContext.h"
/* Saner way to define the None Xlib macro (anyway, FUCK YOU XLIB) */ /* Saner way to define the None Xlib macro (anyway, FUCK YOU XLIB) */
namespace { enum { None = 0L }; } namespace { enum { None = 0L }; }
namespace Magnum { namespace Platform { namespace Magnum { namespace Platform {
WindowlessGlxContext::WindowlessGlxContext(const WindowlessGlxContext::Configuration& configuration, Context* const magnumContext) { WindowlessGlxContext::WindowlessGlxContext(const WindowlessGlxContext::Configuration& configuration, GLContext* const magnumContext) {
_display = XOpenDisplay(nullptr); _display = XOpenDisplay(nullptr);
/* Check version */ /* Check version */
@ -188,7 +188,7 @@ WindowlessGlxApplication::WindowlessGlxApplication(const Arguments& arguments, c
createContext(configuration); createContext(configuration);
} }
WindowlessGlxApplication::WindowlessGlxApplication(const Arguments& arguments, NoCreateT): _glContext{NoCreate}, _context{new Context{NoCreate, arguments.argc, arguments.argv}} {} WindowlessGlxApplication::WindowlessGlxApplication(const Arguments& arguments, NoCreateT): _glContext{NoCreate}, _context{new GLContext{NoCreate, arguments.argc, arguments.argv}} {}
void WindowlessGlxApplication::createContext() { createContext({}); } void WindowlessGlxApplication::createContext() { createContext({}); }
@ -197,7 +197,7 @@ void WindowlessGlxApplication::createContext(const Configuration& configuration)
} }
bool WindowlessGlxApplication::tryCreateContext(const Configuration& configuration) { bool WindowlessGlxApplication::tryCreateContext(const Configuration& configuration) {
CORRADE_ASSERT(_context->version() == Version::None, "Platform::WindowlessGlxApplication::tryCreateContext(): context already created", false); CORRADE_ASSERT(_context->version() == GL::Version::None, "Platform::WindowlessGlxApplication::tryCreateContext(): context already created", false);
WindowlessGlxContext glContext{configuration, _context.get()}; WindowlessGlxContext glContext{configuration, _context.get()};
if(!glContext.isCreated() || !glContext.makeCurrent() || !_context->tryCreate()) if(!glContext.isCreated() || !glContext.makeCurrent() || !_context->tryCreate())

23
src/Magnum/Platform/WindowlessGlxApplication.h

@ -32,7 +32,12 @@
#include <memory> #include <memory>
#include <Corrade/Containers/EnumSet.h> #include <Corrade/Containers/EnumSet.h>
#include "Magnum/OpenGL.h" /* Include our GL headers first to avoid conflicts */
#include "Magnum/Magnum.h"
#include "Magnum/Tags.h"
#include "Magnum/GL/OpenGL.h"
#include "Magnum/Platform/Platform.h"
#include <GL/glx.h> #include <GL/glx.h>
#include <X11/Xlib.h> #include <X11/Xlib.h>
#include <X11/Xutil.h> #include <X11/Xutil.h>
@ -42,9 +47,6 @@
#undef None #undef None
#undef Status #undef Status
#include "Magnum/Magnum.h"
#include "Magnum/Tags.h"
#include "Magnum/Platform/Platform.h"
namespace Magnum { namespace Platform { namespace Magnum { namespace Platform {
@ -80,14 +82,15 @@ class WindowlessGlxContext {
* compatibility OpenGL 2.1 context is created instead to make the * compatibility OpenGL 2.1 context is created instead to make the
* driver use the latest available version. * driver use the latest available version.
* *
* Once the context is created, make it current using @ref makeCurrent() * Once the context is created, make it current using
* and create @ref Platform::Context instance to be able to use Magnum. * @ref makeCurrent() and create @ref Platform::GLContext instance to
* be able to use Magnum.
* @see @ref isCreated() * @see @ref isCreated()
*/ */
explicit WindowlessGlxContext(const Configuration& configuration, Context* context = nullptr); explicit WindowlessGlxContext(const Configuration& configuration, GLContext* context = nullptr);
/** /**
* @brief Construct without creating the context * @brief Construct without creating an OpenGL context
* *
* Move a instance with created context over to make it usable. * Move a instance with created context over to make it usable.
*/ */
@ -168,7 +171,7 @@ class WindowlessGlxContext::Configuration {
* @brief Set context flags * @brief Set context flags
* @return Reference to self (for method chaining) * @return Reference to self (for method chaining)
* *
* Default is no flag. See also @ref Context::flags(). * Default is no flag. See also @ref GL::Context::flags().
*/ */
Configuration& setFlags(Flags flags) { Configuration& setFlags(Flags flags) {
_flags = flags; _flags = flags;
@ -351,7 +354,7 @@ class WindowlessGlxApplication {
private: private:
WindowlessGlxContext _glContext; WindowlessGlxContext _glContext;
std::unique_ptr<Platform::Context> _context; std::unique_ptr<Platform::GLContext> _context;
}; };
/** @hideinitializer /** @hideinitializer

7
src/Magnum/Platform/WindowlessIosApplication.h

@ -67,8 +67,9 @@ class WindowlessIosContext {
* @param context Optional Magnum context instance constructed * @param context Optional Magnum context instance constructed
* using @ref NoCreate to manage driver workarounds * using @ref NoCreate to manage driver workarounds
* *
* Once the context is created, make it current using @ref makeCurrent() * Once the context is created, make it current using
* and create @ref Platform::Context instance to be able to use Magnum. * @ref makeCurrent() and create @ref Platform::GLContext instance to
* be able to use Magnum.
* @see @ref isCreated() * @see @ref isCreated()
*/ */
explicit WindowlessIosContext(const Configuration& configuration, Context* context = nullptr); explicit WindowlessIosContext(const Configuration& configuration, Context* context = nullptr);
@ -300,7 +301,7 @@ class WindowlessIosApplication {
private: private:
WindowlessIosContext _glContext; WindowlessIosContext _glContext;
std::unique_ptr<Platform::Context> _context; std::unique_ptr<Platform::GLContext> _context;
}; };
/** @hideinitializer /** @hideinitializer

8
src/Magnum/Platform/WindowlessWglApplication.cpp

@ -29,8 +29,8 @@
#include <Corrade/Utility/Assert.h> #include <Corrade/Utility/Assert.h>
#include <Corrade/Utility/Debug.h> #include <Corrade/Utility/Debug.h>
#include "Magnum/Version.h" #include "Magnum/GL/Version.h"
#include "Magnum/Platform/Context.h" #include "Magnum/Platform/GLContext.h"
#ifndef DOXYGEN_GENERATING_OUTPUT #ifndef DOXYGEN_GENERATING_OUTPUT
/* Define stuff that we need because I can't be bothered with creating a new /* Define stuff that we need because I can't be bothered with creating a new
@ -46,7 +46,7 @@
namespace Magnum { namespace Platform { namespace Magnum { namespace Platform {
WindowlessWglContext::WindowlessWglContext(const Configuration& configuration, Context* const magnumContext) { WindowlessWglContext::WindowlessWglContext(const Configuration& configuration, GLContext* const magnumContext) {
/* Register the window class (if not yet done) */ /* Register the window class (if not yet done) */
WNDCLASSW wc; WNDCLASSW wc;
if(!GetClassInfoW(GetModuleHandleW(nullptr), L"Magnum Windowless Application", &wc)) { if(!GetClassInfoW(GetModuleHandleW(nullptr), L"Magnum Windowless Application", &wc)) {
@ -242,7 +242,7 @@ WindowlessWglApplication::WindowlessWglApplication(const Arguments& arguments, c
createContext(configuration); createContext(configuration);
} }
WindowlessWglApplication::WindowlessWglApplication(const Arguments& arguments, NoCreateT): _glContext{NoCreate}, _context{new Context{NoCreate, arguments.argc, arguments.argv}} {} WindowlessWglApplication::WindowlessWglApplication(const Arguments& arguments, NoCreateT): _glContext{NoCreate}, _context{new GLContext{NoCreate, arguments.argc, arguments.argv}} {}
void WindowlessWglApplication::createContext() { createContext({}); } void WindowlessWglApplication::createContext() { createContext({}); }

13
src/Magnum/Platform/WindowlessWglApplication.h

@ -38,8 +38,8 @@
#include <Corrade/Containers/EnumSet.h> #include <Corrade/Containers/EnumSet.h>
#include "Magnum/Magnum.h" #include "Magnum/Magnum.h"
#include "Magnum/OpenGL.h"
#include "Magnum/Tags.h" #include "Magnum/Tags.h"
#include "Magnum/GL/OpenGL.h"
#include "Magnum/Platform/Platform.h" #include "Magnum/Platform/Platform.h"
#ifndef DOXYGEN_GENERATING_OUTPUT #ifndef DOXYGEN_GENERATING_OUTPUT
@ -81,11 +81,12 @@ class WindowlessWglContext {
* compatibility OpenGL 2.1 context is created instead to make the * compatibility OpenGL 2.1 context is created instead to make the
* driver use the latest available version. * driver use the latest available version.
* *
* Once the context is created, make it current using @ref makeCurrent() * Once the context is created, make it current using
* and create @ref Platform::Context instance to be able to use Magnum. * @ref makeCurrent() and create @ref Platform::GLContext instance to
* be able to use Magnum.
* @see @ref isCreated() * @see @ref isCreated()
*/ */
explicit WindowlessWglContext(const Configuration& configuration, Context* context = nullptr); explicit WindowlessWglContext(const Configuration& configuration, GLContext* context = nullptr);
/** /**
* @brief Construct without creating the context * @brief Construct without creating the context
@ -169,7 +170,7 @@ class WindowlessWglContext::Configuration {
* @brief Set context flags * @brief Set context flags
* @return Reference to self (for method chaining) * @return Reference to self (for method chaining)
* *
* Default is no flag. See also @ref Context::flags(). * Default is no flag. See also @ref GL::Context::flags().
*/ */
Configuration& setFlags(Flags flags) { Configuration& setFlags(Flags flags) {
_flags = flags; _flags = flags;
@ -350,7 +351,7 @@ class WindowlessWglApplication {
private: private:
WindowlessWglContext _glContext; WindowlessWglContext _glContext;
std::unique_ptr<Platform::Context> _context; std::unique_ptr<Platform::GLContext> _context;
}; };
/** @hideinitializer /** @hideinitializer

6
src/Magnum/Platform/WindowlessWindowsEglApplication.cpp

@ -28,14 +28,14 @@
#include <Corrade/Utility/Assert.h> #include <Corrade/Utility/Assert.h>
#include <Corrade/Utility/Debug.h> #include <Corrade/Utility/Debug.h>
#include "Magnum/Version.h" #include "Magnum/GL/Version.h"
#include "Magnum/Platform/Context.h" #include "Magnum/Platform/Context.h"
#include "Implementation/Egl.h" #include "Implementation/Egl.h"
namespace Magnum { namespace Platform { namespace Magnum { namespace Platform {
WindowlessWindowsEglContext::WindowlessWindowsEglContext(const Configuration& configuration, Context*) { WindowlessWindowsEglContext::WindowlessWindowsEglContext(const Configuration& configuration, GLContext*) {
/* Register the window class (if not yet done) */ /* Register the window class (if not yet done) */
WNDCLASSW wc; WNDCLASSW wc;
if(!GetClassInfoW(GetModuleHandleW(nullptr), L"Magnum Windowless Application", &wc)) { if(!GetClassInfoW(GetModuleHandleW(nullptr), L"Magnum Windowless Application", &wc)) {
@ -173,7 +173,7 @@ WindowlessWindowsEglApplication::WindowlessWindowsEglApplication(const Arguments
createContext(configuration); createContext(configuration);
} }
WindowlessWindowsEglApplication::WindowlessWindowsEglApplication(const Arguments& arguments, NoCreateT): _glContext{NoCreate}, _context{new Context{NoCreate, arguments.argc, arguments.argv}} {} WindowlessWindowsEglApplication::WindowlessWindowsEglApplication(const Arguments& arguments, NoCreateT): _glContext{NoCreate}, _context{new GLContext{NoCreate, arguments.argc, arguments.argv}} {}
void WindowlessWindowsEglApplication::createContext() { createContext({}); } void WindowlessWindowsEglApplication::createContext() { createContext({}); }

13
src/Magnum/Platform/WindowlessWindowsEglApplication.h

@ -40,8 +40,8 @@
#include <Corrade/Containers/EnumSet.h> #include <Corrade/Containers/EnumSet.h>
#include "Magnum/Magnum.h" #include "Magnum/Magnum.h"
#include "Magnum/OpenGL.h"
#include "Magnum/Tags.h" #include "Magnum/Tags.h"
#include "Magnum/GL/OpenGL.h"
#include "Magnum/Platform/Platform.h" #include "Magnum/Platform/Platform.h"
namespace Magnum { namespace Platform { namespace Magnum { namespace Platform {
@ -67,11 +67,12 @@ class WindowlessWindowsEglContext {
* @param context Optional Magnum context instance constructed * @param context Optional Magnum context instance constructed
* using @ref NoCreate to manage driver workarounds * using @ref NoCreate to manage driver workarounds
* *
* Once the context is created, make it current using @ref makeCurrent() * Once the context is created, make it current using
* and create @ref Platform::Context instance to be able to use Magnum. * @ref makeCurrent() and create @ref Platform::GLContext instance to
* be able to use Magnum.
* @see @ref isCreated() * @see @ref isCreated()
*/ */
explicit WindowlessWindowsEglContext(const Configuration& configuration, Context* context = nullptr); explicit WindowlessWindowsEglContext(const Configuration& configuration, GLContext* context = nullptr);
/** /**
* @brief Construct without creating the context * @brief Construct without creating the context
@ -156,7 +157,7 @@ class WindowlessWindowsEglContext::Configuration {
* @brief Set context flags * @brief Set context flags
* @return Reference to self (for method chaining) * @return Reference to self (for method chaining)
* *
* Default is no flag. See also @ref Context::flags(). * Default is no flag. See also @ref GL::Context::flags().
*/ */
Configuration& setFlags(Flags flags) { Configuration& setFlags(Flags flags) {
_flags = flags; _flags = flags;
@ -338,7 +339,7 @@ class WindowlessWindowsEglApplication {
private: private:
WindowlessWindowsEglContext _glContext; WindowlessWindowsEglContext _glContext;
std::unique_ptr<Platform::Context> _context; std::unique_ptr<Platform::GLContext> _context;
}; };
/** @hideinitializer /** @hideinitializer

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

@ -26,34 +26,34 @@
#include <Corrade/Utility/Arguments.h> #include <Corrade/Utility/Arguments.h>
#include <Corrade/Utility/Debug.h> #include <Corrade/Utility/Debug.h>
#include "Magnum/AbstractShaderProgram.h" #include "Magnum/GL/AbstractShaderProgram.h"
#include "Magnum/Buffer.h" #include "Magnum/GL/Buffer.h"
#if !defined(MAGNUM_TARGET_GLES2) && !defined(MAGNUM_TARGET_WEBGL) #if !defined(MAGNUM_TARGET_GLES2) && !defined(MAGNUM_TARGET_WEBGL)
#include "Magnum/BufferTexture.h" #include "Magnum/GL/BufferTexture.h"
#endif #endif
#include "Magnum/Context.h" #include "Magnum/GL/Context.h"
#include "Magnum/CubeMapTexture.h" #include "Magnum/GL/CubeMapTexture.h"
#if !defined(MAGNUM_TARGET_GLES2) && !defined(MAGNUM_TARGET_WEBGL) #if !defined(MAGNUM_TARGET_GLES2) && !defined(MAGNUM_TARGET_WEBGL)
#include "Magnum/CubeMapTextureArray.h" #include "Magnum/GL/CubeMapTextureArray.h"
#endif #endif
#ifndef MAGNUM_TARGET_WEBGL #ifndef MAGNUM_TARGET_WEBGL
#include "Magnum/DebugOutput.h" #include "Magnum/GL/DebugOutput.h"
#endif #endif
#include "Magnum/Extensions.h" #include "Magnum/GL/Extensions.h"
#include "Magnum/Framebuffer.h" #include "Magnum/GL/Framebuffer.h"
#include "Magnum/Mesh.h" #include "Magnum/GL/Mesh.h"
#if !defined(MAGNUM_TARGET_GLES2) && !defined(MAGNUM_TARGET_WEBGL) #if !defined(MAGNUM_TARGET_GLES2) && !defined(MAGNUM_TARGET_WEBGL)
#include "Magnum/MultisampleTexture.h" #include "Magnum/GL/MultisampleTexture.h"
#endif #endif
#ifndef MAGNUM_TARGET_GLES #ifndef MAGNUM_TARGET_GLES
#include "Magnum/RectangleTexture.h" #include "Magnum/GL/RectangleTexture.h"
#endif #endif
#include "Magnum/Renderbuffer.h" #include "Magnum/GL/Renderbuffer.h"
#include "Magnum/Shader.h" #include "Magnum/GL/Shader.h"
#include "Magnum/Texture.h" #include "Magnum/GL/Texture.h"
#ifndef MAGNUM_TARGET_GLES2 #ifndef MAGNUM_TARGET_GLES2
#include "Magnum/TextureArray.h" #include "Magnum/GL/TextureArray.h"
#include "Magnum/TransformFeedback.h" #include "Magnum/GL/TransformFeedback.h"
#endif #endif
#if defined(MAGNUM_TARGET_HEADLESS) || defined(CORRADE_TARGET_EMSCRIPTEN) || defined(CORRADE_TARGET_ANDROID) #if defined(MAGNUM_TARGET_HEADLESS) || defined(CORRADE_TARGET_EMSCRIPTEN) || defined(CORRADE_TARGET_ANDROID)
@ -100,7 +100,8 @@ Arguments:
- `-s`, `--short` --- display just essential info and exit - `-s`, `--short` --- display just essential info and exit
- `--all-extensions` --- display extensions also for fully supported versions - `--all-extensions` --- display extensions also for fully supported versions
- `--limits` --- display also limits and implementation-defined values - `--limits` --- display also limits and implementation-defined values
- `--magnum-...` --- engine-specific options (see @ref Context for details) - `--magnum-...` --- engine-specific options (see
@ref GL-Context-command-line for details)
@subsection magnum-gl-info-usage-emscripten Usage on Emscripten @subsection magnum-gl-info-usage-emscripten Usage on Emscripten
@ -281,7 +282,7 @@ MagnumInfo::MagnumInfo(const Arguments& arguments): Platform::WindowlessApplicat
/* Create context here, so the context creation info is displayed at proper /* Create context here, so the context creation info is displayed at proper
place */ place */
createContext(); createContext();
Context& c = Context::current(); GL::Context& c = GL::Context::current();
#ifndef MAGNUM_TARGET_GLES #ifndef MAGNUM_TARGET_GLES
Debug() << "Core profile:" << (c.isCoreProfile() ? "yes" : "no"); Debug() << "Core profile:" << (c.isCoreProfile() ? "yes" : "no");
@ -307,41 +308,41 @@ MagnumInfo::MagnumInfo(const Arguments& arguments): Platform::WindowlessApplicat
Debug() << ""; Debug() << "";
/* Get first future (not supported) version */ /* Get first future (not supported) version */
std::vector<Version> versions{ std::vector<GL::Version> versions{
#ifndef MAGNUM_TARGET_GLES #ifndef MAGNUM_TARGET_GLES
Version::GL300, GL::Version::GL300,
Version::GL310, GL::Version::GL310,
Version::GL320, GL::Version::GL320,
Version::GL330, GL::Version::GL330,
Version::GL400, GL::Version::GL400,
Version::GL410, GL::Version::GL410,
Version::GL420, GL::Version::GL420,
Version::GL430, GL::Version::GL430,
Version::GL440, GL::Version::GL440,
Version::GL450, GL::Version::GL450,
Version::GL460, GL::Version::GL460,
#else #else
Version::GLES300, GL::Version::GLES300,
#ifndef MAGNUM_TARGET_WEBGL #ifndef MAGNUM_TARGET_WEBGL
Version::GLES310, GL::Version::GLES310,
Version::GLES320, GL::Version::GLES320,
#endif #endif
#endif #endif
Version::None GL::Version::None
}; };
std::size_t future = 0; std::size_t future = 0;
if(!args.isSet("all-extensions")) if(!args.isSet("all-extensions"))
while(versions[future] != Version::None && c.isVersionSupported(versions[future])) while(versions[future] != GL::Version::None && c.isVersionSupported(versions[future]))
++future; ++future;
/* Display supported OpenGL extensions from unsupported versions */ /* Display supported OpenGL extensions from unsupported versions */
for(std::size_t i = future; i != versions.size(); ++i) { for(std::size_t i = future; i != versions.size(); ++i) {
if(versions[i] != Version::None) if(versions[i] != GL::Version::None)
Debug() << versions[i] << "extension support:"; Debug() << versions[i] << "extension support:";
else Debug() << "Vendor extension support:"; else Debug() << "Vendor extension support:";
for(const auto& extension: Extension::extensions(versions[i])) { for(const auto& extension: GL::Extension::extensions(versions[i])) {
std::string extensionName = extension.string(); std::string extensionName = extension.string();
Debug d; Debug d;
d << " " << extensionName << std::string(60-extensionName.size(), ' '); d << " " << extensionName << std::string(60-extensionName.size(), ' ');
@ -361,239 +362,239 @@ MagnumInfo::MagnumInfo(const Arguments& arguments): Platform::WindowlessApplicat
if(!args.isSet("limits")) return; if(!args.isSet("limits")) return;
/* Limits and implementation-defined values */ /* Limits and implementation-defined values */
#define _h(val) Debug() << "\n " << Extensions::GL::val::string() + std::string(":"); #define _h(val) Debug() << "\n " << GL::Extensions::val::string() + std::string(":");
#define _l(val) Debug() << " " << #val << (sizeof(#val) > 64 ? "\n" + std::string(68, ' ') : std::string(64 - sizeof(#val), ' ')) << val; #define _l(val) Debug() << " " << #val << (sizeof(#val) > 64 ? "\n" + std::string(68, ' ') : std::string(64 - sizeof(#val), ' ')) << val;
#define _lvec(val) Debug() << " " << #val << (sizeof(#val) > 42 ? "\n" + std::string(46, ' ') : std::string(42 - sizeof(#val), ' ')) << val; #define _lvec(val) Debug() << " " << #val << (sizeof(#val) > 42 ? "\n" + std::string(46, ' ') : std::string(42 - sizeof(#val), ' ')) << val;
Debug() << "Limits and implementation-defined values:"; Debug() << "Limits and implementation-defined values:";
_lvec(AbstractFramebuffer::maxViewportSize()) _lvec(GL::AbstractFramebuffer::maxViewportSize())
_l(AbstractFramebuffer::maxDrawBuffers()) _l(GL::AbstractFramebuffer::maxDrawBuffers())
_l(Framebuffer::maxColorAttachments()) _l(GL::Framebuffer::maxColorAttachments())
#ifndef MAGNUM_TARGET_GLES2 #ifndef MAGNUM_TARGET_GLES2
_l(Mesh::maxElementIndex()) _l(GL::Mesh::maxElementIndex())
_l(Mesh::maxElementsIndices()) _l(GL::Mesh::maxElementsIndices())
_l(Mesh::maxElementsVertices()) _l(GL::Mesh::maxElementsVertices())
#endif #endif
_l(Renderbuffer::maxSize()) _l(GL::Renderbuffer::maxSize())
#if !(defined(MAGNUM_TARGET_WEBGL) && defined(MAGNUM_TARGET_GLES2)) #if !(defined(MAGNUM_TARGET_WEBGL) && defined(MAGNUM_TARGET_GLES2))
_l(Renderbuffer::maxSamples()) _l(GL::Renderbuffer::maxSamples())
#endif #endif
_l(Shader::maxVertexOutputComponents()) _l(GL::Shader::maxVertexOutputComponents())
_l(Shader::maxFragmentInputComponents()) _l(GL::Shader::maxFragmentInputComponents())
_l(Shader::maxTextureImageUnits(Shader::Type::Vertex)) _l(GL::Shader::maxTextureImageUnits(GL::Shader::Type::Vertex))
#if !defined(MAGNUM_TARGET_GLES2) && !defined(MAGNUM_TARGET_WEBGL) #if !defined(MAGNUM_TARGET_GLES2) && !defined(MAGNUM_TARGET_WEBGL)
_l(Shader::maxTextureImageUnits(Shader::Type::TessellationControl)) _l(GL::Shader::maxTextureImageUnits(GL::Shader::Type::TessellationControl))
_l(Shader::maxTextureImageUnits(Shader::Type::TessellationEvaluation)) _l(GL::Shader::maxTextureImageUnits(GL::Shader::Type::TessellationEvaluation))
_l(Shader::maxTextureImageUnits(Shader::Type::Geometry)) _l(GL::Shader::maxTextureImageUnits(GL::Shader::Type::Geometry))
_l(Shader::maxTextureImageUnits(Shader::Type::Compute)) _l(GL::Shader::maxTextureImageUnits(GL::Shader::Type::Compute))
#endif #endif
_l(Shader::maxTextureImageUnits(Shader::Type::Fragment)) _l(GL::Shader::maxTextureImageUnits(GL::Shader::Type::Fragment))
_l(Shader::maxCombinedTextureImageUnits()) _l(GL::Shader::maxCombinedTextureImageUnits())
_l(Shader::maxUniformComponents(Shader::Type::Vertex)) _l(GL::Shader::maxUniformComponents(GL::Shader::Type::Vertex))
#if !defined(MAGNUM_TARGET_GLES2) && !defined(MAGNUM_TARGET_WEBGL) #if !defined(MAGNUM_TARGET_GLES2) && !defined(MAGNUM_TARGET_WEBGL)
_l(Shader::maxUniformComponents(Shader::Type::TessellationControl)) _l(GL::Shader::maxUniformComponents(GL::Shader::Type::TessellationControl))
_l(Shader::maxUniformComponents(Shader::Type::TessellationEvaluation)) _l(GL::Shader::maxUniformComponents(GL::Shader::Type::TessellationEvaluation))
_l(Shader::maxUniformComponents(Shader::Type::Geometry)) _l(GL::Shader::maxUniformComponents(GL::Shader::Type::Geometry))
_l(Shader::maxUniformComponents(Shader::Type::Compute)) _l(GL::Shader::maxUniformComponents(GL::Shader::Type::Compute))
#endif #endif
_l(Shader::maxUniformComponents(Shader::Type::Fragment)) _l(GL::Shader::maxUniformComponents(GL::Shader::Type::Fragment))
_l(AbstractShaderProgram::maxVertexAttributes()) _l(GL::AbstractShaderProgram::maxVertexAttributes())
#ifndef MAGNUM_TARGET_GLES2 #ifndef MAGNUM_TARGET_GLES2
_l(AbstractTexture::maxLodBias()) _l(GL::AbstractTexture::maxLodBias())
#endif #endif
#ifndef MAGNUM_TARGET_GLES #ifndef MAGNUM_TARGET_GLES
_lvec(Texture1D::maxSize()) _lvec(GL::Texture1D::maxSize())
#endif #endif
_lvec(Texture2D::maxSize()) _lvec(GL::Texture2D::maxSize())
#ifndef MAGNUM_TARGET_GLES2 #ifndef MAGNUM_TARGET_GLES2
_lvec(Texture3D::maxSize()) /* Checked ES2 version below */ _lvec(GL::Texture3D::maxSize()) /* Checked ES2 version below */
#endif #endif
_lvec(CubeMapTexture::maxSize()) _lvec(GL::CubeMapTexture::maxSize())
#ifndef MAGNUM_TARGET_GLES #ifndef MAGNUM_TARGET_GLES
if(c.isExtensionSupported<Extensions::GL::ARB::blend_func_extended>()) { if(c.isExtensionSupported<GL::Extensions::ARB::blend_func_extended>()) {
_h(ARB::blend_func_extended) _h(ARB::blend_func_extended)
_l(AbstractFramebuffer::maxDualSourceDrawBuffers()) _l(GL::AbstractFramebuffer::maxDualSourceDrawBuffers())
} }
#endif #endif
#if !defined(MAGNUM_TARGET_GLES2) && !defined(MAGNUM_TARGET_WEBGL) #if !defined(MAGNUM_TARGET_GLES2) && !defined(MAGNUM_TARGET_WEBGL)
#ifndef MAGNUM_TARGET_GLES #ifndef MAGNUM_TARGET_GLES
if(c.isExtensionSupported<Extensions::GL::ARB::compute_shader>()) if(c.isExtensionSupported<GL::Extensions::ARB::compute_shader>())
#endif #endif
{ {
#ifndef MAGNUM_TARGET_GLES #ifndef MAGNUM_TARGET_GLES
_h(ARB::compute_shader) _h(ARB::compute_shader)
#endif #endif
_l(AbstractShaderProgram::maxComputeSharedMemorySize()) _l(GL::AbstractShaderProgram::maxComputeSharedMemorySize())
_l(AbstractShaderProgram::maxComputeWorkGroupInvocations()) _l(GL::AbstractShaderProgram::maxComputeWorkGroupInvocations())
_lvec(AbstractShaderProgram::maxComputeWorkGroupCount()) _lvec(GL::AbstractShaderProgram::maxComputeWorkGroupCount())
_lvec(AbstractShaderProgram::maxComputeWorkGroupSize()) _lvec(GL::AbstractShaderProgram::maxComputeWorkGroupSize())
} }
#ifndef MAGNUM_TARGET_GLES #ifndef MAGNUM_TARGET_GLES
if(c.isExtensionSupported<Extensions::GL::ARB::explicit_uniform_location>()) if(c.isExtensionSupported<GL::Extensions::ARB::explicit_uniform_location>())
#endif #endif
{ {
#ifndef MAGNUM_TARGET_GLES #ifndef MAGNUM_TARGET_GLES
_h(ARB::explicit_uniform_location) _h(ARB::explicit_uniform_location)
#endif #endif
_l(AbstractShaderProgram::maxUniformLocations()) _l(GL::AbstractShaderProgram::maxUniformLocations())
} }
#endif #endif
#ifndef MAGNUM_TARGET_GLES #ifndef MAGNUM_TARGET_GLES
if(c.isExtensionSupported<Extensions::GL::ARB::map_buffer_alignment>()) { if(c.isExtensionSupported<GL::Extensions::ARB::map_buffer_alignment>()) {
_h(ARB::map_buffer_alignment) _h(ARB::map_buffer_alignment)
_l(Buffer::minMapAlignment()) _l(GL::Buffer::minMapAlignment())
} }
#endif #endif
#if !defined(MAGNUM_TARGET_GLES2) && !defined(MAGNUM_TARGET_WEBGL) #if !defined(MAGNUM_TARGET_GLES2) && !defined(MAGNUM_TARGET_WEBGL)
#ifndef MAGNUM_TARGET_GLES #ifndef MAGNUM_TARGET_GLES
if(c.isExtensionSupported<Extensions::GL::ARB::shader_atomic_counters>()) if(c.isExtensionSupported<GL::Extensions::ARB::shader_atomic_counters>())
#endif #endif
{ {
#ifndef MAGNUM_TARGET_GLES #ifndef MAGNUM_TARGET_GLES
_h(ARB::shader_atomic_counters) _h(ARB::shader_atomic_counters)
#endif #endif
_l(Buffer::maxAtomicCounterBindings()) _l(GL::Buffer::maxAtomicCounterBindings())
_l(Shader::maxAtomicCounterBuffers(Shader::Type::Vertex)) _l(GL::Shader::maxAtomicCounterBuffers(GL::Shader::Type::Vertex))
_l(Shader::maxAtomicCounterBuffers(Shader::Type::TessellationControl)) _l(GL::Shader::maxAtomicCounterBuffers(GL::Shader::Type::TessellationControl))
_l(Shader::maxAtomicCounterBuffers(Shader::Type::TessellationEvaluation)) _l(GL::Shader::maxAtomicCounterBuffers(GL::Shader::Type::TessellationEvaluation))
_l(Shader::maxAtomicCounterBuffers(Shader::Type::Geometry)) _l(GL::Shader::maxAtomicCounterBuffers(GL::Shader::Type::Geometry))
_l(Shader::maxAtomicCounterBuffers(Shader::Type::Compute)) _l(GL::Shader::maxAtomicCounterBuffers(GL::Shader::Type::Compute))
_l(Shader::maxAtomicCounterBuffers(Shader::Type::Fragment)) _l(GL::Shader::maxAtomicCounterBuffers(GL::Shader::Type::Fragment))
_l(Shader::maxCombinedAtomicCounterBuffers()) _l(GL::Shader::maxCombinedAtomicCounterBuffers())
_l(Shader::maxAtomicCounters(Shader::Type::Vertex)) _l(GL::Shader::maxAtomicCounters(GL::Shader::Type::Vertex))
_l(Shader::maxAtomicCounters(Shader::Type::TessellationControl)) _l(GL::Shader::maxAtomicCounters(GL::Shader::Type::TessellationControl))
_l(Shader::maxAtomicCounters(Shader::Type::TessellationEvaluation)) _l(GL::Shader::maxAtomicCounters(GL::Shader::Type::TessellationEvaluation))
_l(Shader::maxAtomicCounters(Shader::Type::Geometry)) _l(GL::Shader::maxAtomicCounters(GL::Shader::Type::Geometry))
_l(Shader::maxAtomicCounters(Shader::Type::Compute)) _l(GL::Shader::maxAtomicCounters(GL::Shader::Type::Compute))
_l(Shader::maxAtomicCounters(Shader::Type::Fragment)) _l(GL::Shader::maxAtomicCounters(GL::Shader::Type::Fragment))
_l(Shader::maxCombinedAtomicCounters()) _l(GL::Shader::maxCombinedAtomicCounters())
_l(AbstractShaderProgram::maxAtomicCounterBufferSize()) _l(GL::AbstractShaderProgram::maxAtomicCounterBufferSize())
} }
#ifndef MAGNUM_TARGET_GLES #ifndef MAGNUM_TARGET_GLES
if(c.isExtensionSupported<Extensions::GL::ARB::shader_image_load_store>()) if(c.isExtensionSupported<GL::Extensions::ARB::shader_image_load_store>())
#endif #endif
{ {
#ifndef MAGNUM_TARGET_GLES #ifndef MAGNUM_TARGET_GLES
_h(ARB::shader_image_load_store) _h(ARB::shader_image_load_store)
#endif #endif
_l(Shader::maxImageUniforms(Shader::Type::Vertex)) _l(GL::Shader::maxImageUniforms(GL::Shader::Type::Vertex))
_l(Shader::maxImageUniforms(Shader::Type::TessellationControl)) _l(GL::Shader::maxImageUniforms(GL::Shader::Type::TessellationControl))
_l(Shader::maxImageUniforms(Shader::Type::TessellationEvaluation)) _l(GL::Shader::maxImageUniforms(GL::Shader::Type::TessellationEvaluation))
_l(Shader::maxImageUniforms(Shader::Type::Geometry)) _l(GL::Shader::maxImageUniforms(GL::Shader::Type::Geometry))
_l(Shader::maxImageUniforms(Shader::Type::Compute)) _l(GL::Shader::maxImageUniforms(GL::Shader::Type::Compute))
_l(Shader::maxImageUniforms(Shader::Type::Fragment)) _l(GL::Shader::maxImageUniforms(GL::Shader::Type::Fragment))
_l(Shader::maxCombinedImageUniforms()) _l(GL::Shader::maxCombinedImageUniforms())
_l(AbstractShaderProgram::maxCombinedShaderOutputResources()) _l(GL::AbstractShaderProgram::maxCombinedShaderOutputResources())
_l(AbstractShaderProgram::maxImageUnits()) _l(GL::AbstractShaderProgram::maxImageUnits())
#ifndef MAGNUM_TARGET_GLES #ifndef MAGNUM_TARGET_GLES
_l(AbstractShaderProgram::maxImageSamples()) _l(GL::AbstractShaderProgram::maxImageSamples())
#endif #endif
} }
#ifndef MAGNUM_TARGET_GLES #ifndef MAGNUM_TARGET_GLES
if(c.isExtensionSupported<Extensions::GL::ARB::shader_storage_buffer_object>()) if(c.isExtensionSupported<GL::Extensions::ARB::shader_storage_buffer_object>())
#endif #endif
{ {
#ifndef MAGNUM_TARGET_GLES #ifndef MAGNUM_TARGET_GLES
_h(ARB::shader_storage_buffer_object) _h(ARB::shader_storage_buffer_object)
#endif #endif
_l(Buffer::shaderStorageOffsetAlignment()) _l(GL::Buffer::shaderStorageOffsetAlignment())
_l(Buffer::maxShaderStorageBindings()) _l(GL::Buffer::maxShaderStorageBindings())
_l(Shader::maxShaderStorageBlocks(Shader::Type::Vertex)) _l(GL::Shader::maxShaderStorageBlocks(GL::Shader::Type::Vertex))
_l(Shader::maxShaderStorageBlocks(Shader::Type::TessellationControl)) _l(GL::Shader::maxShaderStorageBlocks(GL::Shader::Type::TessellationControl))
_l(Shader::maxShaderStorageBlocks(Shader::Type::TessellationEvaluation)) _l(GL::Shader::maxShaderStorageBlocks(GL::Shader::Type::TessellationEvaluation))
_l(Shader::maxShaderStorageBlocks(Shader::Type::Geometry)) _l(GL::Shader::maxShaderStorageBlocks(GL::Shader::Type::Geometry))
_l(Shader::maxShaderStorageBlocks(Shader::Type::Compute)) _l(GL::Shader::maxShaderStorageBlocks(GL::Shader::Type::Compute))
_l(Shader::maxShaderStorageBlocks(Shader::Type::Fragment)) _l(GL::Shader::maxShaderStorageBlocks(GL::Shader::Type::Fragment))
_l(Shader::maxCombinedShaderStorageBlocks()) _l(GL::Shader::maxCombinedShaderStorageBlocks())
/* AbstractShaderProgram::maxCombinedShaderOutputResources() already in shader_image_load_store */ /* AbstractShaderProgram::maxCombinedShaderOutputResources() already in shader_image_load_store */
_l(AbstractShaderProgram::maxShaderStorageBlockSize()) _l(GL::AbstractShaderProgram::maxShaderStorageBlockSize())
} }
#endif #endif
#if !defined(MAGNUM_TARGET_GLES2) && !defined(MAGNUM_TARGET_WEBGL) #if !defined(MAGNUM_TARGET_GLES2) && !defined(MAGNUM_TARGET_WEBGL)
#ifndef MAGNUM_TARGET_GLES #ifndef MAGNUM_TARGET_GLES
if(c.isExtensionSupported<Extensions::GL::ARB::texture_multisample>()) if(c.isExtensionSupported<GL::Extensions::ARB::texture_multisample>())
#endif #endif
{ {
#ifndef MAGNUM_TARGET_GLES #ifndef MAGNUM_TARGET_GLES
_h(ARB::texture_multisample) _h(ARB::texture_multisample)
#endif #endif
_l(AbstractTexture::maxColorSamples()) _l(GL::AbstractTexture::maxColorSamples())
_l(AbstractTexture::maxDepthSamples()) _l(GL::AbstractTexture::maxDepthSamples())
_l(AbstractTexture::maxIntegerSamples()) _l(GL::AbstractTexture::maxIntegerSamples())
_lvec(MultisampleTexture2D::maxSize()) _lvec(GL::MultisampleTexture2D::maxSize())
_lvec(MultisampleTexture2DArray::maxSize()) _lvec(GL::MultisampleTexture2DArray::maxSize())
} }
#endif #endif
#ifndef MAGNUM_TARGET_GLES #ifndef MAGNUM_TARGET_GLES
if(c.isExtensionSupported<Extensions::GL::ARB::texture_rectangle>()) { if(c.isExtensionSupported<GL::Extensions::ARB::texture_rectangle>()) {
_h(ARB::texture_rectangle) _h(ARB::texture_rectangle)
_lvec(RectangleTexture::maxSize()) _lvec(GL::RectangleTexture::maxSize())
} }
#endif #endif
#ifndef MAGNUM_TARGET_GLES2 #ifndef MAGNUM_TARGET_GLES2
#ifndef MAGNUM_TARGET_GLES #ifndef MAGNUM_TARGET_GLES
if(c.isExtensionSupported<Extensions::GL::ARB::uniform_buffer_object>()) if(c.isExtensionSupported<GL::Extensions::ARB::uniform_buffer_object>())
#endif #endif
{ {
#ifndef MAGNUM_TARGET_GLES #ifndef MAGNUM_TARGET_GLES
_h(ARB::uniform_buffer_object) _h(ARB::uniform_buffer_object)
#endif #endif
_l(Buffer::uniformOffsetAlignment()) _l(GL::Buffer::uniformOffsetAlignment())
_l(Buffer::maxUniformBindings()) _l(GL::Buffer::maxUniformBindings())
_l(Shader::maxUniformBlocks(Shader::Type::Vertex)) _l(GL::Shader::maxUniformBlocks(GL::Shader::Type::Vertex))
#ifndef MAGNUM_TARGET_WEBGL #ifndef MAGNUM_TARGET_WEBGL
_l(Shader::maxUniformBlocks(Shader::Type::TessellationControl)) _l(GL::Shader::maxUniformBlocks(GL::Shader::Type::TessellationControl))
_l(Shader::maxUniformBlocks(Shader::Type::TessellationEvaluation)) _l(GL::Shader::maxUniformBlocks(GL::Shader::Type::TessellationEvaluation))
_l(Shader::maxUniformBlocks(Shader::Type::Geometry)) _l(GL::Shader::maxUniformBlocks(GL::Shader::Type::Geometry))
_l(Shader::maxUniformBlocks(Shader::Type::Compute)) _l(GL::Shader::maxUniformBlocks(GL::Shader::Type::Compute))
#endif #endif
_l(Shader::maxUniformBlocks(Shader::Type::Fragment)) _l(GL::Shader::maxUniformBlocks(GL::Shader::Type::Fragment))
_l(Shader::maxCombinedUniformBlocks()) _l(GL::Shader::maxCombinedUniformBlocks())
_l(Shader::maxCombinedUniformComponents(Shader::Type::Vertex)) _l(GL::Shader::maxCombinedUniformComponents(GL::Shader::Type::Vertex))
#ifndef MAGNUM_TARGET_WEBGL #ifndef MAGNUM_TARGET_WEBGL
_l(Shader::maxCombinedUniformComponents(Shader::Type::TessellationControl)) _l(GL::Shader::maxCombinedUniformComponents(GL::Shader::Type::TessellationControl))
_l(Shader::maxCombinedUniformComponents(Shader::Type::TessellationEvaluation)) _l(GL::Shader::maxCombinedUniformComponents(GL::Shader::Type::TessellationEvaluation))
_l(Shader::maxCombinedUniformComponents(Shader::Type::Geometry)) _l(GL::Shader::maxCombinedUniformComponents(GL::Shader::Type::Geometry))
_l(Shader::maxCombinedUniformComponents(Shader::Type::Compute)) _l(GL::Shader::maxCombinedUniformComponents(GL::Shader::Type::Compute))
#endif #endif
_l(Shader::maxCombinedUniformComponents(Shader::Type::Fragment)) _l(GL::Shader::maxCombinedUniformComponents(GL::Shader::Type::Fragment))
_l(AbstractShaderProgram::maxUniformBlockSize()) _l(GL::AbstractShaderProgram::maxUniformBlockSize())
} }
#ifndef MAGNUM_TARGET_GLES #ifndef MAGNUM_TARGET_GLES
if(c.isExtensionSupported<Extensions::GL::EXT::gpu_shader4>()) if(c.isExtensionSupported<GL::Extensions::EXT::gpu_shader4>())
#endif #endif
{ {
#ifndef MAGNUM_TARGET_GLES #ifndef MAGNUM_TARGET_GLES
_h(EXT::gpu_shader4) _h(EXT::gpu_shader4)
#endif #endif
_l(AbstractShaderProgram::minTexelOffset()) _l(GL::AbstractShaderProgram::minTexelOffset())
_l(AbstractShaderProgram::maxTexelOffset()) _l(GL::AbstractShaderProgram::maxTexelOffset())
} }
#ifndef MAGNUM_TARGET_GLES #ifndef MAGNUM_TARGET_GLES
if(c.isExtensionSupported<Extensions::GL::EXT::texture_array>()) if(c.isExtensionSupported<GL::Extensions::EXT::texture_array>())
#endif #endif
{ {
#ifndef MAGNUM_TARGET_GLES #ifndef MAGNUM_TARGET_GLES
@ -601,41 +602,41 @@ MagnumInfo::MagnumInfo(const Arguments& arguments): Platform::WindowlessApplicat
#endif #endif
#ifndef MAGNUM_TARGET_GLES #ifndef MAGNUM_TARGET_GLES
_lvec(Texture1DArray::maxSize()) _lvec(GL::Texture1DArray::maxSize())
#endif #endif
_lvec(Texture2DArray::maxSize()) _lvec(GL::Texture2DArray::maxSize())
} }
#endif #endif
#ifndef MAGNUM_TARGET_GLES2 #ifndef MAGNUM_TARGET_GLES2
#ifndef MAGNUM_TARGET_GLES #ifndef MAGNUM_TARGET_GLES
if(c.isExtensionSupported<Extensions::GL::EXT::transform_feedback>()) if(c.isExtensionSupported<GL::Extensions::EXT::transform_feedback>())
#endif #endif
{ {
#ifndef MAGNUM_TARGET_GLES #ifndef MAGNUM_TARGET_GLES
_h(EXT::transform_feedback) _h(EXT::transform_feedback)
#endif #endif
_l(TransformFeedback::maxInterleavedComponents()) _l(GL::TransformFeedback::maxInterleavedComponents())
_l(TransformFeedback::maxSeparateAttributes()) _l(GL::TransformFeedback::maxSeparateAttributes())
_l(TransformFeedback::maxSeparateComponents()) _l(GL::TransformFeedback::maxSeparateComponents())
} }
#endif #endif
#ifndef MAGNUM_TARGET_GLES #ifndef MAGNUM_TARGET_GLES
if(c.isExtensionSupported<Extensions::GL::ARB::transform_feedback3>()) { if(c.isExtensionSupported<GL::Extensions::ARB::transform_feedback3>()) {
_h(ARB::transform_feedback3) _h(ARB::transform_feedback3)
_l(TransformFeedback::maxBuffers()) _l(GL::TransformFeedback::maxBuffers())
_l(TransformFeedback::maxVertexStreams()) _l(GL::TransformFeedback::maxVertexStreams())
} }
#endif #endif
#if !defined(MAGNUM_TARGET_GLES2) && !defined(MAGNUM_TARGET_WEBGL) #if !defined(MAGNUM_TARGET_GLES2) && !defined(MAGNUM_TARGET_WEBGL)
#ifndef MAGNUM_TARGET_GLES #ifndef MAGNUM_TARGET_GLES
if(c.isExtensionSupported<Extensions::GL::ARB::geometry_shader4>()) if(c.isExtensionSupported<GL::Extensions::ARB::geometry_shader4>())
#else #else
if(c.isExtensionSupported<Extensions::GL::EXT::geometry_shader>()) if(c.isExtensionSupported<GL::Extensions::EXT::geometry_shader>())
#endif #endif
{ {
#ifndef MAGNUM_TARGET_GLES #ifndef MAGNUM_TARGET_GLES
@ -644,17 +645,17 @@ MagnumInfo::MagnumInfo(const Arguments& arguments): Platform::WindowlessApplicat
_h(EXT::geometry_shader) _h(EXT::geometry_shader)
#endif #endif
_l(Shader::maxGeometryInputComponents()) _l(GL::Shader::maxGeometryInputComponents())
_l(Shader::maxGeometryOutputComponents()) _l(GL::Shader::maxGeometryOutputComponents())
_l(Shader::maxGeometryTotalOutputComponents()) _l(GL::Shader::maxGeometryTotalOutputComponents())
} }
#endif #endif
#if !defined(MAGNUM_TARGET_GLES2) && !defined(MAGNUM_TARGET_WEBGL) #if !defined(MAGNUM_TARGET_GLES2) && !defined(MAGNUM_TARGET_WEBGL)
#ifndef MAGNUM_TARGET_GLES #ifndef MAGNUM_TARGET_GLES
if(c.isExtensionSupported<Extensions::GL::ARB::tessellation_shader>()) if(c.isExtensionSupported<GL::Extensions::ARB::tessellation_shader>())
#else #else
if(c.isExtensionSupported<Extensions::GL::EXT::tessellation_shader>()) if(c.isExtensionSupported<GL::Extensions::EXT::tessellation_shader>())
#endif #endif
{ {
#ifndef MAGNUM_TARGET_GLES #ifndef MAGNUM_TARGET_GLES
@ -663,19 +664,19 @@ MagnumInfo::MagnumInfo(const Arguments& arguments): Platform::WindowlessApplicat
_h(EXT::tessellation_shader) _h(EXT::tessellation_shader)
#endif #endif
_l(Shader::maxTessellationControlInputComponents()) _l(GL::Shader::maxTessellationControlInputComponents())
_l(Shader::maxTessellationControlOutputComponents()) _l(GL::Shader::maxTessellationControlOutputComponents())
_l(Shader::maxTessellationControlTotalOutputComponents()) _l(GL::Shader::maxTessellationControlTotalOutputComponents())
_l(Shader::maxTessellationEvaluationInputComponents()) _l(GL::Shader::maxTessellationEvaluationInputComponents())
_l(Shader::maxTessellationEvaluationOutputComponents()) _l(GL::Shader::maxTessellationEvaluationOutputComponents())
} }
#endif #endif
#if !defined(MAGNUM_TARGET_GLES2) && !defined(MAGNUM_TARGET_WEBGL) #if !defined(MAGNUM_TARGET_GLES2) && !defined(MAGNUM_TARGET_WEBGL)
#ifndef MAGNUM_TARGET_GLES #ifndef MAGNUM_TARGET_GLES
if(c.isExtensionSupported<Extensions::GL::ARB::texture_buffer_object>()) if(c.isExtensionSupported<GL::Extensions::ARB::texture_buffer_object>())
#else #else
if(c.isExtensionSupported<Extensions::GL::EXT::texture_buffer>()) if(c.isExtensionSupported<GL::Extensions::EXT::texture_buffer>())
#endif #endif
{ {
#ifndef MAGNUM_TARGET_GLES #ifndef MAGNUM_TARGET_GLES
@ -684,13 +685,13 @@ MagnumInfo::MagnumInfo(const Arguments& arguments): Platform::WindowlessApplicat
_h(EXT::texture_buffer) _h(EXT::texture_buffer)
#endif #endif
_l(BufferTexture::maxSize()) _l(GL::BufferTexture::maxSize())
} }
#ifndef MAGNUM_TARGET_GLES #ifndef MAGNUM_TARGET_GLES
if(c.isExtensionSupported<Extensions::GL::ARB::texture_buffer_range>()) if(c.isExtensionSupported<GL::Extensions::ARB::texture_buffer_range>())
#else #else
if(c.isExtensionSupported<Extensions::GL::EXT::texture_buffer>()) if(c.isExtensionSupported<GL::Extensions::EXT::texture_buffer>())
#endif #endif
{ {
#ifndef MAGNUM_TARGET_GLES #ifndef MAGNUM_TARGET_GLES
@ -699,13 +700,13 @@ MagnumInfo::MagnumInfo(const Arguments& arguments): Platform::WindowlessApplicat
/* Header added above */ /* Header added above */
#endif #endif
_l(BufferTexture::offsetAlignment()) _l(GL::BufferTexture::offsetAlignment())
} }
#ifndef MAGNUM_TARGET_GLES #ifndef MAGNUM_TARGET_GLES
if(c.isExtensionSupported<Extensions::GL::ARB::texture_cube_map_array>()) if(c.isExtensionSupported<GL::Extensions::ARB::texture_cube_map_array>())
#else #else
if(c.isExtensionSupported<Extensions::GL::EXT::texture_cube_map_array>()) if(c.isExtensionSupported<GL::Extensions::EXT::texture_cube_map_array>())
#endif #endif
{ {
#ifndef MAGNUM_TARGET_GLES #ifndef MAGNUM_TARGET_GLES
@ -714,39 +715,39 @@ MagnumInfo::MagnumInfo(const Arguments& arguments): Platform::WindowlessApplicat
_h(EXT::texture_cube_map_array) _h(EXT::texture_cube_map_array)
#endif #endif
_lvec(CubeMapTextureArray::maxSize()) _lvec(GL::CubeMapTextureArray::maxSize())
} }
#endif #endif
#ifndef MAGNUM_TARGET_GLES #ifndef MAGNUM_TARGET_GLES
if(c.isExtensionSupported<Extensions::GL::ARB::texture_filter_anisotropic>()) { if(c.isExtensionSupported<GL::Extensions::ARB::texture_filter_anisotropic>()) {
_h(ARB::texture_filter_anisotropic) _h(ARB::texture_filter_anisotropic)
_l(Sampler::maxMaxAnisotropy()) _l(GL::Sampler::maxMaxAnisotropy())
} else } else
#endif #endif
if(c.isExtensionSupported<Extensions::GL::EXT::texture_filter_anisotropic>()) { if(c.isExtensionSupported<GL::Extensions::EXT::texture_filter_anisotropic>()) {
_h(EXT::texture_filter_anisotropic) _h(EXT::texture_filter_anisotropic)
_l(Sampler::maxMaxAnisotropy()) _l(GL::Sampler::maxMaxAnisotropy())
} }
#ifndef MAGNUM_TARGET_WEBGL #ifndef MAGNUM_TARGET_WEBGL
if(c.isExtensionSupported<Extensions::GL::KHR::debug>()) { if(c.isExtensionSupported<GL::Extensions::KHR::debug>()) {
_h(KHR::debug) _h(KHR::debug)
_l(AbstractObject::maxLabelLength()) _l(GL::AbstractObject::maxLabelLength())
_l(DebugOutput::maxLoggedMessages()) _l(GL::DebugOutput::maxLoggedMessages())
_l(DebugOutput::maxMessageLength()) _l(GL::DebugOutput::maxMessageLength())
_l(DebugGroup::maxStackDepth()) _l(GL::DebugGroup::maxStackDepth())
} }
#endif #endif
#if defined(MAGNUM_TARGET_GLES2) && !defined(MAGNUM_TARGET_WEBGL) #if defined(MAGNUM_TARGET_GLES2) && !defined(MAGNUM_TARGET_WEBGL)
if(c.isExtensionSupported<Extensions::GL::OES::texture_3D>()) { if(c.isExtensionSupported<GL::Extensions::OES::texture_3D>()) {
_h(OES::texture_3D) _h(OES::texture_3D)
_lvec(Texture3D::maxSize()) _lvec(GL::Texture3D::maxSize())
} }
#endif #endif

Loading…
Cancel
Save