diff --git a/CMakeLists.txt b/CMakeLists.txt index 3ca64801e..dcdaff46d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -71,7 +71,7 @@ endif() cmake_dependent_option(TARGET_GLES2 "Build for OpenGL ES 2 / WebGL 1.0" ON "TARGET_GLES" OFF) cmake_dependent_option(TARGET_DESKTOP_GLES "Build for OpenGL ES on desktop" OFF "TARGET_GLES" OFF) -option(TARGET_HEADLESS "Build command-line utilities for use on a headless machines" OFF) +cmake_dependent_option(TARGET_HEADLESS "Build command-line utilities for use on a headless machines" OFF "WITH_GL" OFF) # Magnum Info (currently only using GLX/CGL/EGL on *nix, WGL/EGL on Windows and # EGL on Emscripten) @@ -114,6 +114,10 @@ cmake_dependent_option(WITH_SHADERS "Build Shaders library" ON "NOT WITH_DEBUGTO cmake_dependent_option(WITH_TEXT "Build Text library" ON "NOT WITH_FONTCONVERTER;NOT WITH_MAGNUMFONT;NOT WITH_MAGNUMFONTCONVERTER" ON) cmake_dependent_option(WITH_TEXTURETOOLS "Build TextureTools library" ON "NOT WITH_TEXT;NOT WITH_DISTANCEFIELDCONVERTER" ON) cmake_dependent_option(WITH_TRADE "Build Trade library" ON "NOT WITH_MESHTOOLS;NOT WITH_PRIMITIVES;NOT WITH_IMAGECONVERTER;NOT WITH_ANYIMAGEIMPORTER;NOT WITH_ANYIMAGECONVERTER;NOT WITH_ANYSCENEIMPORTER;NOT WITH_OBJIMPORTER;NOT WITH_TGAIMAGECONVERTER;NOT WITH_TGAIMPORTER" ON) +cmake_dependent_option(WITH_GL "Build GL library" ON "NOT WITH_DEBUGTOOLS;NOT WITH_MESHTOOLS;NOT WITH_PRIMITIVES;NOT WITH_SHADERS;NOT WITH_TEXT;NOT WITH_TEXTURETOOLS;NOT WITH_TRADE;NOT WITH_MAGNUMINFO;NOT WITH_ANDROIDAPPLICATION;NOT WITH_WINDOWLESSIOSAPPLICATION;NOT WITH_CGLCONTEXT;NOT WITH_GLXAPPLICATION;NOT WITH_GLXCONTEXT;NOT WITH_XEGLAPPLICATION;NOT WITH_WINDOWLESSWGLAPPLICATION;NOT WITH_GLXCONTEXT;NOT WITH_XEGLAPPLICATION;NOT WITH_WINDOWLESSWGLAPPLICATION;NOT WITH_WGLCONTEXT;NOT WITH_WINDOWLESSWINDOWSEGLAPPLICATION;NOT WITH_GLFWAPPLICATION;NOT WITH_GLUTAPPLICATION;NOT WITH_SDL2APPLICATION;NOT WITH_DISTANCEFIELDCONVERTER;NOT WITH_FONTCONVERTER;NOT WITH_IMAGECONVERTER" ON) + +# Magnum AL Info +cmake_dependent_option(WITH_AL_INFO "Build magnum-al-info utility" OFF "WITH_AUDIO" OFF) # EGL context and windowless EGL application, available everywhere cmake_dependent_option(WITH_WINDOWLESSEGLAPPLICATION "Build WindowlessEglApplication library" OFF "NOT TARGET_GLES OR TARGET_DESKTOP_GLES OR NOT WITH_MAGNUMINFO" ON) diff --git a/doc/building.dox b/doc/building.dox index 48fa3ff9d..3d9b373bf 100644 --- a/doc/building.dox +++ b/doc/building.dox @@ -383,16 +383,20 @@ By default the engine is built for desktop OpenGL. Using the `TARGET_*` CMake options you can target other platforms. Note that some features are available for desktop OpenGL only, see @ref requires-gl. -- `TARGET_GLES` --- Target OpenGL ES. -- `TARGET_GLES2` --- Target OpenGL ES 2.0 instead of 3.0 and later. Currently - enabled by default when `TARGET_GLES` is set. +- `TARGET_GLES` --- Target OpenGL ES. Available only when `WITH_GL` is + enabled. +- `TARGET_GLES2` --- Target OpenGL ES 2.0 instead of 3.0 and later. Available + only when `WITH_GL` is set. Currently enabled by default when `TARGET_GLES` + is set. - `TARGET_DESKTOP_GLES` --- Target OpenGL ES on desktop, i.e. use OpenGL ES emulation in desktop OpenGL drivers. Available on Linux and Windows, though - might not be supported by all drivers. + might not be supported by all drivers. Available only when `WITH_GL` is + enabled. - `TARGET_HEADLESS` --- Build command-line utilities for use on a headless machine. Basically it means that EGL with no display attachment is being used everywhere instead of platform-specific toolkits like CGL, GLX or WGL. - Supported mainly on OpenGL ES drivers. + Supported mainly on OpenGL ES drivers. Available only when `WITH_GL` is + enabled. By default the engine is built in a way that allows having multiple independent thread-local Magnum contents. This might cause some performance penalties --- @@ -411,22 +415,27 @@ be built and which not: - `WITH_AUDIO` --- Build the @ref Audio library. Depends on [OpenAL](https://www.openal.org/), not built by default. -- `WITH_DEBUGTOOLS` --- Build the @ref DebugTools library. +- `WITH_DEBUGTOOLS` --- Build the @ref DebugTools library. Enables also + building of the GL library. +- `WITH_GL` --- Build the @ref GL library - `WITH_MESHTOOLS` --- Build the @ref MeshTools library. Enables also - building of the Trade library. + building of the Trade and GL libraries. - `WITH_PRIMITIVES` --- Build the @ref Primitives library. Enables also - building of the Trade library. + building of the Trade and GL libraries. - `WITH_SCENEGRAPH` --- Build the @ref SceneGraph library. Enabled automatically if `WITH_SHAPES` is enabled. -- `WITH_SHADERS` --- Build the @ref Shaders library. +- `WITH_SHADERS` --- Build the @ref Shaders library. Enables also building of + the GL library. - `WITH_SHAPES` --- Build the @ref Shapes library. Enables also building of the SceneGraph library. Enabled automatically if `WITH_DEBUGTOOLS` is enabled. - `WITH_TEXT` --- Build the @ref Text library. Enables also building of - the TextureTools library. -- `WITH_TEXTURETOOLS` --- Build the @ref TextureTools library. Enabled - automatically if `WITH_TEXT` or `WITH_DISTANCEFIELDCONVERTER` is enabled. -- `WITH_TRADE` --- Build the @ref Trade library + the TextureTools and GL libraries. +- `WITH_TEXTURETOOLS` --- Build the @ref TextureTools library. Enables also + building of the GL library. Enabled automatically if `WITH_TEXT` or + `WITH_DISTANCEFIELDCONVERTER` is enabled. +- `WITH_TRADE` --- Build the @ref Trade library. Enables also building of the + GL library. There are more involved component dependencies that are not described here (for example the @ref DebugTools has some functionality that gets built only when @@ -442,49 +451,63 @@ your platform best: - `WITH_ANDROIDAPPLICATION` --- Build the @ref Platform::AndroidApplication "AndroidApplication" library. Available - only on @ref CORRADE_TARGET_ANDROID "Android". + only on @ref CORRADE_TARGET_ANDROID "Android". Enables also building of the + GL library. - `WITH_GLFWAPPLICATION` --- Build the @ref Platform::GlfwApplication "GlfwApplication" library. Depends on - [GLFW](http://glfw.org). + [GLFW](http://glfw.org). Enables also building of the GL library. - `WITH_GLUTAPPLICATION` --- Build the @ref Platform::GlutApplication "GlutApplication" library. Depends on - [GLUT](http://freeglut.sourceforge.net/). + [GLUT](http://freeglut.sourceforge.net/). Enables also building of the GL + library. - `WITH_GLXAPPLICATION` --- Build the @ref Platform::GlxApplication "GlxApplication" library. Depends on **X11**. + Enables also building of the GL library. - `WITH_SDL2APPLICATION` --- Build the @ref Platform::Sdl2Application "Sdl2Application" library. Depends on - [SDL2](http://www.libsdl.org). + [SDL2](http://www.libsdl.org). Enables also building of the GL library. - `WITH_XEGLAPPLICATION` --- Build the - @ref Platform::XEglApplication "XEglApplication" library. + @ref Platform::XEglApplication "XEglApplication" library. Enables also + building of the GL library. - `WITH_WINDOWLESSCGLAPPLICATION` --- Build the @ref Platform::WindowlessCglApplication "WindowlessCglApplication" library. + Enables also building of the GL library. - `WITH_WINDOWLESSEGLAPPLICATION` --- Build the @ref Platform::WindowlessEglApplication "WindowlessEglApplication" library. + Enables also building of the GL library. - `WITH_WINDOWLESSGLXAPPLICATION` --- Build the @ref Platform::WindowlessGlxApplication "WindowlessGlxApplication" library. + Enables also building of the GL library. - `WITH_WINDOWLESSIOSAPPLICATION` --- Build the @ref Platform::WindowlessIosApplication "WindowlessIosApplication" library. + Enables also building of the GL library. - `WITH_WINDOWLESSWGLAPPLICATION` --- Build the @ref Platform::WindowlessWglApplication "WindowlessWglApplication" library. + Enables also building of the GL library. - `WITH_WINDOWLESSWINDOWSEGLAPPLICATION` --- Build the @ref Platform::WindowlessWindowsEglApplication "WindowlessWindowsEglApplication" - library. + library. Enables also building of the GL library. None of the context libraries is built by default. Similarly to the application libraries, they are always built as static. You need them only if you chose to not use any of the application libraries above (see @ref platform-custom for more information): -- `WITH_CGLCONTEXT` --- Build the CGL context handling library. -- `WITH_EGLCONTEXT` --- Build the EGL context handling library. -- `WITH_GLXCONTEXT` --- Build the GLX context handling library. -- `WITH_WGLCONTEXT` --- Build the WGL context handling library. +- `WITH_CGLCONTEXT` --- Build the CGL context handling library. Enables also + building of the GL library. +- `WITH_EGLCONTEXT` --- Build the EGL context handling library. Enables also + building of the GL library. +- `WITH_GLXCONTEXT` --- Build the GLX context handling library. Enables also + building of the GL library. +- `WITH_WGLCONTEXT` --- Build the WGL context handling library. Enables also + building of the GL library. There are also extensions to @ref Corrade::TestSuite::Tester for testing GPU code: -- `WITH_OPENGLTESTER` --- The @ref OpenGLTester class. Enables building of - one of the windowless application libraries based on the target platform. +- `WITH_OPENGLTESTER` --- The @ref OpenGLTester class. Enables also building + of the GL library and one of the windowless application libraries based on + the target platform. Magnum also contains a set of dependency-less plugins for importing essential file formats. Additional plugins are provided in a separate plugin repository, diff --git a/doc/changelog.dox b/doc/changelog.dox index 0ede8d10d..a0234ecd0 100644 --- a/doc/changelog.dox +++ b/doc/changelog.dox @@ -48,6 +48,14 @@ See also: @subsection changelog-latest-new New features +@subsubsection changelog-latest-new-math Math library + +- Added @ref Math::isInf(), @ref Math::isNan() + +@subsubsection changelog-latest-new-gl GL library + +- A new library that now contains wrappers for the OpenGL family of graphics + APIs, separated from the core Magnum library - Initial support for OpenGL ES 3.2 and OpenGL 4.6 - New OpenGL extension support: - @extension{ARB,texture_filter_anisotropic} @@ -60,10 +68,6 @@ See also: @webgl_extension{EXT,color_buffer_float} - Ported @ref OpenGLTester to WebGL -@subsubsection changelog-latest-new-math Math library - -- Added @ref Math::isInf(), @ref Math::isNan() - @subsubsection changelog-latest-new-platform Platform libraries - Added @ref Platform::AndroidApplication::windowSize() @@ -164,6 +168,11 @@ See also: @subsection changelog-latest-compatibility Potential compatibility breakages, removed APIs +- Code that was previously linking just to the core @ref Magnum library may + now need to explicitly link to the @ref Magnum::Trade and @ref Magnum::GL + libraries as well. If using CMake, these dependencies might get linked in + transitively from other libraries, but that doesn't handle all cases. Due + to the complexity of this change, no backwards compatibility is provided. - Removed `PixelStorage::setSwapBytes()`, as every Magnum API dealing with images basically only asserted that it's not set. Use @ref Corrade::Utility::Endianness instead. diff --git a/doc/compilation-speedup.dox b/doc/compilation-speedup.dox index 0eb84e1a7..5ce5b2a03 100644 --- a/doc/compilation-speedup.dox +++ b/doc/compilation-speedup.dox @@ -56,6 +56,7 @@ available, each namespace has its own: - @ref Magnum/Magnum.h - @ref Magnum/Audio/Audio.h - @ref Magnum/DebugTools/DebugTools.h +- @ref Magnum/GL/GL.h - @ref Magnum/Math/Math.h - @ref Magnum/DartIntegration/DartIntegration.h - @ref Magnum/OvrIntegration/OvrIntegration.h diff --git a/doc/method-chaining.dox b/doc/method-chaining.dox index 73e33e572..51a56881e 100644 --- a/doc/method-chaining.dox +++ b/doc/method-chaining.dox @@ -44,7 +44,7 @@ bound somewhere. Method chaining encourages you to configure whole object in one run, effectively reducing the number of needed bindings. Consider the following example: -@snippet Magnum.cpp method-chaining-texture +@snippet MagnumGL.cpp method-chaining-texture This code is written that similar configuration steps are grouped together, which might be good when somebody needs to change something for all three @@ -53,7 +53,7 @@ names and after each configuration step the texture must be rebound to another. With method chaining used the code looks much lighter and each object is configured in one run, reducing count of bind calls from 9 to 3. -@snippet Magnum.cpp method-chaining-texture-chained +@snippet MagnumGL.cpp method-chaining-texture-chained Method chaining is not used on non-configuring functions, such as @ref Framebuffer::clear() or @ref Mesh::draw(), as these won't be commonly used diff --git a/doc/opengl-workarounds.dox b/doc/opengl-workarounds.dox index d9d97971f..211adfaec 100644 --- a/doc/opengl-workarounds.dox +++ b/doc/opengl-workarounds.dox @@ -51,7 +51,7 @@ and diagnostic purpose it's possible to disable particular workarounds by passing their identifier string to the `--magnum-disable-workarounds` command-line option. See @ref Context-command-line for more information. -@snippet src/Magnum/Implementation/driverSpecific.cpp workarounds +@snippet src/Magnum/GL/Implementation/driverSpecific.cpp workarounds */ } diff --git a/doc/opengl-wrapping.dox b/doc/opengl-wrapping.dox index 14960e0b2..375c10992 100644 --- a/doc/opengl-wrapping.dox +++ b/doc/opengl-wrapping.dox @@ -58,7 +58,7 @@ equivalent to the moved-from state. It is useful in case you need to construct the object before creating context (such as class members) or if you know you would overwrite it later with another object: -@snippet Magnum.cpp opengl-wrapping-nocreate +@snippet MagnumGL.cpp opengl-wrapping-nocreate If you need to preserve the underlying OpenGL object after destruction, you can call @cpp release() @ce. It returns ID of the underlying object, the instance @@ -68,7 +68,7 @@ ID of the underlying without releasing it using `id()`). It is also possible to do the opposite --- wrapping existing OpenGL object ID into Magnum object instance using @cpp wrap() @ce. -@snippet Magnum.cpp opengl-wrapping-transfer +@snippet MagnumGL.cpp opengl-wrapping-transfer The @cpp NoCreate @ce constructor, @cpp wrap() @ce and @cpp release() @ce functions are available for all OpenGL classes except @ref Shader, where @@ -87,7 +87,7 @@ tracks OpenGL state such as currently bound objects, activated renderer features etc. When combining Magnum with third-party code, the internal state tracker may get confused and you need to reset it using @ref Context::resetState(): -@snippet Magnum.cpp opengl-wrapping-state +@snippet MagnumGL.cpp opengl-wrapping-state Note that by design it's not possible to reset all state touched by Magnum to previous values --- it would involve impractically large amount of queries and @@ -113,7 +113,7 @@ GL version/extension is required. The information is also aggregated on @ref opengl-required-extensions documentation page. Use @ref Context::isVersionSupported() or @ref Context::isExtensionSupported(): -@snippet Magnum.cpp opengl-wrapping-extensions +@snippet MagnumGL.cpp opengl-wrapping-extensions @attention Using API that requires OpenGL version or extension that is not provided by the driver results in undefined behavior --- the best you can @@ -135,7 +135,7 @@ required extensions are not available, @ref Texture::setStorage() emulation on platforms that don't support it etc. The goal is to abstract away the (mostly unimportant) differences for easier porting. -@snippet Magnum.cpp opengl-wrapping-dsa +@snippet MagnumGL.cpp opengl-wrapping-dsa */ } diff --git a/doc/platforms-html5.dox b/doc/platforms-html5.dox index 90ef2eec9..f36c36c3e 100644 --- a/doc/platforms-html5.dox +++ b/doc/platforms-html5.dox @@ -49,12 +49,12 @@ requirement for unique buffer target binding, aligned buffer offset and stride and some other restrictions. The most prominent difference is that while the following was enough on desktop: -@snippet Magnum.cpp Buffer-webgl-nope +@snippet MagnumGL.cpp Buffer-webgl-nope On WebGL (even 2.0) you always have to initialize the buffers like this (and other target hints for UBOs etc.): -@snippet Magnum.cpp Buffer-webgl +@snippet MagnumGL.cpp Buffer-webgl See @ref Buffer-webgl-restrictions "Buffer", @ref Mesh-webgl-restrictions "Mesh", @ref Texture::setSubImage() "*Texture::setSubImage()", diff --git a/doc/portability.dox b/doc/portability.dox index 432fd7f26..2257c6fe8 100644 --- a/doc/portability.dox +++ b/doc/portability.dox @@ -48,7 +48,7 @@ If you include @ref Magnum.h, you get these predefined macros: Example usage: -@snippet Magnum.cpp portability-targets +@snippet MagnumGL.cpp portability-targets Each feature is marked accordingly if it is not available in some targets. See also @ref requires-gl, @ref requires-gles20 and @ref requires-gles30. @@ -78,7 +78,7 @@ thus the decision cannot be made at compile time. Header @ref Extensions.h contains list of extensions, which you can pass to @ref Context::isExtensionSupported() and decide based on that: -@snippet Magnum.cpp portability-extensions +@snippet MagnumGL.cpp portability-extensions You can also decide on particular OpenGL version using @ref Context::isVersionSupported(), but remember that some features from that version might be available even if @@ -89,7 +89,7 @@ extensions, you can use macros @ref MAGNUM_ASSERT_EXTENSION_SUPPORTED() or @ref MAGNUM_ASSERT_VERSION_SUPPORTED() to add mandatory requirement of given extension or version: -@snippet Magnum.cpp portability-extension-assert +@snippet MagnumGL.cpp portability-extension-assert Each class, function or enum value is marked accordingly if it needs specific extension or specific OpenGL version. Various classes in Magnum are taking @@ -113,7 +113,7 @@ you can decide on the syntax in your shader code. You can also use version from a list:

-@snippet Magnum.cpp portability-shaders +@snippet MagnumGL.cpp portability-shaders

@code{.vert} @@ -139,7 +139,7 @@ be available in given GLSL version (e.g. causing compilation errors). You can use @ref Context::isExtensionSupported(Version) const to check that the extension is present in given version: -@snippet Magnum.cpp portability-shaders-bind +@snippet MagnumGL.cpp portability-shaders-bind See also @ref AbstractShaderProgram class documentation for information about specifying attribute location, uniform location and texture binding unit in diff --git a/doc/snippets/CMakeLists.txt b/doc/snippets/CMakeLists.txt index 6413229d9..1414128a0 100644 --- a/doc/snippets/CMakeLists.txt +++ b/doc/snippets/CMakeLists.txt @@ -38,15 +38,21 @@ if(CORRADE_TARGET_EMSCRIPTEN AND NOT TARGET_GLES2) set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -s USE_WEBGL2=1") endif() -add_library(snippets STATIC +add_library(snippets-Magnum STATIC plugins.cpp - Magnum.cpp - MagnumMath.cpp - MagnumMeshTools.cpp - MagnumShaders.cpp - MagnumText.cpp) -target_link_libraries(snippets PRIVATE Magnum) -set_target_properties(snippets PROPERTIES FOLDER "Magnum/doc/snippets") + MagnumMath.cpp) +target_link_libraries(snippets-Magnum PRIVATE Magnum) +set_target_properties(snippets-Magnum PROPERTIES FOLDER "Magnum/doc/snippets") + +if(WITH_GL) + add_library(snippets-MagnumGL STATIC + MagnumGL.cpp + MagnumMeshTools.cpp + MagnumShaders.cpp + MagnumText.cpp) + target_link_libraries(snippets-MagnumGL PRIVATE MagnumGL) + set_target_properties(snippets-MagnumGL PROPERTIES FOLDER "Magnum/doc/snippets") +endif() find_package(Corrade COMPONENTS TestSuite) @@ -81,7 +87,7 @@ if(WITH_SDL2APPLICATION) add_library(snippets-MagnumPlatform STATIC MagnumPlatform.cpp - Magnum-framebuffer.cpp) + MagnumGL-framebuffer.cpp) target_link_libraries(snippets-MagnumPlatform PRIVATE MagnumSdl2Application) set_target_properties( diff --git a/doc/snippets/Magnum-framebuffer.cpp b/doc/snippets/MagnumGL-framebuffer.cpp similarity index 100% rename from doc/snippets/Magnum-framebuffer.cpp rename to doc/snippets/MagnumGL-framebuffer.cpp diff --git a/doc/snippets/Magnum.cpp b/doc/snippets/MagnumGL.cpp similarity index 100% rename from doc/snippets/Magnum.cpp rename to doc/snippets/MagnumGL.cpp diff --git a/src/Magnum/CMakeLists.txt b/src/Magnum/CMakeLists.txt index 2e3f43b6f..b829435e7 100644 --- a/src/Magnum/CMakeLists.txt +++ b/src/Magnum/CMakeLists.txt @@ -28,172 +28,25 @@ configure_file(${CMAKE_CURRENT_SOURCE_DIR}/configure.h.cmake # Files shared between main library and unit test library set(Magnum_SRCS - AbstractFramebuffer.cpp - AbstractObject.cpp - AbstractTexture.cpp - AbstractShaderProgram.cpp - Attribute.cpp - Buffer.cpp - CubeMapTexture.cpp - Context.cpp - DefaultFramebuffer.cpp - Framebuffer.cpp - Image.cpp - ImageView.cpp - Mesh.cpp - MeshView.cpp - OpenGL.cpp - PixelFormat.cpp - PixelStorage.cpp - Renderbuffer.cpp - Renderer.cpp Resource.cpp - Sampler.cpp - Shader.cpp - Texture.cpp - Timeline.cpp - Version.cpp - - Implementation/BufferState.cpp - Implementation/ContextState.cpp - Implementation/FramebufferState.cpp - Implementation/MeshState.cpp - Implementation/RendererState.cpp - Implementation/ShaderProgramState.cpp - Implementation/ShaderState.cpp - Implementation/State.cpp - Implementation/TextureState.cpp - Implementation/driverSpecific.cpp - Implementation/maxTextureSize.cpp) + Timeline.cpp) set(Magnum_HEADERS - AbstractFramebuffer.h - AbstractObject.h AbstractResourceLoader.h - AbstractShaderProgram.h - AbstractTexture.h Array.h - Attribute.h - Buffer.h - Context.h - CubeMapTexture.h - DefaultFramebuffer.h DimensionTraits.h - Extensions.h - Framebuffer.h Image.h ImageView.h Magnum.h - Mesh.h - MeshView.h - OpenGL.h - PixelFormat.h PixelStorage.h - Renderbuffer.h - RenderbufferFormat.h - Renderer.h Resource.h ResourceManager.h ResourceManager.hpp - Sampler.h - Shader.h Tags.h - Texture.h - TextureFormat.h Timeline.h Types.h - Version.h - visibility.h) -# Header files to display in project view of IDEs only -set(Magnum_PRIVATE_HEADERS - Implementation/BufferState.h - Implementation/ContextState.h - Implementation/FramebufferState.h - Implementation/maxTextureSize.h - Implementation/MeshState.h - Implementation/RendererState.h - Implementation/ShaderProgramState.h - Implementation/ShaderState.h - Implementation/State.h - Implementation/TextureState.h) - -# Desktop-only stuff -if(NOT TARGET_GLES) - list(APPEND Magnum_SRCS RectangleTexture.cpp) - list(APPEND Magnum_HEADERS RectangleTexture.h) -endif() - -# OpenGL ES 3.0 and WebGL 2.0 stuff -if(NOT TARGET_GLES2) - list(APPEND Magnum_SRCS - BufferImage.cpp - PrimitiveQuery.cpp - TextureArray.cpp - TransformFeedback.cpp - - Implementation/TransformFeedbackState.cpp) - - list(APPEND Magnum_HEADERS - BufferImage.h - PrimitiveQuery.h - TextureArray.h - TransformFeedback.h) - - list(APPEND Magnum_PRIVATE_HEADES - Implementation/TransformFeedbackState.h) -endif() - -# Desktop and OpenGL ES stuff that is not available in WebGL -if(NOT TARGET_WEBGL) - list(APPEND Magnum_SRCS - DebugOutput.cpp - - Implementation/DebugState.cpp) - - list(APPEND Magnum_HEADERS - DebugOutput.h - TimeQuery.h) - - list(APPEND Magnum_PRIVATE_HEADERS - Implementation/DebugState.h) - - # Desktop and OpenGL ES 3.0 stuff that is not available in ES2 and WebGL - if(NOT TARGET_GLES2) - list(APPEND Magnum_SRCS - BufferTexture.cpp - CubeMapTextureArray.cpp - MultisampleTexture.cpp) - list(APPEND Magnum_HEADERS - BufferTexture.h - BufferTextureFormat.h - CubeMapTextureArray.h - ImageFormat.h - MultisampleTexture.h) - endif() -endif() - -# Desktop, OpenGL ES and WebGL 2.0 stuff that is not available in WebGL 1.0 -if(NOT (TARGET_WEBGL AND TARGET_GLES2)) - list(APPEND Magnum_SRCS - AbstractQuery.cpp - - Implementation/QueryState.cpp) - - list(APPEND Magnum_HEADERS - AbstractQuery.h - SampleQuery.h) - - list(APPEND Magnum_PRIVATE_HEADERS - Implementation/QueryState.h) -endif() - -# Link in GL function pointer variables on platforms that support it -if(NOT CORRADE_TARGET_EMSCRIPTEN) - list(APPEND Magnum_SRCS $) -endif() - # Files shared between main library and math unit test library set(MagnumMath_SRCS Math/Color.cpp @@ -219,33 +72,20 @@ set_target_properties(MagnumMathObjects PROPERTIES FOLDER "Magnum/Math") add_library(Magnum ${SHARED_OR_STATIC} ${Magnum_SRCS} ${Magnum_HEADERS} - ${Magnum_PRIVATE_HEADERS} $) set_target_properties(Magnum PROPERTIES DEBUG_POSTFIX "-d" FOLDER "Magnum") if(NOT BUILD_STATIC) - target_compile_definitions(Magnum PRIVATE "FlextGL_EXPORTS") set_target_properties(Magnum PROPERTIES VERSION ${MAGNUM_LIBRARY_VERSION} SOVERSION ${MAGNUM_LIBRARY_SOVERSION}) elseif(BUILD_STATIC_PIC) set_target_properties(Magnum PROPERTIES POSITION_INDEPENDENT_CODE ON) endif() -# We can use both implicit include path (GLES2/gl2.h) where our headers can -# be overriden with system ones or explicit (MagnumExternal/OpenGL/GLES2/gl2ext.h) -# where only our headers will be used target_include_directories(Magnum PUBLIC ${PROJECT_SOURCE_DIR}/src - ${PROJECT_BINARY_DIR}/src - ${PROJECT_SOURCE_DIR}/src/MagnumExternal/OpenGL) -target_link_libraries(Magnum + ${PROJECT_BINARY_DIR}/src) +target_link_libraries(Magnum PUBLIC Corrade::Utility) -if(NOT TARGET_GLES OR TARGET_DESKTOP_GLES) - target_link_libraries(Magnum ${OPENGL_gl_LIBRARY}) -elseif(TARGET_GLES2) - target_link_libraries(Magnum OpenGLES2::OpenGLES2) -else() - target_link_libraries(Magnum OpenGLES3::OpenGLES3) -endif() install(TARGETS Magnum RUNTIME DESTINATION ${MAGNUM_BINARY_INSTALL_DIR} @@ -254,43 +94,6 @@ install(TARGETS Magnum install(FILES ${Magnum_HEADERS} DESTINATION ${MAGNUM_INCLUDE_INSTALL_DIR}) install(FILES ${CMAKE_CURRENT_BINARY_DIR}/configure.h DESTINATION ${MAGNUM_INCLUDE_INSTALL_DIR}) -# OpenGLTester class -if(WITH_OPENGLTESTER) - find_package(Corrade REQUIRED TestSuite) - - set(MagnumOpenGLTester_SRCS OpenGLTester.cpp) - set(MagnumOpenGLTester_HEADERS OpenGLTester.h) - if(BUILD_DEPRECATED) - set(MagnumOpenGLTester_DEPRECATED_HEADERS Test/AbstractOpenGLTester.h) - endif() - - add_library(MagnumOpenGLTester STATIC - ${MagnumOpenGLTester_SRCS} - ${MagnumOpenGLTester_HEADERS} - ${MagnumOpenGLTester_DEPRECATED_HEADERS}) # TODO: remove when the header is removed - set_target_properties(MagnumOpenGLTester PROPERTIES - DEBUG_POSTFIX "-d" - FOLDER "Magnum") - # Assuming that PIC is not needed because the Tester lib is always linked - # to the executable and not to any intermediate shared lib - - # OPENGLTESTER_APPLICATION defined in the root CMakeLists, because it also - # enables the application library dependencies - target_link_libraries(MagnumOpenGLTester Magnum Corrade::TestSuite ${OPENGLTESTER_APPLICATION}) - - install(FILES ${MagnumOpenGLTester_HEADERS} DESTINATION ${MAGNUM_INCLUDE_INSTALL_DIR}) - if(BUILD_DEPRECATED) - install(FILES ${MagnumOpenGLTester_DEPRECATED_HEADERS} DESTINATION ${MAGNUM_INCLUDE_INSTALL_DIR}/Test) - endif() - install(TARGETS MagnumOpenGLTester - RUNTIME DESTINATION ${MAGNUM_BINARY_INSTALL_DIR} - LIBRARY DESTINATION ${MAGNUM_LIBRARY_INSTALL_DIR} - ARCHIVE DESTINATION ${MAGNUM_LIBRARY_INSTALL_DIR}) - - # Magnum OpenGLTester target alias for superprojects - add_library(Magnum::OpenGLTester ALIAS MagnumOpenGLTester) -endif() - add_subdirectory(Math) add_subdirectory(Platform) @@ -302,6 +105,10 @@ if(WITH_DEBUGTOOLS) add_subdirectory(DebugTools) endif() +if(WITH_GL) + add_subdirectory(GL) +endif() + if(WITH_MESHTOOLS) add_subdirectory(MeshTools) endif() diff --git a/src/Magnum/AbstractFramebuffer.cpp b/src/Magnum/GL/AbstractFramebuffer.cpp similarity index 98% rename from src/Magnum/AbstractFramebuffer.cpp rename to src/Magnum/GL/AbstractFramebuffer.cpp index fa08cec79..cf80654d7 100644 --- a/src/Magnum/AbstractFramebuffer.cpp +++ b/src/Magnum/GL/AbstractFramebuffer.cpp @@ -25,26 +25,25 @@ #include "AbstractFramebuffer.h" +#include "Magnum/Image.h" #ifndef MAGNUM_TARGET_GLES2 -#include "Magnum/BufferImage.h" +#include "Magnum/GL/BufferImage.h" #endif -#include "Magnum/Context.h" -#include "Magnum/CubeMapTexture.h" +#include "Magnum/GL/Context.h" +#include "Magnum/GL/CubeMapTexture.h" #if !defined(MAGNUM_TARGET_GLES2) && !defined(MAGNUM_TARGET_WEBGL) -#include "Magnum/CubeMapTextureArray.h" +#include "Magnum/GL/CubeMapTextureArray.h" #endif -#include "Magnum/Extensions.h" -#include "Magnum/Image.h" +#include "Magnum/GL/Extensions.h" #ifndef MAGNUM_TARGET_GLES -#include "Magnum/RectangleTexture.h" +#include "Magnum/GL/RectangleTexture.h" #endif -#include "Magnum/Texture.h" +#include "Magnum/GL/Texture.h" #ifndef MAGNUM_TARGET_GLES2 -#include "Magnum/TextureArray.h" +#include "Magnum/GL/TextureArray.h" #endif - -#include "Implementation/FramebufferState.h" -#include "Implementation/State.h" +#include "Magnum/GL/Implementation/FramebufferState.h" +#include "Magnum/GL/Implementation/State.h" namespace Magnum { diff --git a/src/Magnum/AbstractFramebuffer.h b/src/Magnum/GL/AbstractFramebuffer.h similarity index 85% rename from src/Magnum/AbstractFramebuffer.h rename to src/Magnum/GL/AbstractFramebuffer.h index c485b022e..84677e2ab 100644 --- a/src/Magnum/AbstractFramebuffer.h +++ b/src/Magnum/GL/AbstractFramebuffer.h @@ -1,5 +1,5 @@ -#ifndef Magnum_AbstractFramebuffer_h -#define Magnum_AbstractFramebuffer_h +#ifndef Magnum_GL_AbstractFramebuffer_h +#define Magnum_GL_AbstractFramebuffer_h /* This file is part of Magnum. @@ -31,7 +31,8 @@ #include -#include "Magnum/AbstractObject.h" +#include "Magnum/GL/GL.h" +#include "Magnum/GL/AbstractObject.h" #include "Magnum/Math/Range.h" namespace Magnum { @@ -159,7 +160,7 @@ available, @ref blit(), @ref clearDepth(), @ref clearStencil() and If @extension{ARB,robustness} is available, @ref read() operations are protected from buffer overflow. */ -class MAGNUM_EXPORT AbstractFramebuffer { +class MAGNUM_GL_EXPORT AbstractFramebuffer { friend Implementation::FramebufferState; public: @@ -355,7 +356,7 @@ class MAGNUM_EXPORT AbstractFramebuffer { * * Convenience alternative to the above, example usage: * - * @snippet Magnum.cpp AbstractFramebuffer-read1 + * @snippet MagnumGL.cpp AbstractFramebuffer-read1 */ Image2D read(const Range2Di& rectangle, Image2D&& image); @@ -382,7 +383,7 @@ class MAGNUM_EXPORT AbstractFramebuffer { * * Convenience alternative to the above, example usage: * - * @snippet Magnum.cpp AbstractFramebuffer-read2 + * @snippet MagnumGL.cpp AbstractFramebuffer-read2 */ BufferImage2D read(const Range2Di& rectangle, BufferImage2D&& image, BufferUsage usage); #endif @@ -698,11 +699,11 @@ class MAGNUM_EXPORT AbstractFramebuffer { ~AbstractFramebuffer() = default; - void MAGNUM_LOCAL createIfNotAlready(); + void MAGNUM_GL_LOCAL createIfNotAlready(); - void MAGNUM_LOCAL bindInternal(FramebufferTarget target); - FramebufferTarget MAGNUM_LOCAL bindInternal(); - void MAGNUM_LOCAL setViewportInternal(); + void MAGNUM_GL_LOCAL bindInternal(FramebufferTarget target); + FramebufferTarget MAGNUM_GL_LOCAL bindInternal(); + void MAGNUM_GL_LOCAL setViewportInternal(); GLuint _id; Range2Di _viewport; @@ -710,108 +711,108 @@ class MAGNUM_EXPORT AbstractFramebuffer { private: #ifndef MAGNUM_TARGET_GLES2 - static void MAGNUM_LOCAL blitImplementationDefault(AbstractFramebuffer& source, AbstractFramebuffer& destination, const Range2Di& sourceRectangle, const Range2Di& destinationRectangle, FramebufferBlitMask mask, FramebufferBlitFilter filter); + static void MAGNUM_GL_LOCAL blitImplementationDefault(AbstractFramebuffer& source, AbstractFramebuffer& destination, const Range2Di& sourceRectangle, const Range2Di& destinationRectangle, FramebufferBlitMask mask, FramebufferBlitFilter filter); #ifndef MAGNUM_TARGET_GLES - static void MAGNUM_LOCAL blitImplementationDSA(AbstractFramebuffer& source, AbstractFramebuffer& destination, const Range2Di& sourceRectangle, const Range2Di& destinationRectangle, FramebufferBlitMask mask, FramebufferBlitFilter filter); + static void MAGNUM_GL_LOCAL blitImplementationDSA(AbstractFramebuffer& source, AbstractFramebuffer& destination, const Range2Di& sourceRectangle, const Range2Di& destinationRectangle, FramebufferBlitMask mask, FramebufferBlitFilter filter); #endif #elif !defined(MAGNUM_TARGET_WEBGL) - static void MAGNUM_LOCAL blitImplementationANGLE(AbstractFramebuffer& source, AbstractFramebuffer& destination, const Range2Di& sourceRectangle, const Range2Di& destinationRectangle, FramebufferBlitMask mask, FramebufferBlitFilter filter); - static void MAGNUM_LOCAL blitImplementationNV(AbstractFramebuffer& source, AbstractFramebuffer& destination, const Range2Di& sourceRectangle, const Range2Di& destinationRectangle, FramebufferBlitMask mask, FramebufferBlitFilter filter); + static void MAGNUM_GL_LOCAL blitImplementationANGLE(AbstractFramebuffer& source, AbstractFramebuffer& destination, const Range2Di& sourceRectangle, const Range2Di& destinationRectangle, FramebufferBlitMask mask, FramebufferBlitFilter filter); + static void MAGNUM_GL_LOCAL blitImplementationNV(AbstractFramebuffer& source, AbstractFramebuffer& destination, const Range2Di& sourceRectangle, const Range2Di& destinationRectangle, FramebufferBlitMask mask, FramebufferBlitFilter filter); #endif - void MAGNUM_LOCAL bindImplementationDefault(FramebufferTarget target); - FramebufferTarget MAGNUM_LOCAL bindImplementationDefault(); + void MAGNUM_GL_LOCAL bindImplementationDefault(FramebufferTarget target); + FramebufferTarget MAGNUM_GL_LOCAL bindImplementationDefault(); #ifdef MAGNUM_TARGET_GLES2 - void MAGNUM_LOCAL bindImplementationSingle(FramebufferTarget); - FramebufferTarget MAGNUM_LOCAL bindImplementationSingle(); + void MAGNUM_GL_LOCAL bindImplementationSingle(FramebufferTarget); + FramebufferTarget MAGNUM_GL_LOCAL bindImplementationSingle(); #endif - GLenum MAGNUM_LOCAL checkStatusImplementationDefault(FramebufferTarget target); + GLenum MAGNUM_GL_LOCAL checkStatusImplementationDefault(FramebufferTarget target); #ifdef MAGNUM_TARGET_GLES2 - GLenum MAGNUM_LOCAL checkStatusImplementationSingle(FramebufferTarget); + GLenum MAGNUM_GL_LOCAL checkStatusImplementationSingle(FramebufferTarget); #endif #ifndef MAGNUM_TARGET_GLES - GLenum MAGNUM_LOCAL checkStatusImplementationDSA(FramebufferTarget target); - GLenum MAGNUM_LOCAL checkStatusImplementationDSAEXT(FramebufferTarget target); + GLenum MAGNUM_GL_LOCAL checkStatusImplementationDSA(FramebufferTarget target); + GLenum MAGNUM_GL_LOCAL checkStatusImplementationDSAEXT(FramebufferTarget target); #endif #ifndef MAGNUM_TARGET_GLES2 - void MAGNUM_LOCAL clearImplementationDefault(GLenum buffer, GLint drawbuffer, const GLint* value); - void MAGNUM_LOCAL clearImplementationDefault(GLenum buffer, GLint drawbuffer, const GLuint* value); - void MAGNUM_LOCAL clearImplementationDefault(GLenum buffer, GLint drawbuffer, const GLfloat* value); - void MAGNUM_LOCAL clearImplementationDefault(GLenum buffer, GLfloat depth, GLint stencil); + void MAGNUM_GL_LOCAL clearImplementationDefault(GLenum buffer, GLint drawbuffer, const GLint* value); + void MAGNUM_GL_LOCAL clearImplementationDefault(GLenum buffer, GLint drawbuffer, const GLuint* value); + void MAGNUM_GL_LOCAL clearImplementationDefault(GLenum buffer, GLint drawbuffer, const GLfloat* value); + void MAGNUM_GL_LOCAL clearImplementationDefault(GLenum buffer, GLfloat depth, GLint stencil); #ifndef MAGNUM_TARGET_GLES - void MAGNUM_LOCAL clearImplementationDSA(GLenum buffer, GLint drawbuffer, const GLint* value); - void MAGNUM_LOCAL clearImplementationDSA(GLenum buffer, GLint drawbuffer, const GLuint* value); - void MAGNUM_LOCAL clearImplementationDSA(GLenum buffer, GLint drawbuffer, const GLfloat* value); - void MAGNUM_LOCAL clearImplementationDSA(GLenum buffer, GLfloat depth, GLint stencil); + void MAGNUM_GL_LOCAL clearImplementationDSA(GLenum buffer, GLint drawbuffer, const GLint* value); + void MAGNUM_GL_LOCAL clearImplementationDSA(GLenum buffer, GLint drawbuffer, const GLuint* value); + void MAGNUM_GL_LOCAL clearImplementationDSA(GLenum buffer, GLint drawbuffer, const GLfloat* value); + void MAGNUM_GL_LOCAL clearImplementationDSA(GLenum buffer, GLfloat depth, GLint stencil); #endif #endif #ifndef MAGNUM_TARGET_GLES2 - void MAGNUM_LOCAL drawBuffersImplementationDefault(GLsizei count, const GLenum* buffers); + void MAGNUM_GL_LOCAL drawBuffersImplementationDefault(GLsizei count, const GLenum* buffers); #ifndef MAGNUM_TARGET_GLES - void MAGNUM_LOCAL drawBuffersImplementationDSA(GLsizei count, const GLenum* buffers); - void MAGNUM_LOCAL drawBuffersImplementationDSAEXT(GLsizei count, const GLenum* buffers); + void MAGNUM_GL_LOCAL drawBuffersImplementationDSA(GLsizei count, const GLenum* buffers); + void MAGNUM_GL_LOCAL drawBuffersImplementationDSAEXT(GLsizei count, const GLenum* buffers); #endif #else - void MAGNUM_LOCAL drawBuffersImplementationEXT(GLsizei count, const GLenum* buffers); + void MAGNUM_GL_LOCAL drawBuffersImplementationEXT(GLsizei count, const GLenum* buffers); #ifndef MAGNUM_TARGET_WEBGL - void MAGNUM_LOCAL drawBuffersImplementationNV(GLsizei count, const GLenum* buffers); + void MAGNUM_GL_LOCAL drawBuffersImplementationNV(GLsizei count, const GLenum* buffers); #endif #endif #ifndef MAGNUM_TARGET_GLES - void MAGNUM_LOCAL drawBufferImplementationDefault(GLenum buffer); - void MAGNUM_LOCAL drawBufferImplementationDSA(GLenum buffer); - void MAGNUM_LOCAL drawBufferImplementationDSAEXT(GLenum buffer); + void MAGNUM_GL_LOCAL drawBufferImplementationDefault(GLenum buffer); + void MAGNUM_GL_LOCAL drawBufferImplementationDSA(GLenum buffer); + void MAGNUM_GL_LOCAL drawBufferImplementationDSAEXT(GLenum buffer); #endif #if !(defined(MAGNUM_TARGET_WEBGL) && defined(MAGNUM_TARGET_GLES2)) - void MAGNUM_LOCAL readBufferImplementationDefault(GLenum buffer); + void MAGNUM_GL_LOCAL readBufferImplementationDefault(GLenum buffer); #endif #ifndef MAGNUM_TARGET_GLES - void MAGNUM_LOCAL readBufferImplementationDSA(GLenum buffer); - void MAGNUM_LOCAL readBufferImplementationDSAEXT(GLenum buffer); + void MAGNUM_GL_LOCAL readBufferImplementationDSA(GLenum buffer); + void MAGNUM_GL_LOCAL readBufferImplementationDSAEXT(GLenum buffer); #endif - static void MAGNUM_LOCAL readImplementationDefault(const Range2Di& rectangle, PixelFormat format, PixelType type, std::size_t dataSize, GLvoid* data); + static void MAGNUM_GL_LOCAL readImplementationDefault(const Range2Di& rectangle, PixelFormat format, PixelType type, std::size_t dataSize, GLvoid* data); #ifndef MAGNUM_TARGET_WEBGL - static void MAGNUM_LOCAL readImplementationRobustness(const Range2Di& rectangle, PixelFormat format, PixelType type, std::size_t dataSize, GLvoid* data); + static void MAGNUM_GL_LOCAL readImplementationRobustness(const Range2Di& rectangle, PixelFormat format, PixelType type, std::size_t dataSize, GLvoid* data); #endif #ifndef MAGNUM_TARGET_GLES - static void MAGNUM_LOCAL copySub1DImplementationDefault(const Range2Di& rectangle, AbstractTexture& texture, Int level, Int offset); - static void MAGNUM_LOCAL copySub1DImplementationDSA(const Range2Di& rectangle, AbstractTexture& texture, Int level, Int offset); - static void MAGNUM_LOCAL copySub1DImplementationDSAEXT(const Range2Di& rectangle, AbstractTexture& texture, Int level, Int offset); + static void MAGNUM_GL_LOCAL copySub1DImplementationDefault(const Range2Di& rectangle, AbstractTexture& texture, Int level, Int offset); + static void MAGNUM_GL_LOCAL copySub1DImplementationDSA(const Range2Di& rectangle, AbstractTexture& texture, Int level, Int offset); + static void MAGNUM_GL_LOCAL copySub1DImplementationDSAEXT(const Range2Di& rectangle, AbstractTexture& texture, Int level, Int offset); #endif - static void MAGNUM_LOCAL copySub2DImplementationDefault(const Range2Di& rectangle, AbstractTexture& texture, GLenum textureTarget, Int level, const Vector2i& offset); + static void MAGNUM_GL_LOCAL copySub2DImplementationDefault(const Range2Di& rectangle, AbstractTexture& texture, GLenum textureTarget, Int level, const Vector2i& offset); #ifndef MAGNUM_TARGET_GLES - static void MAGNUM_LOCAL copySub2DImplementationDSA(const Range2Di& rectangle, AbstractTexture& texture, GLenum textureTarget, Int level, const Vector2i& offset); - static void MAGNUM_LOCAL copySubCubeMapImplementationDSA(const Range2Di& rectangle, AbstractTexture& texture, GLenum textureTarget, Int level, const Vector2i& offset); - static void MAGNUM_LOCAL copySub2DImplementationDSAEXT(const Range2Di& rectangle, AbstractTexture& texture, GLenum textureTarget, Int level, const Vector2i& offset); + static void MAGNUM_GL_LOCAL copySub2DImplementationDSA(const Range2Di& rectangle, AbstractTexture& texture, GLenum textureTarget, Int level, const Vector2i& offset); + static void MAGNUM_GL_LOCAL copySubCubeMapImplementationDSA(const Range2Di& rectangle, AbstractTexture& texture, GLenum textureTarget, Int level, const Vector2i& offset); + static void MAGNUM_GL_LOCAL copySub2DImplementationDSAEXT(const Range2Di& rectangle, AbstractTexture& texture, GLenum textureTarget, Int level, const Vector2i& offset); #endif #if !(defined(MAGNUM_TARGET_GLES2) && defined(MAGNUM_TARGET_WEBGL)) - static void MAGNUM_LOCAL copySub3DImplementationDefault(const Range2Di& rectangle, AbstractTexture& texture, Int level, const Vector3i& offset); + static void MAGNUM_GL_LOCAL copySub3DImplementationDefault(const Range2Di& rectangle, AbstractTexture& texture, Int level, const Vector3i& offset); #endif #ifndef MAGNUM_TARGET_GLES - static void MAGNUM_LOCAL copySub3DImplementationDSA(const Range2Di& rectangle, AbstractTexture& texture, Int level, const Vector3i& offset); - static void MAGNUM_LOCAL copySub3DImplementationDSAEXT(const Range2Di& rectangle, AbstractTexture& texture, Int level, const Vector3i& offset); + static void MAGNUM_GL_LOCAL copySub3DImplementationDSA(const Range2Di& rectangle, AbstractTexture& texture, Int level, const Vector3i& offset); + static void MAGNUM_GL_LOCAL copySub3DImplementationDSAEXT(const Range2Di& rectangle, AbstractTexture& texture, Int level, const Vector3i& offset); #endif - void MAGNUM_LOCAL invalidateImplementationNoOp(GLsizei, const GLenum*); - void MAGNUM_LOCAL invalidateImplementationDefault(GLsizei count, const GLenum* attachments); + void MAGNUM_GL_LOCAL invalidateImplementationNoOp(GLsizei, const GLenum*); + void MAGNUM_GL_LOCAL invalidateImplementationDefault(GLsizei count, const GLenum* attachments); #ifndef MAGNUM_TARGET_GLES - void MAGNUM_LOCAL invalidateImplementationDSA(GLsizei count, const GLenum* attachments); + void MAGNUM_GL_LOCAL invalidateImplementationDSA(GLsizei count, const GLenum* attachments); #endif #ifndef MAGNUM_TARGET_GLES2 - void MAGNUM_LOCAL invalidateImplementationNoOp(GLsizei, const GLenum*, const Range2Di&); - void MAGNUM_LOCAL invalidateImplementationDefault(GLsizei count, const GLenum* attachments, const Range2Di& rectangle); + void MAGNUM_GL_LOCAL invalidateImplementationNoOp(GLsizei, const GLenum*, const Range2Di&); + void MAGNUM_GL_LOCAL invalidateImplementationDefault(GLsizei count, const GLenum* attachments, const Range2Di& rectangle); #ifndef MAGNUM_TARGET_GLES - void MAGNUM_LOCAL invalidateImplementationDSA(GLsizei count, const GLenum* attachments, const Range2Di& rectangle); + void MAGNUM_GL_LOCAL invalidateImplementationDSA(GLsizei count, const GLenum* attachments, const Range2Di& rectangle); #endif #endif }; diff --git a/src/Magnum/AbstractObject.cpp b/src/Magnum/GL/AbstractObject.cpp similarity index 97% rename from src/Magnum/AbstractObject.cpp rename to src/Magnum/GL/AbstractObject.cpp index d7d8007d7..9ec47f725 100644 --- a/src/Magnum/AbstractObject.cpp +++ b/src/Magnum/GL/AbstractObject.cpp @@ -28,12 +28,11 @@ #include #include -#include "Magnum/Context.h" -#include "Magnum/Extensions.h" - -#include "Implementation/State.h" +#include "Magnum/GL/Context.h" +#include "Magnum/GL/Extensions.h" +#include "Magnum/GL/Implementation/State.h" #ifndef MAGNUM_TARGET_WEBGL -#include "Implementation/DebugState.h" +#include "Magnum/GL/Implementation/DebugState.h" #endif namespace Magnum { diff --git a/src/Magnum/AbstractObject.h b/src/Magnum/GL/AbstractObject.h similarity index 78% rename from src/Magnum/AbstractObject.h rename to src/Magnum/GL/AbstractObject.h index ec04c195f..7e293dafa 100644 --- a/src/Magnum/AbstractObject.h +++ b/src/Magnum/GL/AbstractObject.h @@ -1,5 +1,5 @@ -#ifndef Magnum_AbstractObject_h -#define Magnum_AbstractObject_h +#ifndef Magnum_GL_AbstractObject_h +#define Magnum_GL_AbstractObject_h /* This file is part of Magnum. @@ -33,8 +33,8 @@ #include #include "Magnum/Magnum.h" -#include "Magnum/OpenGL.h" -#include "Magnum/visibility.h" +#include "Magnum/GL/OpenGL.h" +#include "Magnum/GL/visibility.h" namespace Magnum { @@ -79,7 +79,7 @@ typedef Containers::EnumSet ObjectFlags; /** @brief Base for all OpenGL objects */ -class MAGNUM_EXPORT AbstractObject { +class MAGNUM_GL_EXPORT AbstractObject { friend Implementation::DebugState; public: @@ -105,26 +105,26 @@ class MAGNUM_EXPORT AbstractObject { #endif protected: - MAGNUM_LOCAL AbstractObject() = default; - MAGNUM_LOCAL ~AbstractObject() = default; + MAGNUM_GL_LOCAL AbstractObject() = default; + MAGNUM_GL_LOCAL ~AbstractObject() = default; private: #ifndef MAGNUM_TARGET_WEBGL - static MAGNUM_LOCAL void labelImplementationNoOp(GLenum, GLuint, Containers::ArrayView label); - static MAGNUM_LOCAL void labelImplementationExt(GLenum identifier, GLuint name, Containers::ArrayView label); + static MAGNUM_GL_LOCAL void labelImplementationNoOp(GLenum, GLuint, Containers::ArrayView label); + static MAGNUM_GL_LOCAL void labelImplementationExt(GLenum identifier, GLuint name, Containers::ArrayView label); #ifndef MAGNUM_TARGET_GLES2 - static MAGNUM_LOCAL void labelImplementationKhrDesktopES32(GLenum identifier, GLuint name, Containers::ArrayView label); + static MAGNUM_GL_LOCAL void labelImplementationKhrDesktopES32(GLenum identifier, GLuint name, Containers::ArrayView label); #endif #ifdef MAGNUM_TARGET_GLES - static MAGNUM_LOCAL void labelImplementationKhrES(GLenum identifier, GLuint name, Containers::ArrayView label); + static MAGNUM_GL_LOCAL void labelImplementationKhrES(GLenum identifier, GLuint name, Containers::ArrayView label); #endif - static MAGNUM_LOCAL std::string getLabelImplementationNoOp(GLenum, GLuint); - static MAGNUM_LOCAL std::string getLabelImplementationExt(GLenum identifier, GLuint name); + static MAGNUM_GL_LOCAL std::string getLabelImplementationNoOp(GLenum, GLuint); + static MAGNUM_GL_LOCAL std::string getLabelImplementationExt(GLenum identifier, GLuint name); #ifndef MAGNUM_TARGET_GLES2 - static MAGNUM_LOCAL std::string getLabelImplementationKhrDesktopES32(GLenum identifier, GLuint name); + static MAGNUM_GL_LOCAL std::string getLabelImplementationKhrDesktopES32(GLenum identifier, GLuint name); #endif #ifdef MAGNUM_TARGET_GLES - static MAGNUM_LOCAL std::string getLabelImplementationKhrES(GLenum identifier, GLuint name); + static MAGNUM_GL_LOCAL std::string getLabelImplementationKhrES(GLenum identifier, GLuint name); #endif #endif }; diff --git a/src/Magnum/AbstractQuery.cpp b/src/Magnum/GL/AbstractQuery.cpp similarity index 96% rename from src/Magnum/AbstractQuery.cpp rename to src/Magnum/GL/AbstractQuery.cpp index eeaaba9d7..38b51ab95 100644 --- a/src/Magnum/AbstractQuery.cpp +++ b/src/Magnum/GL/AbstractQuery.cpp @@ -27,12 +27,12 @@ #include -#include "Magnum/Context.h" +#include "Magnum/GL/Context.h" #ifndef MAGNUM_TARGET_WEBGL -#include "Magnum/Implementation/DebugState.h" +#include "Magnum/GL/Implementation/DebugState.h" #endif -#include "Magnum/Implementation/QueryState.h" -#include "Magnum/Implementation/State.h" +#include "Magnum/GL/Implementation/QueryState.h" +#include "Magnum/GL/Implementation/State.h" namespace Magnum { diff --git a/src/Magnum/AbstractQuery.h b/src/Magnum/GL/AbstractQuery.h similarity index 92% rename from src/Magnum/AbstractQuery.h rename to src/Magnum/GL/AbstractQuery.h index 23db2337c..bd33764cb 100644 --- a/src/Magnum/AbstractQuery.h +++ b/src/Magnum/GL/AbstractQuery.h @@ -1,5 +1,5 @@ -#ifndef Magnum_AbstractQuery_h -#define Magnum_AbstractQuery_h +#ifndef Magnum_GL_AbstractQuery_h +#define Magnum_GL_AbstractQuery_h /* This file is part of Magnum. @@ -34,8 +34,9 @@ #include #include -#include "Magnum/AbstractObject.h" #include "Magnum/Tags.h" +#include "Magnum/GL/AbstractObject.h" + #include "Magnum/configure.h" #if !(defined(MAGNUM_TARGET_WEBGL) && defined(MAGNUM_TARGET_GLES2)) @@ -51,7 +52,7 @@ more information. @requires_webgl20 Queries are not available in WebGL 1.0. @todo `QUERY_COUNTER_BITS` (not sure since when this is supported) */ -class MAGNUM_EXPORT AbstractQuery: public AbstractObject { +class MAGNUM_GL_EXPORT AbstractQuery: public AbstractObject { friend Implementation::QueryState; public: @@ -188,21 +189,21 @@ class MAGNUM_EXPORT AbstractQuery: public AbstractObject { AbstractQuery& setLabelInternal(Containers::ArrayView label); #endif - void MAGNUM_LOCAL createImplementationDefault(); + void MAGNUM_GL_LOCAL createImplementationDefault(); #ifndef MAGNUM_TARGET_GLES - void MAGNUM_LOCAL createImplementationDSA(); + void MAGNUM_GL_LOCAL createImplementationDSA(); #endif ObjectFlags _flags; }; #ifndef DOXYGEN_GENERATING_OUTPUT -template<> bool MAGNUM_EXPORT AbstractQuery::result(); -template<> UnsignedInt MAGNUM_EXPORT AbstractQuery::result(); -template<> Int MAGNUM_EXPORT AbstractQuery::result(); +template<> bool MAGNUM_GL_EXPORT AbstractQuery::result(); +template<> UnsignedInt MAGNUM_GL_EXPORT AbstractQuery::result(); +template<> Int MAGNUM_GL_EXPORT AbstractQuery::result(); #ifndef MAGNUM_TARGET_WEBGL -template<> UnsignedLong MAGNUM_EXPORT AbstractQuery::result(); -template<> Long MAGNUM_EXPORT AbstractQuery::result(); +template<> UnsignedLong MAGNUM_GL_EXPORT AbstractQuery::result(); +template<> Long MAGNUM_GL_EXPORT AbstractQuery::result(); #endif #endif diff --git a/src/Magnum/AbstractShaderProgram.cpp b/src/Magnum/GL/AbstractShaderProgram.cpp similarity index 99% rename from src/Magnum/AbstractShaderProgram.cpp rename to src/Magnum/GL/AbstractShaderProgram.cpp index bfba6ed54..b9d2e98f5 100644 --- a/src/Magnum/AbstractShaderProgram.cpp +++ b/src/Magnum/GL/AbstractShaderProgram.cpp @@ -27,16 +27,15 @@ #include -#include "Magnum/Context.h" -#include "Magnum/Extensions.h" -#include "Magnum/Shader.h" -#include "Magnum/Math/RectangularMatrix.h" - +#include "Magnum/GL/Context.h" +#include "Magnum/GL/Extensions.h" +#include "Magnum/GL/Shader.h" #ifndef MAGNUM_TARGET_WEBGL -#include "Implementation/DebugState.h" +#include "Magnum/GL/Implementation/DebugState.h" #endif -#include "Implementation/ShaderProgramState.h" -#include "Implementation/State.h" +#include "Magnum/GL/Implementation/ShaderProgramState.h" +#include "Magnum/GL/Implementation/State.h" +#include "Magnum/Math/RectangularMatrix.h" namespace Magnum { diff --git a/src/Magnum/AbstractShaderProgram.h b/src/Magnum/GL/AbstractShaderProgram.h similarity index 79% rename from src/Magnum/AbstractShaderProgram.h rename to src/Magnum/GL/AbstractShaderProgram.h index 883818d55..7eb022350 100644 --- a/src/Magnum/AbstractShaderProgram.h +++ b/src/Magnum/GL/AbstractShaderProgram.h @@ -1,5 +1,5 @@ -#ifndef Magnum_AbstractShaderProgram_h -#define Magnum_AbstractShaderProgram_h +#ifndef Magnum_GL_AbstractShaderProgram_h +#define Magnum_GL_AbstractShaderProgram_h /* This file is part of Magnum. @@ -33,9 +33,10 @@ #include #include -#include "Magnum/AbstractObject.h" -#include "Magnum/Attribute.h" #include "Magnum/Tags.h" +#include "Magnum/GL/AbstractObject.h" +#include "Magnum/GL/Attribute.h" +#include "Magnum/GL/GL.h" #if defined(CORRADE_TARGET_WINDOWS) && !defined(MAGNUM_TARGET_GLES2) #include @@ -57,35 +58,35 @@ functions and properties:
  • **Attribute definitions** with location and type for configuring meshes, for example: - @snippet Magnum.cpp AbstractShaderProgram-input-attributes + @snippet MagnumGL.cpp AbstractShaderProgram-input-attributes
  • **Output attribute locations**, if desired, for example: - @snippet Magnum.cpp AbstractShaderProgram-output-attributes + @snippet MagnumGL.cpp AbstractShaderProgram-output-attributes
  • **Constructor**, which loads, compiles and attaches particular shaders and links the program together, for example: - @snippet Magnum.cpp AbstractShaderProgram-constructor + @snippet MagnumGL.cpp AbstractShaderProgram-constructor
  • **Uniform setting functions**, which will provide public interface for protected @ref setUniform() functions. For usability purposes you can implement also method chaining. Example: - @snippet Magnum.cpp AbstractShaderProgram-uniforms + @snippet MagnumGL.cpp AbstractShaderProgram-uniforms
  • **Texture and texture image binding functions** in which you bind the textures/images to particular texture/image units using @ref Texture::bind() "*Texture::bind()" / @ref Texture::bindImage() "*Texture::bindImage()" and similar, for example: - @snippet Magnum.cpp AbstractShaderProgram-textures + @snippet MagnumGL.cpp AbstractShaderProgram-textures
  • **Transform feedback setup function**, if needed, in which you bind buffers to particular indices using @ref TransformFeedback::attachBuffer() and similar, possibly with overloads based on desired use cases, e.g.: - @snippet Magnum.cpp AbstractShaderProgram-xfb + @snippet MagnumGL.cpp AbstractShaderProgram-xfb
  • @subsection AbstractShaderProgram-attribute-location Binding attribute location @@ -128,7 +129,7 @@ out vec4 color; out vec3 normal; @endcode -@snippet Magnum.cpp AbstractShaderProgram-binding +@snippet MagnumGL.cpp AbstractShaderProgram-binding @see @ref maxVertexAttributes(), @ref AbstractFramebuffer::maxDrawBuffers() @requires_gl30 Extension @extension{EXT,gpu_shader4} for using @@ -179,7 +180,7 @@ uniform mat4 transformationMatrix; uniform mat3 normalMatrix; @endcode -@snippet Magnum.cpp AbstractShaderProgram-uniform-location +@snippet MagnumGL.cpp AbstractShaderProgram-uniform-location @see @ref maxUniformLocations() @requires_gl43 Extension @extension{ARB,explicit_uniform_location} for @@ -224,7 +225,7 @@ layout(std140) uniform material { }; @endcode -@snippet Magnum.cpp AbstractShaderProgram-uniform-block-binding +@snippet MagnumGL.cpp AbstractShaderProgram-uniform-block-binding @see @ref Buffer::maxUniformBindings() @requires_gl31 Extension @extension{ARB,uniform_buffer_object} @@ -282,7 +283,7 @@ uniform sampler2D diffuseTexture; uniform sampler2D specularTexture; @endcode -@snippet Magnum.cpp AbstractShaderProgram-texture-uniforms +@snippet MagnumGL.cpp AbstractShaderProgram-texture-uniforms @see @ref Shader::maxTextureImageUnits(), @ref maxImageUnits() @requires_gl42 Extension @extension{ARB,shading_language_420pack} for explicit @@ -321,7 +322,7 @@ out block { out vec3 velocity; @endcode -@snippet Magnum.cpp AbstractShaderProgram-xfb-outputs +@snippet MagnumGL.cpp AbstractShaderProgram-xfb-outputs @see @ref TransformFeedback::maxInterleavedComponents(), @ref TransformFeedback::maxSeparateAttributes(), @@ -347,7 +348,7 @@ needed (see @ref Framebuffer-usage "Framebuffer documentation" for more information). In each draw event set all required shader parameters, bind specific framebuffer (if needed) and then call @ref Mesh::draw(). Example: -@snippet Magnum.cpp AbstractShaderProgram-rendering +@snippet MagnumGL.cpp AbstractShaderProgram-rendering @section AbstractShaderProgram-compute-workflow Compute workflow @@ -407,7 +408,7 @@ comes in handy. @todo `GL_NUM_{PROGRAM,SHADER}_BINARY_FORMATS` + `GL_{PROGRAM,SHADER}_BINARY_FORMATS` (vector), (@extension{ARB,ES2_compatibility}) */ -class MAGNUM_EXPORT AbstractShaderProgram: public AbstractObject { +class MAGNUM_GL_EXPORT AbstractShaderProgram: public AbstractObject { friend Mesh; friend MeshView; #ifndef MAGNUM_TARGET_GLES2 @@ -1129,9 +1130,9 @@ class MAGNUM_EXPORT AbstractShaderProgram: public AbstractObject { UnsignedInt uniformBlockIndexInternal(Containers::ArrayView name); #ifndef MAGNUM_TARGET_GLES2 - void MAGNUM_LOCAL transformFeedbackVaryingsImplementationDefault(Containers::ArrayView outputs, TransformFeedbackBufferMode bufferMode); + void MAGNUM_GL_LOCAL transformFeedbackVaryingsImplementationDefault(Containers::ArrayView outputs, TransformFeedbackBufferMode bufferMode); #ifdef CORRADE_TARGET_WINDOWS - void MAGNUM_LOCAL transformFeedbackVaryingsImplementationDanglingWorkaround(Containers::ArrayView outputs, TransformFeedbackBufferMode bufferMode); + void MAGNUM_GL_LOCAL transformFeedbackVaryingsImplementationDanglingWorkaround(Containers::ArrayView outputs, TransformFeedbackBufferMode bufferMode); #endif #endif @@ -1158,136 +1159,136 @@ class MAGNUM_EXPORT AbstractShaderProgram: public AbstractObject { on ES (double arguments) don't have the _SSOEXT suffix */ - void MAGNUM_LOCAL uniformImplementationDefault(GLint location, GLsizei count, const GLfloat* values); - void MAGNUM_LOCAL uniformImplementationDefault(GLint location, GLsizei count, const Math::Vector<2, GLfloat>* values); - void MAGNUM_LOCAL uniformImplementationDefault(GLint location, GLsizei count, const Math::Vector<3, GLfloat>* values); - void MAGNUM_LOCAL uniformImplementationDefault(GLint location, GLsizei count, const Math::Vector<4, GLfloat>* values); - void MAGNUM_LOCAL uniformImplementationDefault(GLint location, GLsizei count, const GLint* values); - void MAGNUM_LOCAL uniformImplementationDefault(GLint location, GLsizei count, const Math::Vector<2, GLint>* values); - void MAGNUM_LOCAL uniformImplementationDefault(GLint location, GLsizei count, const Math::Vector<3, GLint>* values); - void MAGNUM_LOCAL uniformImplementationDefault(GLint location, GLsizei count, const Math::Vector<4, GLint>* values); + void MAGNUM_GL_LOCAL uniformImplementationDefault(GLint location, GLsizei count, const GLfloat* values); + void MAGNUM_GL_LOCAL uniformImplementationDefault(GLint location, GLsizei count, const Math::Vector<2, GLfloat>* values); + void MAGNUM_GL_LOCAL uniformImplementationDefault(GLint location, GLsizei count, const Math::Vector<3, GLfloat>* values); + void MAGNUM_GL_LOCAL uniformImplementationDefault(GLint location, GLsizei count, const Math::Vector<4, GLfloat>* values); + void MAGNUM_GL_LOCAL uniformImplementationDefault(GLint location, GLsizei count, const GLint* values); + void MAGNUM_GL_LOCAL uniformImplementationDefault(GLint location, GLsizei count, const Math::Vector<2, GLint>* values); + void MAGNUM_GL_LOCAL uniformImplementationDefault(GLint location, GLsizei count, const Math::Vector<3, GLint>* values); + void MAGNUM_GL_LOCAL uniformImplementationDefault(GLint location, GLsizei count, const Math::Vector<4, GLint>* values); #ifndef MAGNUM_TARGET_GLES2 - void MAGNUM_LOCAL uniformImplementationDefault(GLint location, GLsizei count, const GLuint* values); - void MAGNUM_LOCAL uniformImplementationDefault(GLint location, GLsizei count, const Math::Vector<2, GLuint>* values); - void MAGNUM_LOCAL uniformImplementationDefault(GLint location, GLsizei count, const Math::Vector<3, GLuint>* values); - void MAGNUM_LOCAL uniformImplementationDefault(GLint location, GLsizei count, const Math::Vector<4, GLuint>* values); + void MAGNUM_GL_LOCAL uniformImplementationDefault(GLint location, GLsizei count, const GLuint* values); + void MAGNUM_GL_LOCAL uniformImplementationDefault(GLint location, GLsizei count, const Math::Vector<2, GLuint>* values); + void MAGNUM_GL_LOCAL uniformImplementationDefault(GLint location, GLsizei count, const Math::Vector<3, GLuint>* values); + void MAGNUM_GL_LOCAL uniformImplementationDefault(GLint location, GLsizei count, const Math::Vector<4, GLuint>* values); #endif #ifndef MAGNUM_TARGET_GLES - void MAGNUM_LOCAL uniformImplementationDefault(GLint location, GLsizei count, const GLdouble* values); - void MAGNUM_LOCAL uniformImplementationDefault(GLint location, GLsizei count, const Math::Vector<2, GLdouble>* values); - void MAGNUM_LOCAL uniformImplementationDefault(GLint location, GLsizei count, const Math::Vector<3, GLdouble>* values); - void MAGNUM_LOCAL uniformImplementationDefault(GLint location, GLsizei count, const Math::Vector<4, GLdouble>* values); + void MAGNUM_GL_LOCAL uniformImplementationDefault(GLint location, GLsizei count, const GLdouble* values); + void MAGNUM_GL_LOCAL uniformImplementationDefault(GLint location, GLsizei count, const Math::Vector<2, GLdouble>* values); + void MAGNUM_GL_LOCAL uniformImplementationDefault(GLint location, GLsizei count, const Math::Vector<3, GLdouble>* values); + void MAGNUM_GL_LOCAL uniformImplementationDefault(GLint location, GLsizei count, const Math::Vector<4, GLdouble>* values); #endif #if !defined(MAGNUM_TARGET_GLES2) && !defined(MAGNUM_TARGET_WEBGL) - void MAGNUM_LOCAL uniformImplementationSSO(GLint location, GLsizei count, const GLfloat* values); - void MAGNUM_LOCAL uniformImplementationSSO(GLint location, GLsizei count, const Math::Vector<2, GLfloat>* values); - void MAGNUM_LOCAL uniformImplementationSSO(GLint location, GLsizei count, const Math::Vector<3, GLfloat>* values); - void MAGNUM_LOCAL uniformImplementationSSO(GLint location, GLsizei count, const Math::Vector<4, GLfloat>* values); - void MAGNUM_LOCAL uniformImplementationSSO(GLint location, GLsizei count, const GLint* values); - void MAGNUM_LOCAL uniformImplementationSSO(GLint location, GLsizei count, const Math::Vector<2, GLint>* values); - void MAGNUM_LOCAL uniformImplementationSSO(GLint location, GLsizei count, const Math::Vector<3, GLint>* values); - void MAGNUM_LOCAL uniformImplementationSSO(GLint location, GLsizei count, const Math::Vector<4, GLint>* values); - void MAGNUM_LOCAL uniformImplementationSSO(GLint location, GLsizei count, const GLuint* values); - void MAGNUM_LOCAL uniformImplementationSSO(GLint location, GLsizei count, const Math::Vector<2, GLuint>* values); - void MAGNUM_LOCAL uniformImplementationSSO(GLint location, GLsizei count, const Math::Vector<3, GLuint>* values); - void MAGNUM_LOCAL uniformImplementationSSO(GLint location, GLsizei count, const Math::Vector<4, GLuint>* values); + void MAGNUM_GL_LOCAL uniformImplementationSSO(GLint location, GLsizei count, const GLfloat* values); + void MAGNUM_GL_LOCAL uniformImplementationSSO(GLint location, GLsizei count, const Math::Vector<2, GLfloat>* values); + void MAGNUM_GL_LOCAL uniformImplementationSSO(GLint location, GLsizei count, const Math::Vector<3, GLfloat>* values); + void MAGNUM_GL_LOCAL uniformImplementationSSO(GLint location, GLsizei count, const Math::Vector<4, GLfloat>* values); + void MAGNUM_GL_LOCAL uniformImplementationSSO(GLint location, GLsizei count, const GLint* values); + void MAGNUM_GL_LOCAL uniformImplementationSSO(GLint location, GLsizei count, const Math::Vector<2, GLint>* values); + void MAGNUM_GL_LOCAL uniformImplementationSSO(GLint location, GLsizei count, const Math::Vector<3, GLint>* values); + void MAGNUM_GL_LOCAL uniformImplementationSSO(GLint location, GLsizei count, const Math::Vector<4, GLint>* values); + void MAGNUM_GL_LOCAL uniformImplementationSSO(GLint location, GLsizei count, const GLuint* values); + void MAGNUM_GL_LOCAL uniformImplementationSSO(GLint location, GLsizei count, const Math::Vector<2, GLuint>* values); + void MAGNUM_GL_LOCAL uniformImplementationSSO(GLint location, GLsizei count, const Math::Vector<3, GLuint>* values); + void MAGNUM_GL_LOCAL uniformImplementationSSO(GLint location, GLsizei count, const Math::Vector<4, GLuint>* values); #endif #ifndef MAGNUM_TARGET_GLES - void MAGNUM_LOCAL uniformImplementationSSO(GLint location, GLsizei count, const GLdouble* values); - void MAGNUM_LOCAL uniformImplementationSSO(GLint location, GLsizei count, const Math::Vector<2, GLdouble>* values); - void MAGNUM_LOCAL uniformImplementationSSO(GLint location, GLsizei count, const Math::Vector<3, GLdouble>* values); - void MAGNUM_LOCAL uniformImplementationSSO(GLint location, GLsizei count, const Math::Vector<4, GLdouble>* values); + void MAGNUM_GL_LOCAL uniformImplementationSSO(GLint location, GLsizei count, const GLdouble* values); + void MAGNUM_GL_LOCAL uniformImplementationSSO(GLint location, GLsizei count, const Math::Vector<2, GLdouble>* values); + void MAGNUM_GL_LOCAL uniformImplementationSSO(GLint location, GLsizei count, const Math::Vector<3, GLdouble>* values); + void MAGNUM_GL_LOCAL uniformImplementationSSO(GLint location, GLsizei count, const Math::Vector<4, GLdouble>* values); #endif #ifndef MAGNUM_TARGET_WEBGL - void MAGNUM_LOCAL uniformImplementationDSAEXT_SSOEXT(GLint location, GLsizei count, const GLfloat* values); - void MAGNUM_LOCAL uniformImplementationDSAEXT_SSOEXT(GLint location, GLsizei count, const Math::Vector<2, GLfloat>* values); - void MAGNUM_LOCAL uniformImplementationDSAEXT_SSOEXT(GLint location, GLsizei count, const Math::Vector<3, GLfloat>* values); - void MAGNUM_LOCAL uniformImplementationDSAEXT_SSOEXT(GLint location, GLsizei count, const Math::Vector<4, GLfloat>* values); - void MAGNUM_LOCAL uniformImplementationDSAEXT_SSOEXT(GLint location, GLsizei count, const GLint* values); - void MAGNUM_LOCAL uniformImplementationDSAEXT_SSOEXT(GLint location, GLsizei count, const Math::Vector<2, GLint>* values); - void MAGNUM_LOCAL uniformImplementationDSAEXT_SSOEXT(GLint location, GLsizei count, const Math::Vector<3, GLint>* values); - void MAGNUM_LOCAL uniformImplementationDSAEXT_SSOEXT(GLint location, GLsizei count, const Math::Vector<4, GLint>* values); + void MAGNUM_GL_LOCAL uniformImplementationDSAEXT_SSOEXT(GLint location, GLsizei count, const GLfloat* values); + void MAGNUM_GL_LOCAL uniformImplementationDSAEXT_SSOEXT(GLint location, GLsizei count, const Math::Vector<2, GLfloat>* values); + void MAGNUM_GL_LOCAL uniformImplementationDSAEXT_SSOEXT(GLint location, GLsizei count, const Math::Vector<3, GLfloat>* values); + void MAGNUM_GL_LOCAL uniformImplementationDSAEXT_SSOEXT(GLint location, GLsizei count, const Math::Vector<4, GLfloat>* values); + void MAGNUM_GL_LOCAL uniformImplementationDSAEXT_SSOEXT(GLint location, GLsizei count, const GLint* values); + void MAGNUM_GL_LOCAL uniformImplementationDSAEXT_SSOEXT(GLint location, GLsizei count, const Math::Vector<2, GLint>* values); + void MAGNUM_GL_LOCAL uniformImplementationDSAEXT_SSOEXT(GLint location, GLsizei count, const Math::Vector<3, GLint>* values); + void MAGNUM_GL_LOCAL uniformImplementationDSAEXT_SSOEXT(GLint location, GLsizei count, const Math::Vector<4, GLint>* values); #ifndef MAGNUM_TARGET_GLES2 - void MAGNUM_LOCAL uniformImplementationDSAEXT_SSOEXT(GLint location, GLsizei count, const GLuint* values); - void MAGNUM_LOCAL uniformImplementationDSAEXT_SSOEXT(GLint location, GLsizei count, const Math::Vector<2, GLuint>* values); - void MAGNUM_LOCAL uniformImplementationDSAEXT_SSOEXT(GLint location, GLsizei count, const Math::Vector<3, GLuint>* values); - void MAGNUM_LOCAL uniformImplementationDSAEXT_SSOEXT(GLint location, GLsizei count, const Math::Vector<4, GLuint>* values); + void MAGNUM_GL_LOCAL uniformImplementationDSAEXT_SSOEXT(GLint location, GLsizei count, const GLuint* values); + void MAGNUM_GL_LOCAL uniformImplementationDSAEXT_SSOEXT(GLint location, GLsizei count, const Math::Vector<2, GLuint>* values); + void MAGNUM_GL_LOCAL uniformImplementationDSAEXT_SSOEXT(GLint location, GLsizei count, const Math::Vector<3, GLuint>* values); + void MAGNUM_GL_LOCAL uniformImplementationDSAEXT_SSOEXT(GLint location, GLsizei count, const Math::Vector<4, GLuint>* values); #endif #endif #ifndef MAGNUM_TARGET_GLES - void MAGNUM_LOCAL uniformImplementationDSAEXT(GLint location, GLsizei count, const GLdouble* values); - void MAGNUM_LOCAL uniformImplementationDSAEXT(GLint location, GLsizei count, const Math::Vector<2, GLdouble>* values); - void MAGNUM_LOCAL uniformImplementationDSAEXT(GLint location, GLsizei count, const Math::Vector<3, GLdouble>* values); - void MAGNUM_LOCAL uniformImplementationDSAEXT(GLint location, GLsizei count, const Math::Vector<4, GLdouble>* values); + void MAGNUM_GL_LOCAL uniformImplementationDSAEXT(GLint location, GLsizei count, const GLdouble* values); + void MAGNUM_GL_LOCAL uniformImplementationDSAEXT(GLint location, GLsizei count, const Math::Vector<2, GLdouble>* values); + void MAGNUM_GL_LOCAL uniformImplementationDSAEXT(GLint location, GLsizei count, const Math::Vector<3, GLdouble>* values); + void MAGNUM_GL_LOCAL uniformImplementationDSAEXT(GLint location, GLsizei count, const Math::Vector<4, GLdouble>* values); #endif - void MAGNUM_LOCAL uniformImplementationDefault(GLint location, GLsizei count, const Math::RectangularMatrix<2, 2, GLfloat>* values); - void MAGNUM_LOCAL uniformImplementationDefault(GLint location, GLsizei count, const Math::RectangularMatrix<3, 3, GLfloat>* values); - void MAGNUM_LOCAL uniformImplementationDefault(GLint location, GLsizei count, const Math::RectangularMatrix<4, 4, GLfloat>* values); + void MAGNUM_GL_LOCAL uniformImplementationDefault(GLint location, GLsizei count, const Math::RectangularMatrix<2, 2, GLfloat>* values); + void MAGNUM_GL_LOCAL uniformImplementationDefault(GLint location, GLsizei count, const Math::RectangularMatrix<3, 3, GLfloat>* values); + void MAGNUM_GL_LOCAL uniformImplementationDefault(GLint location, GLsizei count, const Math::RectangularMatrix<4, 4, GLfloat>* values); #ifndef MAGNUM_TARGET_GLES2 - void MAGNUM_LOCAL uniformImplementationDefault(GLint location, GLsizei count, const Math::RectangularMatrix<2, 3, GLfloat>* values); - void MAGNUM_LOCAL uniformImplementationDefault(GLint location, GLsizei count, const Math::RectangularMatrix<3, 2, GLfloat>* values); - void MAGNUM_LOCAL uniformImplementationDefault(GLint location, GLsizei count, const Math::RectangularMatrix<2, 4, GLfloat>* values); - void MAGNUM_LOCAL uniformImplementationDefault(GLint location, GLsizei count, const Math::RectangularMatrix<4, 2, GLfloat>* values); - void MAGNUM_LOCAL uniformImplementationDefault(GLint location, GLsizei count, const Math::RectangularMatrix<3, 4, GLfloat>* values); - void MAGNUM_LOCAL uniformImplementationDefault(GLint location, GLsizei count, const Math::RectangularMatrix<4, 3, GLfloat>* values); + void MAGNUM_GL_LOCAL uniformImplementationDefault(GLint location, GLsizei count, const Math::RectangularMatrix<2, 3, GLfloat>* values); + void MAGNUM_GL_LOCAL uniformImplementationDefault(GLint location, GLsizei count, const Math::RectangularMatrix<3, 2, GLfloat>* values); + void MAGNUM_GL_LOCAL uniformImplementationDefault(GLint location, GLsizei count, const Math::RectangularMatrix<2, 4, GLfloat>* values); + void MAGNUM_GL_LOCAL uniformImplementationDefault(GLint location, GLsizei count, const Math::RectangularMatrix<4, 2, GLfloat>* values); + void MAGNUM_GL_LOCAL uniformImplementationDefault(GLint location, GLsizei count, const Math::RectangularMatrix<3, 4, GLfloat>* values); + void MAGNUM_GL_LOCAL uniformImplementationDefault(GLint location, GLsizei count, const Math::RectangularMatrix<4, 3, GLfloat>* values); #endif #ifndef MAGNUM_TARGET_GLES - void MAGNUM_LOCAL uniformImplementationDefault(GLint location, GLsizei count, const Math::RectangularMatrix<2, 2, GLdouble>* values); - void MAGNUM_LOCAL uniformImplementationDefault(GLint location, GLsizei count, const Math::RectangularMatrix<3, 3, GLdouble>* values); - void MAGNUM_LOCAL uniformImplementationDefault(GLint location, GLsizei count, const Math::RectangularMatrix<4, 4, GLdouble>* values); - void MAGNUM_LOCAL uniformImplementationDefault(GLint location, GLsizei count, const Math::RectangularMatrix<2, 3, GLdouble>* values); - void MAGNUM_LOCAL uniformImplementationDefault(GLint location, GLsizei count, const Math::RectangularMatrix<3, 2, GLdouble>* values); - void MAGNUM_LOCAL uniformImplementationDefault(GLint location, GLsizei count, const Math::RectangularMatrix<2, 4, GLdouble>* values); - void MAGNUM_LOCAL uniformImplementationDefault(GLint location, GLsizei count, const Math::RectangularMatrix<4, 2, GLdouble>* values); - void MAGNUM_LOCAL uniformImplementationDefault(GLint location, GLsizei count, const Math::RectangularMatrix<3, 4, GLdouble>* values); - void MAGNUM_LOCAL uniformImplementationDefault(GLint location, GLsizei count, const Math::RectangularMatrix<4, 3, GLdouble>* values); + void MAGNUM_GL_LOCAL uniformImplementationDefault(GLint location, GLsizei count, const Math::RectangularMatrix<2, 2, GLdouble>* values); + void MAGNUM_GL_LOCAL uniformImplementationDefault(GLint location, GLsizei count, const Math::RectangularMatrix<3, 3, GLdouble>* values); + void MAGNUM_GL_LOCAL uniformImplementationDefault(GLint location, GLsizei count, const Math::RectangularMatrix<4, 4, GLdouble>* values); + void MAGNUM_GL_LOCAL uniformImplementationDefault(GLint location, GLsizei count, const Math::RectangularMatrix<2, 3, GLdouble>* values); + void MAGNUM_GL_LOCAL uniformImplementationDefault(GLint location, GLsizei count, const Math::RectangularMatrix<3, 2, GLdouble>* values); + void MAGNUM_GL_LOCAL uniformImplementationDefault(GLint location, GLsizei count, const Math::RectangularMatrix<2, 4, GLdouble>* values); + void MAGNUM_GL_LOCAL uniformImplementationDefault(GLint location, GLsizei count, const Math::RectangularMatrix<4, 2, GLdouble>* values); + void MAGNUM_GL_LOCAL uniformImplementationDefault(GLint location, GLsizei count, const Math::RectangularMatrix<3, 4, GLdouble>* values); + void MAGNUM_GL_LOCAL uniformImplementationDefault(GLint location, GLsizei count, const Math::RectangularMatrix<4, 3, GLdouble>* values); #endif #if !defined(MAGNUM_TARGET_GLES2) && !defined(MAGNUM_TARGET_WEBGL) - void MAGNUM_LOCAL uniformImplementationSSO(GLint location, GLsizei count, const Math::RectangularMatrix<2, 2, GLfloat>* values); - void MAGNUM_LOCAL uniformImplementationSSO(GLint location, GLsizei count, const Math::RectangularMatrix<3, 3, GLfloat>* values); - void MAGNUM_LOCAL uniformImplementationSSO(GLint location, GLsizei count, const Math::RectangularMatrix<4, 4, GLfloat>* values); - void MAGNUM_LOCAL uniformImplementationSSO(GLint location, GLsizei count, const Math::RectangularMatrix<2, 3, GLfloat>* values); - void MAGNUM_LOCAL uniformImplementationSSO(GLint location, GLsizei count, const Math::RectangularMatrix<3, 2, GLfloat>* values); - void MAGNUM_LOCAL uniformImplementationSSO(GLint location, GLsizei count, const Math::RectangularMatrix<2, 4, GLfloat>* values); - void MAGNUM_LOCAL uniformImplementationSSO(GLint location, GLsizei count, const Math::RectangularMatrix<4, 2, GLfloat>* values); - void MAGNUM_LOCAL uniformImplementationSSO(GLint location, GLsizei count, const Math::RectangularMatrix<3, 4, GLfloat>* values); - void MAGNUM_LOCAL uniformImplementationSSO(GLint location, GLsizei count, const Math::RectangularMatrix<4, 3, GLfloat>* values); + void MAGNUM_GL_LOCAL uniformImplementationSSO(GLint location, GLsizei count, const Math::RectangularMatrix<2, 2, GLfloat>* values); + void MAGNUM_GL_LOCAL uniformImplementationSSO(GLint location, GLsizei count, const Math::RectangularMatrix<3, 3, GLfloat>* values); + void MAGNUM_GL_LOCAL uniformImplementationSSO(GLint location, GLsizei count, const Math::RectangularMatrix<4, 4, GLfloat>* values); + void MAGNUM_GL_LOCAL uniformImplementationSSO(GLint location, GLsizei count, const Math::RectangularMatrix<2, 3, GLfloat>* values); + void MAGNUM_GL_LOCAL uniformImplementationSSO(GLint location, GLsizei count, const Math::RectangularMatrix<3, 2, GLfloat>* values); + void MAGNUM_GL_LOCAL uniformImplementationSSO(GLint location, GLsizei count, const Math::RectangularMatrix<2, 4, GLfloat>* values); + void MAGNUM_GL_LOCAL uniformImplementationSSO(GLint location, GLsizei count, const Math::RectangularMatrix<4, 2, GLfloat>* values); + void MAGNUM_GL_LOCAL uniformImplementationSSO(GLint location, GLsizei count, const Math::RectangularMatrix<3, 4, GLfloat>* values); + void MAGNUM_GL_LOCAL uniformImplementationSSO(GLint location, GLsizei count, const Math::RectangularMatrix<4, 3, GLfloat>* values); #endif #ifndef MAGNUM_TARGET_GLES - void MAGNUM_LOCAL uniformImplementationSSO(GLint location, GLsizei count, const Math::RectangularMatrix<2, 2, GLdouble>* values); - void MAGNUM_LOCAL uniformImplementationSSO(GLint location, GLsizei count, const Math::RectangularMatrix<3, 3, GLdouble>* values); - void MAGNUM_LOCAL uniformImplementationSSO(GLint location, GLsizei count, const Math::RectangularMatrix<4, 4, GLdouble>* values); - void MAGNUM_LOCAL uniformImplementationSSO(GLint location, GLsizei count, const Math::RectangularMatrix<2, 3, GLdouble>* values); - void MAGNUM_LOCAL uniformImplementationSSO(GLint location, GLsizei count, const Math::RectangularMatrix<3, 2, GLdouble>* values); - void MAGNUM_LOCAL uniformImplementationSSO(GLint location, GLsizei count, const Math::RectangularMatrix<2, 4, GLdouble>* values); - void MAGNUM_LOCAL uniformImplementationSSO(GLint location, GLsizei count, const Math::RectangularMatrix<4, 2, GLdouble>* values); - void MAGNUM_LOCAL uniformImplementationSSO(GLint location, GLsizei count, const Math::RectangularMatrix<3, 4, GLdouble>* values); - void MAGNUM_LOCAL uniformImplementationSSO(GLint location, GLsizei count, const Math::RectangularMatrix<4, 3, GLdouble>* values); + void MAGNUM_GL_LOCAL uniformImplementationSSO(GLint location, GLsizei count, const Math::RectangularMatrix<2, 2, GLdouble>* values); + void MAGNUM_GL_LOCAL uniformImplementationSSO(GLint location, GLsizei count, const Math::RectangularMatrix<3, 3, GLdouble>* values); + void MAGNUM_GL_LOCAL uniformImplementationSSO(GLint location, GLsizei count, const Math::RectangularMatrix<4, 4, GLdouble>* values); + void MAGNUM_GL_LOCAL uniformImplementationSSO(GLint location, GLsizei count, const Math::RectangularMatrix<2, 3, GLdouble>* values); + void MAGNUM_GL_LOCAL uniformImplementationSSO(GLint location, GLsizei count, const Math::RectangularMatrix<3, 2, GLdouble>* values); + void MAGNUM_GL_LOCAL uniformImplementationSSO(GLint location, GLsizei count, const Math::RectangularMatrix<2, 4, GLdouble>* values); + void MAGNUM_GL_LOCAL uniformImplementationSSO(GLint location, GLsizei count, const Math::RectangularMatrix<4, 2, GLdouble>* values); + void MAGNUM_GL_LOCAL uniformImplementationSSO(GLint location, GLsizei count, const Math::RectangularMatrix<3, 4, GLdouble>* values); + void MAGNUM_GL_LOCAL uniformImplementationSSO(GLint location, GLsizei count, const Math::RectangularMatrix<4, 3, GLdouble>* values); #endif #ifndef MAGNUM_TARGET_WEBGL - void MAGNUM_LOCAL uniformImplementationDSAEXT_SSOEXT(GLint location, GLsizei count, const Math::RectangularMatrix<2, 2, GLfloat>* values); - void MAGNUM_LOCAL uniformImplementationDSAEXT_SSOEXT(GLint location, GLsizei count, const Math::RectangularMatrix<3, 3, GLfloat>* values); - void MAGNUM_LOCAL uniformImplementationDSAEXT_SSOEXT(GLint location, GLsizei count, const Math::RectangularMatrix<4, 4, GLfloat>* values); + void MAGNUM_GL_LOCAL uniformImplementationDSAEXT_SSOEXT(GLint location, GLsizei count, const Math::RectangularMatrix<2, 2, GLfloat>* values); + void MAGNUM_GL_LOCAL uniformImplementationDSAEXT_SSOEXT(GLint location, GLsizei count, const Math::RectangularMatrix<3, 3, GLfloat>* values); + void MAGNUM_GL_LOCAL uniformImplementationDSAEXT_SSOEXT(GLint location, GLsizei count, const Math::RectangularMatrix<4, 4, GLfloat>* values); #ifndef MAGNUM_TARGET_GLES2 - void MAGNUM_LOCAL uniformImplementationDSAEXT_SSOEXT(GLint location, GLsizei count, const Math::RectangularMatrix<2, 3, GLfloat>* values); - void MAGNUM_LOCAL uniformImplementationDSAEXT_SSOEXT(GLint location, GLsizei count, const Math::RectangularMatrix<3, 2, GLfloat>* values); - void MAGNUM_LOCAL uniformImplementationDSAEXT_SSOEXT(GLint location, GLsizei count, const Math::RectangularMatrix<2, 4, GLfloat>* values); - void MAGNUM_LOCAL uniformImplementationDSAEXT_SSOEXT(GLint location, GLsizei count, const Math::RectangularMatrix<4, 2, GLfloat>* values); - void MAGNUM_LOCAL uniformImplementationDSAEXT_SSOEXT(GLint location, GLsizei count, const Math::RectangularMatrix<3, 4, GLfloat>* values); - void MAGNUM_LOCAL uniformImplementationDSAEXT_SSOEXT(GLint location, GLsizei count, const Math::RectangularMatrix<4, 3, GLfloat>* values); + void MAGNUM_GL_LOCAL uniformImplementationDSAEXT_SSOEXT(GLint location, GLsizei count, const Math::RectangularMatrix<2, 3, GLfloat>* values); + void MAGNUM_GL_LOCAL uniformImplementationDSAEXT_SSOEXT(GLint location, GLsizei count, const Math::RectangularMatrix<3, 2, GLfloat>* values); + void MAGNUM_GL_LOCAL uniformImplementationDSAEXT_SSOEXT(GLint location, GLsizei count, const Math::RectangularMatrix<2, 4, GLfloat>* values); + void MAGNUM_GL_LOCAL uniformImplementationDSAEXT_SSOEXT(GLint location, GLsizei count, const Math::RectangularMatrix<4, 2, GLfloat>* values); + void MAGNUM_GL_LOCAL uniformImplementationDSAEXT_SSOEXT(GLint location, GLsizei count, const Math::RectangularMatrix<3, 4, GLfloat>* values); + void MAGNUM_GL_LOCAL uniformImplementationDSAEXT_SSOEXT(GLint location, GLsizei count, const Math::RectangularMatrix<4, 3, GLfloat>* values); #endif #endif #ifndef MAGNUM_TARGET_GLES - void MAGNUM_LOCAL uniformImplementationDSAEXT(GLint location, GLsizei count, const Math::RectangularMatrix<2, 2, GLdouble>* values); - void MAGNUM_LOCAL uniformImplementationDSAEXT(GLint location, GLsizei count, const Math::RectangularMatrix<3, 3, GLdouble>* values); - void MAGNUM_LOCAL uniformImplementationDSAEXT(GLint location, GLsizei count, const Math::RectangularMatrix<4, 4, GLdouble>* values); - void MAGNUM_LOCAL uniformImplementationDSAEXT(GLint location, GLsizei count, const Math::RectangularMatrix<2, 3, GLdouble>* values); - void MAGNUM_LOCAL uniformImplementationDSAEXT(GLint location, GLsizei count, const Math::RectangularMatrix<3, 2, GLdouble>* values); - void MAGNUM_LOCAL uniformImplementationDSAEXT(GLint location, GLsizei count, const Math::RectangularMatrix<2, 4, GLdouble>* values); - void MAGNUM_LOCAL uniformImplementationDSAEXT(GLint location, GLsizei count, const Math::RectangularMatrix<4, 2, GLdouble>* values); - void MAGNUM_LOCAL uniformImplementationDSAEXT(GLint location, GLsizei count, const Math::RectangularMatrix<3, 4, GLdouble>* values); - void MAGNUM_LOCAL uniformImplementationDSAEXT(GLint location, GLsizei count, const Math::RectangularMatrix<4, 3, GLdouble>* values); + void MAGNUM_GL_LOCAL uniformImplementationDSAEXT(GLint location, GLsizei count, const Math::RectangularMatrix<2, 2, GLdouble>* values); + void MAGNUM_GL_LOCAL uniformImplementationDSAEXT(GLint location, GLsizei count, const Math::RectangularMatrix<3, 3, GLdouble>* values); + void MAGNUM_GL_LOCAL uniformImplementationDSAEXT(GLint location, GLsizei count, const Math::RectangularMatrix<4, 4, GLdouble>* values); + void MAGNUM_GL_LOCAL uniformImplementationDSAEXT(GLint location, GLsizei count, const Math::RectangularMatrix<2, 3, GLdouble>* values); + void MAGNUM_GL_LOCAL uniformImplementationDSAEXT(GLint location, GLsizei count, const Math::RectangularMatrix<3, 2, GLdouble>* values); + void MAGNUM_GL_LOCAL uniformImplementationDSAEXT(GLint location, GLsizei count, const Math::RectangularMatrix<2, 4, GLdouble>* values); + void MAGNUM_GL_LOCAL uniformImplementationDSAEXT(GLint location, GLsizei count, const Math::RectangularMatrix<4, 2, GLdouble>* values); + void MAGNUM_GL_LOCAL uniformImplementationDSAEXT(GLint location, GLsizei count, const Math::RectangularMatrix<3, 4, GLdouble>* values); + void MAGNUM_GL_LOCAL uniformImplementationDSAEXT(GLint location, GLsizei count, const Math::RectangularMatrix<4, 3, GLdouble>* values); #endif GLuint _id; diff --git a/src/Magnum/AbstractTexture.cpp b/src/Magnum/GL/AbstractTexture.cpp similarity index 97% rename from src/Magnum/AbstractTexture.cpp rename to src/Magnum/GL/AbstractTexture.cpp index d774406c1..07dd3441d 100644 --- a/src/Magnum/AbstractTexture.cpp +++ b/src/Magnum/GL/AbstractTexture.cpp @@ -27,23 +27,22 @@ #include -#ifndef MAGNUM_TARGET_GLES2 -#include "Magnum/BufferImage.h" -#endif #include "Magnum/Array.h" -#include "Magnum/Context.h" -#include "Magnum/Extensions.h" #include "Magnum/Image.h" -#include "Magnum/PixelFormat.h" -#include "Magnum/TextureFormat.h" -#include "Magnum/Math/Color.h" -#include "Magnum/Math/Range.h" - +#ifndef MAGNUM_TARGET_GLES2 +#include "Magnum/GL/BufferImage.h" +#endif +#include "Magnum/GL/Context.h" +#include "Magnum/GL/Extensions.h" +#include "Magnum/GL/PixelFormat.h" +#include "Magnum/GL/TextureFormat.h" #ifndef MAGNUM_TARGET_WEBGL -#include "Implementation/DebugState.h" +#include "Magnum/GL/Implementation/DebugState.h" #endif -#include "Implementation/State.h" -#include "Implementation/TextureState.h" +#include "Magnum/GL/Implementation/State.h" +#include "Magnum/GL/Implementation/TextureState.h" +#include "Magnum/Math/Color.h" +#include "Magnum/Math/Range.h" namespace Magnum { @@ -1705,9 +1704,9 @@ template void AbstractTexture::image(GLint level, Image< image = Image{image.storage(), image.format(), image.type(), size, std::move(data)}; } -template void MAGNUM_EXPORT AbstractTexture::image<1>(GLint, Image<1>&); -template void MAGNUM_EXPORT AbstractTexture::image<2>(GLint, Image<2>&); -template void MAGNUM_EXPORT AbstractTexture::image<3>(GLint, Image<3>&); +template void MAGNUM_GL_EXPORT AbstractTexture::image<1>(GLint, Image<1>&); +template void MAGNUM_GL_EXPORT AbstractTexture::image<2>(GLint, Image<2>&); +template void MAGNUM_GL_EXPORT AbstractTexture::image<3>(GLint, Image<3>&); template void AbstractTexture::image(GLint level, BufferImage& image, BufferUsage usage) { const Math::Vector size = DataHelper::imageSize(*this, level); @@ -1724,9 +1723,9 @@ template void AbstractTexture::image(GLint level, Buffer (this->*Context::current().state().texture->getImageImplementation)(level, image.format(), image.type(), dataSize, nullptr); } -template void MAGNUM_EXPORT AbstractTexture::image<1>(GLint, BufferImage<1>&, BufferUsage); -template void MAGNUM_EXPORT AbstractTexture::image<2>(GLint, BufferImage<2>&, BufferUsage); -template void MAGNUM_EXPORT AbstractTexture::image<3>(GLint, BufferImage<3>&, BufferUsage); +template void MAGNUM_GL_EXPORT AbstractTexture::image<1>(GLint, BufferImage<1>&, BufferUsage); +template void MAGNUM_GL_EXPORT AbstractTexture::image<2>(GLint, BufferImage<2>&, BufferUsage); +template void MAGNUM_GL_EXPORT AbstractTexture::image<3>(GLint, BufferImage<3>&, BufferUsage); template void AbstractTexture::compressedImage(const GLint level, CompressedImage& image) { const Math::Vector size = DataHelper::imageSize(*this, level); @@ -1755,9 +1754,9 @@ template void AbstractTexture::compressedImage(const GLi image = CompressedImage{image.storage(), CompressedPixelFormat(format), size, std::move(data)}; } -template void MAGNUM_EXPORT AbstractTexture::compressedImage<1>(GLint, CompressedImage<1>&); -template void MAGNUM_EXPORT AbstractTexture::compressedImage<2>(GLint, CompressedImage<2>&); -template void MAGNUM_EXPORT AbstractTexture::compressedImage<3>(GLint, CompressedImage<3>&); +template void MAGNUM_GL_EXPORT AbstractTexture::compressedImage<1>(GLint, CompressedImage<1>&); +template void MAGNUM_GL_EXPORT AbstractTexture::compressedImage<2>(GLint, CompressedImage<2>&); +template void MAGNUM_GL_EXPORT AbstractTexture::compressedImage<3>(GLint, CompressedImage<3>&); template void AbstractTexture::compressedImage(const GLint level, CompressedBufferImage& image, BufferUsage usage) { const Math::Vector size = DataHelper::imageSize(*this, level); @@ -1786,9 +1785,9 @@ template void AbstractTexture::compressedImage(const GLi (this->*Context::current().state().texture->getCompressedImageImplementation)(level, dataSize, nullptr); } -template void MAGNUM_EXPORT AbstractTexture::compressedImage<1>(GLint, CompressedBufferImage<1>&, BufferUsage); -template void MAGNUM_EXPORT AbstractTexture::compressedImage<2>(GLint, CompressedBufferImage<2>&, BufferUsage); -template void MAGNUM_EXPORT AbstractTexture::compressedImage<3>(GLint, CompressedBufferImage<3>&, BufferUsage); +template void MAGNUM_GL_EXPORT AbstractTexture::compressedImage<1>(GLint, CompressedBufferImage<1>&, BufferUsage); +template void MAGNUM_GL_EXPORT AbstractTexture::compressedImage<2>(GLint, CompressedBufferImage<2>&, BufferUsage); +template void MAGNUM_GL_EXPORT AbstractTexture::compressedImage<3>(GLint, CompressedBufferImage<3>&, BufferUsage); template void AbstractTexture::subImage(const GLint level, const RangeTypeFor& range, Image& image) { createIfNotAlready(); @@ -1809,9 +1808,9 @@ template void AbstractTexture::subImage(const GLint leve image = Image{image.storage(), image.format(), image.type(), size, std::move(data)}; } -template void MAGNUM_EXPORT AbstractTexture::subImage<1>(GLint, const Range1Di&, Image<1>&); -template void MAGNUM_EXPORT AbstractTexture::subImage<2>(GLint, const Range2Di&, Image<2>&); -template void MAGNUM_EXPORT AbstractTexture::subImage<3>(GLint, const Range3Di&, Image<3>&); +template void MAGNUM_GL_EXPORT AbstractTexture::subImage<1>(GLint, const Range1Di&, Image<1>&); +template void MAGNUM_GL_EXPORT AbstractTexture::subImage<2>(GLint, const Range2Di&, Image<2>&); +template void MAGNUM_GL_EXPORT AbstractTexture::subImage<3>(GLint, const Range3Di&, Image<3>&); template void AbstractTexture::subImage(const GLint level, const RangeTypeFor& range, BufferImage& image, const BufferUsage usage) { createIfNotAlready(); @@ -1832,9 +1831,9 @@ template void AbstractTexture::subImage(const GLint leve glGetTextureSubImage(_id, level, paddedOffset.x(), paddedOffset.y(), paddedOffset.z(), paddedSize.x(), paddedSize.y(), paddedSize.z(), GLenum(image.format()), GLenum(image.type()), dataSize, nullptr); } -template void MAGNUM_EXPORT AbstractTexture::subImage<1>(GLint, const Range1Di&, BufferImage<1>&, BufferUsage); -template void MAGNUM_EXPORT AbstractTexture::subImage<2>(GLint, const Range2Di&, BufferImage<2>&, BufferUsage); -template void MAGNUM_EXPORT AbstractTexture::subImage<3>(GLint, const Range3Di&, BufferImage<3>&, BufferUsage); +template void MAGNUM_GL_EXPORT AbstractTexture::subImage<1>(GLint, const Range1Di&, BufferImage<1>&, BufferUsage); +template void MAGNUM_GL_EXPORT AbstractTexture::subImage<2>(GLint, const Range2Di&, BufferImage<2>&, BufferUsage); +template void MAGNUM_GL_EXPORT AbstractTexture::subImage<3>(GLint, const Range3Di&, BufferImage<3>&, BufferUsage); template std::size_t AbstractTexture::compressedSubImageSize(TextureFormat format, const Math::Vector& size) { /* Amount of blocks in given range (rounded up) multiplied by block @@ -1874,9 +1873,9 @@ template void AbstractTexture::compressedSubImage(const image = CompressedImage{CompressedPixelFormat(format), size, std::move(data)}; } -template void MAGNUM_EXPORT AbstractTexture::compressedSubImage<1>(GLint, const Range1Di&, CompressedImage<1>&); -template void MAGNUM_EXPORT AbstractTexture::compressedSubImage<2>(GLint, const Range2Di&, CompressedImage<2>&); -template void MAGNUM_EXPORT AbstractTexture::compressedSubImage<3>(GLint, const Range3Di&, CompressedImage<3>&); +template void MAGNUM_GL_EXPORT AbstractTexture::compressedSubImage<1>(GLint, const Range1Di&, CompressedImage<1>&); +template void MAGNUM_GL_EXPORT AbstractTexture::compressedSubImage<2>(GLint, const Range2Di&, CompressedImage<2>&); +template void MAGNUM_GL_EXPORT AbstractTexture::compressedSubImage<3>(GLint, const Range3Di&, CompressedImage<3>&); template void AbstractTexture::compressedSubImage(const GLint level, const RangeTypeFor& range, CompressedBufferImage& image, const BufferUsage usage) { createIfNotAlready(); @@ -1908,9 +1907,9 @@ template void AbstractTexture::compressedSubImage(const glGetCompressedTextureSubImage(_id, level, paddedOffset.x(), paddedOffset.y(), paddedOffset.z(), paddedSize.x(), paddedSize.y(), paddedSize.z(), dataSize, nullptr); } -template void MAGNUM_EXPORT AbstractTexture::compressedSubImage<1>(GLint, const Range1Di&, CompressedBufferImage<1>&, BufferUsage); -template void MAGNUM_EXPORT AbstractTexture::compressedSubImage<2>(GLint, const Range2Di&, CompressedBufferImage<2>&, BufferUsage); -template void MAGNUM_EXPORT AbstractTexture::compressedSubImage<3>(GLint, const Range3Di&, CompressedBufferImage<3>&, BufferUsage); +template void MAGNUM_GL_EXPORT AbstractTexture::compressedSubImage<1>(GLint, const Range1Di&, CompressedBufferImage<1>&, BufferUsage); +template void MAGNUM_GL_EXPORT AbstractTexture::compressedSubImage<2>(GLint, const Range2Di&, CompressedBufferImage<2>&, BufferUsage); +template void MAGNUM_GL_EXPORT AbstractTexture::compressedSubImage<3>(GLint, const Range3Di&, CompressedBufferImage<3>&, BufferUsage); #endif #endif diff --git a/src/Magnum/AbstractTexture.h b/src/Magnum/GL/AbstractTexture.h similarity index 74% rename from src/Magnum/AbstractTexture.h rename to src/Magnum/GL/AbstractTexture.h index a39d88643..f81e375bf 100644 --- a/src/Magnum/AbstractTexture.h +++ b/src/Magnum/GL/AbstractTexture.h @@ -1,5 +1,5 @@ -#ifndef Magnum_AbstractTexture_h -#define Magnum_AbstractTexture_h +#ifndef Magnum_GL_AbstractTexture_h +#define Magnum_GL_AbstractTexture_h /* This file is part of Magnum. @@ -31,10 +31,11 @@ #include -#include "Magnum/AbstractObject.h" #include "Magnum/DimensionTraits.h" -#include "Magnum/Sampler.h" #include "Magnum/Tags.h" +#include "Magnum/GL/AbstractObject.h" +#include "Magnum/GL/GL.h" +#include "Magnum/GL/Sampler.h" namespace Magnum { @@ -131,7 +132,7 @@ functions do nothing. @todo `GL_MAX_SAMPLE_MASK_WORDS` when @extension{ARB,texture_multisample} is done @todo Query for immutable levels (@extension{ARB,ES3_compatibility}) */ -class MAGNUM_EXPORT AbstractTexture: public AbstractObject { +class MAGNUM_GL_EXPORT AbstractTexture: public AbstractObject { friend Implementation::TextureState; friend AbstractFramebuffer; friend CubeMapTexture; @@ -428,14 +429,14 @@ class MAGNUM_EXPORT AbstractTexture: public AbstractObject { AbstractTexture& setLabelInternal(Containers::ArrayView label); #endif - void MAGNUM_LOCAL createIfNotAlready(); + void MAGNUM_GL_LOCAL createIfNotAlready(); #if !defined(MAGNUM_TARGET_GLES2) && !defined(MAGNUM_TARGET_WEBGL) void bindImageInternal(Int imageUnit, Int level, bool layered, Int layer, ImageAccess access, ImageFormat format); #endif /* Unlike bind() this also sets the texture binding unit as active */ - void MAGNUM_LOCAL bindInternal(); + void MAGNUM_GL_LOCAL bindInternal(); #ifndef MAGNUM_TARGET_GLES2 void setBaseLevel(Int level); @@ -499,208 +500,208 @@ class MAGNUM_EXPORT AbstractTexture: public AbstractObject { private: #ifndef MAGNUM_TARGET_GLES - static Int MAGNUM_LOCAL compressedBlockDataSizeImplementationDefault(GLenum target, TextureFormat format); - static Int MAGNUM_LOCAL compressedBlockDataSizeImplementationBitsWorkaround(GLenum target, TextureFormat format); + static Int MAGNUM_GL_LOCAL compressedBlockDataSizeImplementationDefault(GLenum target, TextureFormat format); + static Int MAGNUM_GL_LOCAL compressedBlockDataSizeImplementationBitsWorkaround(GLenum target, TextureFormat format); #endif - static void MAGNUM_LOCAL unbindImplementationDefault(GLint textureUnit); + static void MAGNUM_GL_LOCAL unbindImplementationDefault(GLint textureUnit); #ifndef MAGNUM_TARGET_GLES - static void MAGNUM_LOCAL unbindImplementationMulti(GLint textureUnit); - static void MAGNUM_LOCAL unbindImplementationDSA(GLint textureUnit); - static void MAGNUM_LOCAL unbindImplementationDSAEXT(GLint textureUnit); + static void MAGNUM_GL_LOCAL unbindImplementationMulti(GLint textureUnit); + static void MAGNUM_GL_LOCAL unbindImplementationDSA(GLint textureUnit); + static void MAGNUM_GL_LOCAL unbindImplementationDSAEXT(GLint textureUnit); #endif - static void MAGNUM_LOCAL bindImplementationFallback(GLint firstTextureUnit, Containers::ArrayView textures); + static void MAGNUM_GL_LOCAL bindImplementationFallback(GLint firstTextureUnit, Containers::ArrayView textures); #ifndef MAGNUM_TARGET_GLES - static void MAGNUM_LOCAL bindImplementationMulti(GLint firstTextureUnit, Containers::ArrayView textures); + static void MAGNUM_GL_LOCAL bindImplementationMulti(GLint firstTextureUnit, Containers::ArrayView textures); #endif - void MAGNUM_LOCAL createImplementationDefault(); + void MAGNUM_GL_LOCAL createImplementationDefault(); #ifndef MAGNUM_TARGET_GLES - void MAGNUM_LOCAL createImplementationDSA(); + void MAGNUM_GL_LOCAL createImplementationDSA(); #endif #ifndef MAGNUM_TARGET_GLES - template std::size_t MAGNUM_LOCAL compressedSubImageSize(TextureFormat format, const Math::Vector& size); + template std::size_t MAGNUM_GL_LOCAL compressedSubImageSize(TextureFormat format, const Math::Vector& size); #endif - void MAGNUM_LOCAL bindImplementationDefault(GLint textureUnit); + void MAGNUM_GL_LOCAL bindImplementationDefault(GLint textureUnit); #ifndef MAGNUM_TARGET_GLES - void MAGNUM_LOCAL bindImplementationMulti(GLint textureUnit); - void MAGNUM_LOCAL bindImplementationDSA(GLint textureUnit); - void MAGNUM_LOCAL bindImplementationDSAEXT(GLint textureUnit); + void MAGNUM_GL_LOCAL bindImplementationMulti(GLint textureUnit); + void MAGNUM_GL_LOCAL bindImplementationDSA(GLint textureUnit); + void MAGNUM_GL_LOCAL bindImplementationDSAEXT(GLint textureUnit); #endif - void MAGNUM_LOCAL parameterImplementationDefault(GLenum parameter, GLint value); - void MAGNUM_LOCAL parameterImplementationDefault(GLenum parameter, GLfloat value); + void MAGNUM_GL_LOCAL parameterImplementationDefault(GLenum parameter, GLint value); + void MAGNUM_GL_LOCAL parameterImplementationDefault(GLenum parameter, GLfloat value); #ifndef MAGNUM_TARGET_GLES2 - void MAGNUM_LOCAL parameterImplementationDefault(GLenum parameter, const GLint* values); + void MAGNUM_GL_LOCAL parameterImplementationDefault(GLenum parameter, const GLint* values); #endif - void MAGNUM_LOCAL parameterImplementationDefault(GLenum parameter, const GLfloat* values); + void MAGNUM_GL_LOCAL parameterImplementationDefault(GLenum parameter, const GLfloat* values); #if !defined(MAGNUM_TARGET_GLES2) && !defined(MAGNUM_TARGET_WEBGL) - void MAGNUM_LOCAL parameterIImplementationDefault(GLenum parameter, const GLuint* values); - void MAGNUM_LOCAL parameterIImplementationDefault(GLenum parameter, const GLint* values); + void MAGNUM_GL_LOCAL parameterIImplementationDefault(GLenum parameter, const GLuint* values); + void MAGNUM_GL_LOCAL parameterIImplementationDefault(GLenum parameter, const GLint* values); #ifdef MAGNUM_TARGET_GLES - void MAGNUM_LOCAL parameterIImplementationEXT(GLenum parameter, const GLuint* values); - void MAGNUM_LOCAL parameterIImplementationEXT(GLenum parameter, const GLint* values); + void MAGNUM_GL_LOCAL parameterIImplementationEXT(GLenum parameter, const GLuint* values); + void MAGNUM_GL_LOCAL parameterIImplementationEXT(GLenum parameter, const GLint* values); #endif #endif #ifndef MAGNUM_TARGET_GLES - void MAGNUM_LOCAL parameterImplementationDSA(GLenum parameter, GLint value); - void MAGNUM_LOCAL parameterImplementationDSAEXT(GLenum parameter, GLint value); - void MAGNUM_LOCAL parameterImplementationDSA(GLenum parameter, GLfloat value); - void MAGNUM_LOCAL parameterImplementationDSAEXT(GLenum parameter, GLfloat value); - void MAGNUM_LOCAL parameterImplementationDSA(GLenum parameter, const GLint* values); - void MAGNUM_LOCAL parameterImplementationDSAEXT(GLenum parameter, const GLint* values); - void MAGNUM_LOCAL parameterImplementationDSA(GLenum parameter, const GLfloat* values); - void MAGNUM_LOCAL parameterImplementationDSAEXT(GLenum parameter, const GLfloat* values); - void MAGNUM_LOCAL parameterIImplementationDSA(GLenum parameter, const GLuint* values); - void MAGNUM_LOCAL parameterIImplementationDSAEXT(GLenum parameter, const GLuint* values); - void MAGNUM_LOCAL parameterIImplementationDSA(GLenum parameter, const GLint* values); - void MAGNUM_LOCAL parameterIImplementationDSAEXT(GLenum parameter, const GLint* values); - #endif - - void MAGNUM_LOCAL setMaxAnisotropyImplementationNoOp(GLfloat); + void MAGNUM_GL_LOCAL parameterImplementationDSA(GLenum parameter, GLint value); + void MAGNUM_GL_LOCAL parameterImplementationDSAEXT(GLenum parameter, GLint value); + void MAGNUM_GL_LOCAL parameterImplementationDSA(GLenum parameter, GLfloat value); + void MAGNUM_GL_LOCAL parameterImplementationDSAEXT(GLenum parameter, GLfloat value); + void MAGNUM_GL_LOCAL parameterImplementationDSA(GLenum parameter, const GLint* values); + void MAGNUM_GL_LOCAL parameterImplementationDSAEXT(GLenum parameter, const GLint* values); + void MAGNUM_GL_LOCAL parameterImplementationDSA(GLenum parameter, const GLfloat* values); + void MAGNUM_GL_LOCAL parameterImplementationDSAEXT(GLenum parameter, const GLfloat* values); + void MAGNUM_GL_LOCAL parameterIImplementationDSA(GLenum parameter, const GLuint* values); + void MAGNUM_GL_LOCAL parameterIImplementationDSAEXT(GLenum parameter, const GLuint* values); + void MAGNUM_GL_LOCAL parameterIImplementationDSA(GLenum parameter, const GLint* values); + void MAGNUM_GL_LOCAL parameterIImplementationDSAEXT(GLenum parameter, const GLint* values); + #endif + + void MAGNUM_GL_LOCAL setMaxAnisotropyImplementationNoOp(GLfloat); #ifndef MAGNUM_TARGET_GLES - void MAGNUM_LOCAL setMaxAnisotropyImplementationArb(GLfloat anisotropy); + void MAGNUM_GL_LOCAL setMaxAnisotropyImplementationArb(GLfloat anisotropy); #endif - void MAGNUM_LOCAL setMaxAnisotropyImplementationExt(GLfloat anisotropy); + void MAGNUM_GL_LOCAL setMaxAnisotropyImplementationExt(GLfloat anisotropy); #if !defined(MAGNUM_TARGET_GLES2) && !defined(MAGNUM_TARGET_WEBGL) - void MAGNUM_LOCAL getLevelParameterImplementationDefault(GLint level, GLenum parameter, GLint* values); + void MAGNUM_GL_LOCAL getLevelParameterImplementationDefault(GLint level, GLenum parameter, GLint* values); #ifndef MAGNUM_TARGET_GLES - void MAGNUM_LOCAL getLevelParameterImplementationDSA(GLint level, GLenum parameter, GLint* values); - void MAGNUM_LOCAL getLevelParameterImplementationDSAEXT(GLint level, GLenum parameter, GLint* values); + void MAGNUM_GL_LOCAL getLevelParameterImplementationDSA(GLint level, GLenum parameter, GLint* values); + void MAGNUM_GL_LOCAL getLevelParameterImplementationDSAEXT(GLint level, GLenum parameter, GLint* values); #endif #endif - void MAGNUM_LOCAL mipmapImplementationDefault(); + void MAGNUM_GL_LOCAL mipmapImplementationDefault(); #ifndef MAGNUM_TARGET_GLES - void MAGNUM_LOCAL mipmapImplementationDSA(); - void MAGNUM_LOCAL mipmapImplementationDSAEXT(); + void MAGNUM_GL_LOCAL mipmapImplementationDSA(); + void MAGNUM_GL_LOCAL mipmapImplementationDSAEXT(); #endif #ifndef MAGNUM_TARGET_GLES - void MAGNUM_LOCAL storageImplementationFallback(GLsizei levels, TextureFormat internalFormat, const Math::Vector<1, GLsizei>& size); - void MAGNUM_LOCAL storageImplementationDefault(GLsizei levels, TextureFormat internalFormat, const Math::Vector<1, GLsizei>& size); - void MAGNUM_LOCAL storageImplementationDSA(GLsizei levels, TextureFormat internalFormat, const Math::Vector<1, GLsizei>& size); - void MAGNUM_LOCAL storageImplementationDSAEXT(GLsizei levels, TextureFormat internalFormat, const Math::Vector<1, GLsizei>& size); + void MAGNUM_GL_LOCAL storageImplementationFallback(GLsizei levels, TextureFormat internalFormat, const Math::Vector<1, GLsizei>& size); + void MAGNUM_GL_LOCAL storageImplementationDefault(GLsizei levels, TextureFormat internalFormat, const Math::Vector<1, GLsizei>& size); + void MAGNUM_GL_LOCAL storageImplementationDSA(GLsizei levels, TextureFormat internalFormat, const Math::Vector<1, GLsizei>& size); + void MAGNUM_GL_LOCAL storageImplementationDSAEXT(GLsizei levels, TextureFormat internalFormat, const Math::Vector<1, GLsizei>& size); #endif #if !defined(MAGNUM_TARGET_GLES) || defined(MAGNUM_TARGET_GLES2) - void MAGNUM_LOCAL storageImplementationFallback(GLsizei levels, TextureFormat internalFormat, const Vector2i& size); + void MAGNUM_GL_LOCAL storageImplementationFallback(GLsizei levels, TextureFormat internalFormat, const Vector2i& size); #endif #if !(defined(MAGNUM_TARGET_WEBGL) && defined(MAGNUM_TARGET_GLES2)) - void MAGNUM_LOCAL storageImplementationDefault(GLsizei levels, TextureFormat internalFormat, const Vector2i& size); + void MAGNUM_GL_LOCAL storageImplementationDefault(GLsizei levels, TextureFormat internalFormat, const Vector2i& size); #endif #ifndef MAGNUM_TARGET_GLES - void MAGNUM_LOCAL storageImplementationDSA(GLsizei levels, TextureFormat internalFormat, const Vector2i& size); - void MAGNUM_LOCAL storageImplementationDSAEXT(GLsizei levels, TextureFormat internalFormat, const Vector2i& size); + void MAGNUM_GL_LOCAL storageImplementationDSA(GLsizei levels, TextureFormat internalFormat, const Vector2i& size); + void MAGNUM_GL_LOCAL storageImplementationDSAEXT(GLsizei levels, TextureFormat internalFormat, const Vector2i& size); #endif #if !defined(MAGNUM_TARGET_GLES) || (defined(MAGNUM_TARGET_GLES2) && !defined(MAGNUM_TARGET_WEBGL)) - void MAGNUM_LOCAL storageImplementationFallback(GLsizei levels, TextureFormat internalFormat, const Vector3i& size); + void MAGNUM_GL_LOCAL storageImplementationFallback(GLsizei levels, TextureFormat internalFormat, const Vector3i& size); #endif #if !(defined(MAGNUM_TARGET_WEBGL) && defined(MAGNUM_TARGET_GLES2)) - void MAGNUM_LOCAL storageImplementationDefault(GLsizei levels, TextureFormat internalFormat, const Vector3i& size); + void MAGNUM_GL_LOCAL storageImplementationDefault(GLsizei levels, TextureFormat internalFormat, const Vector3i& size); #endif #ifndef MAGNUM_TARGET_GLES - void MAGNUM_LOCAL storageImplementationDSA(GLsizei levels, TextureFormat internalFormat, const Vector3i& size); - void MAGNUM_LOCAL storageImplementationDSAEXT(GLsizei levels, TextureFormat internalFormat, const Vector3i& size); + void MAGNUM_GL_LOCAL storageImplementationDSA(GLsizei levels, TextureFormat internalFormat, const Vector3i& size); + void MAGNUM_GL_LOCAL storageImplementationDSAEXT(GLsizei levels, TextureFormat internalFormat, const Vector3i& size); #endif #ifndef MAGNUM_TARGET_GLES - void MAGNUM_LOCAL storageMultisampleImplementationFallback(GLsizei samples, TextureFormat internalFormat, const Vector2i& size, GLboolean fixedsamplelocations); - void MAGNUM_LOCAL storageMultisampleImplementationFallback(GLsizei samples, TextureFormat internalFormat, const Vector3i& size, GLboolean fixedsamplelocations); + void MAGNUM_GL_LOCAL storageMultisampleImplementationFallback(GLsizei samples, TextureFormat internalFormat, const Vector2i& size, GLboolean fixedsamplelocations); + void MAGNUM_GL_LOCAL storageMultisampleImplementationFallback(GLsizei samples, TextureFormat internalFormat, const Vector3i& size, GLboolean fixedsamplelocations); #endif #if !defined(MAGNUM_TARGET_GLES2) && !defined(MAGNUM_TARGET_WEBGL) - void MAGNUM_LOCAL storageMultisampleImplementationDefault(GLsizei samples, TextureFormat internalFormat, const Vector2i& size, GLboolean fixedsamplelocations); - void MAGNUM_LOCAL storageMultisampleImplementationDefault(GLsizei samples, TextureFormat internalFormat, const Vector3i& size, GLboolean fixedsamplelocations); + void MAGNUM_GL_LOCAL storageMultisampleImplementationDefault(GLsizei samples, TextureFormat internalFormat, const Vector2i& size, GLboolean fixedsamplelocations); + void MAGNUM_GL_LOCAL storageMultisampleImplementationDefault(GLsizei samples, TextureFormat internalFormat, const Vector3i& size, GLboolean fixedsamplelocations); #ifdef MAGNUM_TARGET_GLES - void MAGNUM_LOCAL storageMultisampleImplementationOES(GLsizei samples, TextureFormat internalFormat, const Vector3i& size, GLboolean fixedsamplelocations); + void MAGNUM_GL_LOCAL storageMultisampleImplementationOES(GLsizei samples, TextureFormat internalFormat, const Vector3i& size, GLboolean fixedsamplelocations); #endif #endif #ifndef MAGNUM_TARGET_GLES - void MAGNUM_LOCAL storageMultisampleImplementationDSA(GLsizei samples, TextureFormat internalFormat, const Vector2i& size, GLboolean fixedsamplelocations); - void MAGNUM_LOCAL storageMultisampleImplementationDSA(GLsizei samples, TextureFormat internalFormat, const Vector3i& size, GLboolean fixedsamplelocations); - void MAGNUM_LOCAL storageMultisampleImplementationDSAEXT(GLsizei samples, TextureFormat internalFormat, const Vector2i& size, GLboolean fixedsamplelocations); - void MAGNUM_LOCAL storageMultisampleImplementationDSAEXT(GLsizei samples, TextureFormat internalFormat, const Vector3i& size, GLboolean fixedsamplelocations); + void MAGNUM_GL_LOCAL storageMultisampleImplementationDSA(GLsizei samples, TextureFormat internalFormat, const Vector2i& size, GLboolean fixedsamplelocations); + void MAGNUM_GL_LOCAL storageMultisampleImplementationDSA(GLsizei samples, TextureFormat internalFormat, const Vector3i& size, GLboolean fixedsamplelocations); + void MAGNUM_GL_LOCAL storageMultisampleImplementationDSAEXT(GLsizei samples, TextureFormat internalFormat, const Vector2i& size, GLboolean fixedsamplelocations); + void MAGNUM_GL_LOCAL storageMultisampleImplementationDSAEXT(GLsizei samples, TextureFormat internalFormat, const Vector3i& size, GLboolean fixedsamplelocations); #endif #ifndef MAGNUM_TARGET_GLES - void MAGNUM_LOCAL getImageImplementationDefault(GLint level, PixelFormat format, PixelType type, std::size_t dataSize, GLvoid* data); - void MAGNUM_LOCAL getImageImplementationDSA(GLint level, PixelFormat format, PixelType type, std::size_t dataSize, GLvoid* data); - void MAGNUM_LOCAL getImageImplementationDSAEXT(GLint level, PixelFormat format, PixelType type, std::size_t dataSize, GLvoid* data); - void MAGNUM_LOCAL getImageImplementationRobustness(GLint level, PixelFormat format, PixelType type, std::size_t dataSize, GLvoid* data); + void MAGNUM_GL_LOCAL getImageImplementationDefault(GLint level, PixelFormat format, PixelType type, std::size_t dataSize, GLvoid* data); + void MAGNUM_GL_LOCAL getImageImplementationDSA(GLint level, PixelFormat format, PixelType type, std::size_t dataSize, GLvoid* data); + void MAGNUM_GL_LOCAL getImageImplementationDSAEXT(GLint level, PixelFormat format, PixelType type, std::size_t dataSize, GLvoid* data); + void MAGNUM_GL_LOCAL getImageImplementationRobustness(GLint level, PixelFormat format, PixelType type, std::size_t dataSize, GLvoid* data); - void MAGNUM_LOCAL getCompressedImageImplementationDefault(GLint level, std::size_t dataSize, GLvoid* data); - void MAGNUM_LOCAL getCompressedImageImplementationDSA(GLint level, std::size_t dataSize, GLvoid* data); - void MAGNUM_LOCAL getCompressedImageImplementationDSAEXT(GLint level, std::size_t dataSize, GLvoid* data); - void MAGNUM_LOCAL getCompressedImageImplementationRobustness(GLint level, std::size_t dataSize, GLvoid* data); + void MAGNUM_GL_LOCAL getCompressedImageImplementationDefault(GLint level, std::size_t dataSize, GLvoid* data); + void MAGNUM_GL_LOCAL getCompressedImageImplementationDSA(GLint level, std::size_t dataSize, GLvoid* data); + void MAGNUM_GL_LOCAL getCompressedImageImplementationDSAEXT(GLint level, std::size_t dataSize, GLvoid* data); + void MAGNUM_GL_LOCAL getCompressedImageImplementationRobustness(GLint level, std::size_t dataSize, GLvoid* data); #endif #ifndef MAGNUM_TARGET_GLES - void MAGNUM_LOCAL subImageImplementationDefault(GLint level, const Math::Vector<1, GLint>& offset, const Math::Vector<1, GLsizei>& size, PixelFormat format, PixelType type, const GLvoid* data); - void MAGNUM_LOCAL subImageImplementationDSA(GLint level, const Math::Vector<1, GLint>& offset, const Math::Vector<1, GLsizei>& size, PixelFormat format, PixelType type, const GLvoid* data); - void MAGNUM_LOCAL subImageImplementationDSAEXT(GLint level, const Math::Vector<1, GLint>& offset, const Math::Vector<1, GLsizei>& size, PixelFormat format, PixelType type, const GLvoid* data); + void MAGNUM_GL_LOCAL subImageImplementationDefault(GLint level, const Math::Vector<1, GLint>& offset, const Math::Vector<1, GLsizei>& size, PixelFormat format, PixelType type, const GLvoid* data); + void MAGNUM_GL_LOCAL subImageImplementationDSA(GLint level, const Math::Vector<1, GLint>& offset, const Math::Vector<1, GLsizei>& size, PixelFormat format, PixelType type, const GLvoid* data); + void MAGNUM_GL_LOCAL subImageImplementationDSAEXT(GLint level, const Math::Vector<1, GLint>& offset, const Math::Vector<1, GLsizei>& size, PixelFormat format, PixelType type, const GLvoid* data); - void MAGNUM_LOCAL compressedSubImageImplementationDefault(GLint level, const Math::Vector<1, GLint>& offset, const Math::Vector<1, GLsizei>& size, CompressedPixelFormat format, const GLvoid* data, GLsizei dataSize); - void MAGNUM_LOCAL compressedSubImageImplementationDSA(GLint level, const Math::Vector<1, GLint>& offset, const Math::Vector<1, GLsizei>& size, CompressedPixelFormat format, const GLvoid* data, GLsizei dataSize); - void MAGNUM_LOCAL compressedSubImageImplementationDSAEXT(GLint level, const Math::Vector<1, GLint>& offset, const Math::Vector<1, GLsizei>& size, CompressedPixelFormat format, const GLvoid* data, GLsizei dataSize); + void MAGNUM_GL_LOCAL compressedSubImageImplementationDefault(GLint level, const Math::Vector<1, GLint>& offset, const Math::Vector<1, GLsizei>& size, CompressedPixelFormat format, const GLvoid* data, GLsizei dataSize); + void MAGNUM_GL_LOCAL compressedSubImageImplementationDSA(GLint level, const Math::Vector<1, GLint>& offset, const Math::Vector<1, GLsizei>& size, CompressedPixelFormat format, const GLvoid* data, GLsizei dataSize); + void MAGNUM_GL_LOCAL compressedSubImageImplementationDSAEXT(GLint level, const Math::Vector<1, GLint>& offset, const Math::Vector<1, GLsizei>& size, CompressedPixelFormat format, const GLvoid* data, GLsizei dataSize); #endif - void MAGNUM_LOCAL imageImplementationDefault(GLenum target, GLint level, TextureFormat internalFormat, const Vector2i& size, PixelFormat format, PixelType type, const GLvoid* data, const PixelStorage&); + void MAGNUM_GL_LOCAL imageImplementationDefault(GLenum target, GLint level, TextureFormat internalFormat, const Vector2i& size, PixelFormat format, PixelType type, const GLvoid* data, const PixelStorage&); #ifndef MAGNUM_TARGET_GLES - void MAGNUM_LOCAL imageImplementationSvga3DSliceBySlice(GLenum target, GLint level, TextureFormat internalFormat, const Vector2i& size, PixelFormat format, PixelType type, const GLvoid* data, const PixelStorage&); + void MAGNUM_GL_LOCAL imageImplementationSvga3DSliceBySlice(GLenum target, GLint level, TextureFormat internalFormat, const Vector2i& size, PixelFormat format, PixelType type, const GLvoid* data, const PixelStorage&); #endif /* Had to put explicit "2D" in the name so it's not overloaded and Clang is able to pass it as template parameter to subImageImplementationSvga3DSliceBySlice(). GCC had no problem with the original. */ - void MAGNUM_LOCAL subImage2DImplementationDefault(GLint level, const Vector2i& offset, const Vector2i& size, PixelFormat format, PixelType type, const GLvoid* data, const PixelStorage&); + void MAGNUM_GL_LOCAL subImage2DImplementationDefault(GLint level, const Vector2i& offset, const Vector2i& size, PixelFormat format, PixelType type, const GLvoid* data, const PixelStorage&); #ifndef MAGNUM_TARGET_GLES - template void MAGNUM_LOCAL subImageImplementationSvga3DSliceBySlice(GLint level, const Vector2i& offset, const Vector2i& size, PixelFormat format, PixelType type, const GLvoid* data, const PixelStorage& storage); + template void MAGNUM_GL_LOCAL subImageImplementationSvga3DSliceBySlice(GLint level, const Vector2i& offset, const Vector2i& size, PixelFormat format, PixelType type, const GLvoid* data, const PixelStorage& storage); #endif - void MAGNUM_LOCAL compressedSubImageImplementationDefault(GLint level, const Vector2i& offset, const Vector2i& size, CompressedPixelFormat format, const GLvoid* data, GLsizei dataSize); + void MAGNUM_GL_LOCAL compressedSubImageImplementationDefault(GLint level, const Vector2i& offset, const Vector2i& size, CompressedPixelFormat format, const GLvoid* data, GLsizei dataSize); #ifndef MAGNUM_TARGET_GLES - void MAGNUM_LOCAL subImage2DImplementationDSA(GLint level, const Vector2i& offset, const Vector2i& size, PixelFormat format, PixelType type, const GLvoid* data, const PixelStorage&); - void MAGNUM_LOCAL subImageImplementationDSAEXT(GLint level, const Vector2i& offset, const Vector2i& size, PixelFormat format, PixelType type, const GLvoid* data, const PixelStorage&); - void MAGNUM_LOCAL compressedSubImageImplementationDSA(GLint level, const Vector2i& offset, const Vector2i& size, CompressedPixelFormat format, const GLvoid* data, GLsizei dataSize); - void MAGNUM_LOCAL compressedSubImageImplementationDSAEXT(GLint level, const Vector2i& offset, const Vector2i& size, CompressedPixelFormat format, const GLvoid* data, GLsizei dataSize); + void MAGNUM_GL_LOCAL subImage2DImplementationDSA(GLint level, const Vector2i& offset, const Vector2i& size, PixelFormat format, PixelType type, const GLvoid* data, const PixelStorage&); + void MAGNUM_GL_LOCAL subImageImplementationDSAEXT(GLint level, const Vector2i& offset, const Vector2i& size, PixelFormat format, PixelType type, const GLvoid* data, const PixelStorage&); + void MAGNUM_GL_LOCAL compressedSubImageImplementationDSA(GLint level, const Vector2i& offset, const Vector2i& size, CompressedPixelFormat format, const GLvoid* data, GLsizei dataSize); + void MAGNUM_GL_LOCAL compressedSubImageImplementationDSAEXT(GLint level, const Vector2i& offset, const Vector2i& size, CompressedPixelFormat format, const GLvoid* data, GLsizei dataSize); #endif #if !(defined(MAGNUM_TARGET_WEBGL) && defined(MAGNUM_TARGET_GLES2)) - void MAGNUM_LOCAL imageImplementationDefault(GLint level, TextureFormat internalFormat, const Vector3i& size, PixelFormat format, PixelType type, const GLvoid* data, const PixelStorage&); + void MAGNUM_GL_LOCAL imageImplementationDefault(GLint level, TextureFormat internalFormat, const Vector3i& size, PixelFormat format, PixelType type, const GLvoid* data, const PixelStorage&); #ifndef MAGNUM_TARGET_WEBGL - void MAGNUM_LOCAL imageImplementationSvga3DSliceBySlice(GLint level, TextureFormat internalFormat, const Vector3i& size, PixelFormat format, PixelType type, const GLvoid* data, const PixelStorage&); + void MAGNUM_GL_LOCAL imageImplementationSvga3DSliceBySlice(GLint level, TextureFormat internalFormat, const Vector3i& size, PixelFormat format, PixelType type, const GLvoid* data, const PixelStorage&); #endif /* Had to put explicit "3D" in the name so it's not overloaded and Clang is able to pass it as template parameter to subImageImplementationSvga3DSliceBySlice(). GCC had no problem with the original. */ - void MAGNUM_LOCAL subImage3DImplementationDefault(GLint level, const Vector3i& offset, const Vector3i& size, PixelFormat format, PixelType type, const GLvoid* data, const PixelStorage&); + void MAGNUM_GL_LOCAL subImage3DImplementationDefault(GLint level, const Vector3i& offset, const Vector3i& size, PixelFormat format, PixelType type, const GLvoid* data, const PixelStorage&); #ifndef MAGNUM_TARGET_WEBGL - template void MAGNUM_LOCAL subImageImplementationSvga3DSliceBySlice(GLint level, const Vector3i& offset, const Vector3i& size, PixelFormat format, PixelType type, const GLvoid* data, const PixelStorage& storage); + template void MAGNUM_GL_LOCAL subImageImplementationSvga3DSliceBySlice(GLint level, const Vector3i& offset, const Vector3i& size, PixelFormat format, PixelType type, const GLvoid* data, const PixelStorage& storage); #endif - void MAGNUM_LOCAL compressedSubImageImplementationDefault(GLint level, const Vector3i& offset, const Vector3i& size, CompressedPixelFormat format, const GLvoid* data, GLsizei dataSize); + void MAGNUM_GL_LOCAL compressedSubImageImplementationDefault(GLint level, const Vector3i& offset, const Vector3i& size, CompressedPixelFormat format, const GLvoid* data, GLsizei dataSize); #endif #ifndef MAGNUM_TARGET_GLES - void MAGNUM_LOCAL subImage3DImplementationDSA(GLint level, const Vector3i& offset, const Vector3i& size, PixelFormat format, PixelType type, const GLvoid* data, const PixelStorage&); + void MAGNUM_GL_LOCAL subImage3DImplementationDSA(GLint level, const Vector3i& offset, const Vector3i& size, PixelFormat format, PixelType type, const GLvoid* data, const PixelStorage&); #ifndef MAGNUM_TARGET_WEBGL - void MAGNUM_LOCAL subImageImplementationDSAEXT(GLint level, const Vector3i& offset, const Vector3i& size, PixelFormat format, PixelType type, const GLvoid* data, const PixelStorage&); + void MAGNUM_GL_LOCAL subImageImplementationDSAEXT(GLint level, const Vector3i& offset, const Vector3i& size, PixelFormat format, PixelType type, const GLvoid* data, const PixelStorage&); #endif - void MAGNUM_LOCAL compressedSubImageImplementationDSA(GLint level, const Vector3i& offset, const Vector3i& size, CompressedPixelFormat format, const GLvoid* data, GLsizei dataSize); - void MAGNUM_LOCAL compressedSubImageImplementationDSAEXT(GLint level, const Vector3i& offset, const Vector3i& size, CompressedPixelFormat format, const GLvoid* data, GLsizei dataSize); + void MAGNUM_GL_LOCAL compressedSubImageImplementationDSA(GLint level, const Vector3i& offset, const Vector3i& size, CompressedPixelFormat format, const GLvoid* data, GLsizei dataSize); + void MAGNUM_GL_LOCAL compressedSubImageImplementationDSAEXT(GLint level, const Vector3i& offset, const Vector3i& size, CompressedPixelFormat format, const GLvoid* data, GLsizei dataSize); #endif - void MAGNUM_LOCAL invalidateImageImplementationNoOp(GLint level); + void MAGNUM_GL_LOCAL invalidateImageImplementationNoOp(GLint level); #ifndef MAGNUM_TARGET_GLES - void MAGNUM_LOCAL invalidateImageImplementationARB(GLint level); + void MAGNUM_GL_LOCAL invalidateImageImplementationARB(GLint level); #endif - void MAGNUM_LOCAL invalidateSubImageImplementationNoOp(GLint level, const Vector3i& offset, const Vector3i& size); + void MAGNUM_GL_LOCAL invalidateSubImageImplementationNoOp(GLint level, const Vector3i& offset, const Vector3i& size); #ifndef MAGNUM_TARGET_GLES - void MAGNUM_LOCAL invalidateSubImageImplementationARB(GLint level, const Vector3i& offset, const Vector3i& size); + void MAGNUM_GL_LOCAL invalidateSubImageImplementationARB(GLint level, const Vector3i& offset, const Vector3i& size); #endif GLuint _id; @@ -709,7 +710,7 @@ class MAGNUM_EXPORT AbstractTexture: public AbstractObject { #ifndef DOXYGEN_GENERATING_OUTPUT #ifndef MAGNUM_TARGET_GLES -template<> struct MAGNUM_EXPORT AbstractTexture::DataHelper<1> { +template<> struct MAGNUM_GL_EXPORT AbstractTexture::DataHelper<1> { static Math::Vector<1, GLint> compressedBlockSize(GLenum target, TextureFormat format); static Math::Vector<1, GLint> imageSize(AbstractTexture& texture, GLint level); @@ -730,7 +731,7 @@ template<> struct MAGNUM_EXPORT AbstractTexture::DataHelper<1> { static void invalidateSubImage(AbstractTexture& texture, GLint level, const Math::Vector<1, GLint>& offset, const Math::Vector<1, GLint>& size); }; #endif -template<> struct MAGNUM_EXPORT AbstractTexture::DataHelper<2> { +template<> struct MAGNUM_GL_EXPORT AbstractTexture::DataHelper<2> { #ifndef MAGNUM_TARGET_GLES static Vector2i compressedBlockSize(GLenum target, TextureFormat format); #endif @@ -774,7 +775,7 @@ template<> struct MAGNUM_EXPORT AbstractTexture::DataHelper<2> { static void invalidateSubImage(AbstractTexture& texture, GLint level, const Vector2i& offset, const Vector2i& size); }; -template<> struct MAGNUM_EXPORT AbstractTexture::DataHelper<3> { +template<> struct MAGNUM_GL_EXPORT AbstractTexture::DataHelper<3> { #if !(defined(MAGNUM_TARGET_WEBGL) && defined(MAGNUM_TARGET_GLES2)) #ifndef MAGNUM_TARGET_GLES static Vector3i compressedBlockSize(GLenum target, TextureFormat format); diff --git a/src/Magnum/Attribute.cpp b/src/Magnum/GL/Attribute.cpp similarity index 100% rename from src/Magnum/Attribute.cpp rename to src/Magnum/GL/Attribute.cpp diff --git a/src/Magnum/Attribute.h b/src/Magnum/GL/Attribute.h similarity index 94% rename from src/Magnum/Attribute.h rename to src/Magnum/GL/Attribute.h index 7a3a47baa..59f257635 100644 --- a/src/Magnum/Attribute.h +++ b/src/Magnum/GL/Attribute.h @@ -1,5 +1,5 @@ -#ifndef Magnum_Attribute_h -#define Magnum_Attribute_h +#ifndef Magnum_GL_Attribute_h +#define Magnum_GL_Attribute_h /* This file is part of Magnum. @@ -32,8 +32,8 @@ #include #include "Magnum/Magnum.h" -#include "Magnum/OpenGL.h" -#include "Magnum/visibility.h" +#include "Magnum/GL/OpenGL.h" +#include "Magnum/GL/visibility.h" namespace Magnum { @@ -533,10 +533,10 @@ template<> struct SizedAttribute<1, 4>: SizedVectorAttribute<1> { enum class Components: GLint { One = 1, Two = 2, Three = 3, Four = 4 }; constexpr static Components DefaultComponents = Components::Four; }; -MAGNUM_EXPORT Debug& operator<<(Debug& debug, SizedAttribute<1, 1>::Components value); -MAGNUM_EXPORT Debug& operator<<(Debug& debug, SizedAttribute<1, 2>::Components value); -MAGNUM_EXPORT Debug& operator<<(Debug& debug, SizedAttribute<1, 3>::Components value); -MAGNUM_EXPORT Debug& operator<<(Debug& debug, SizedAttribute<1, 4>::Components value); +MAGNUM_GL_EXPORT Debug& operator<<(Debug& debug, SizedAttribute<1, 1>::Components value); +MAGNUM_GL_EXPORT Debug& operator<<(Debug& debug, SizedAttribute<1, 2>::Components value); +MAGNUM_GL_EXPORT Debug& operator<<(Debug& debug, SizedAttribute<1, 3>::Components value); +MAGNUM_GL_EXPORT Debug& operator<<(Debug& debug, SizedAttribute<1, 4>::Components value); /* Matrix attribute sizes */ template struct SizedMatrixAttribute; @@ -552,9 +552,9 @@ template<> struct SizedMatrixAttribute<4> { enum class Components: GLint { Four = 4 }; constexpr static Components DefaultComponents = Components::Four; }; -MAGNUM_EXPORT Debug& operator<<(Debug& debug, SizedMatrixAttribute<2>::Components value); -MAGNUM_EXPORT Debug& operator<<(Debug& debug, SizedMatrixAttribute<3>::Components value); -MAGNUM_EXPORT Debug& operator<<(Debug& debug, SizedMatrixAttribute<4>::Components value); +MAGNUM_GL_EXPORT Debug& operator<<(Debug& debug, SizedMatrixAttribute<2>::Components value); +MAGNUM_GL_EXPORT Debug& operator<<(Debug& debug, SizedMatrixAttribute<3>::Components value); +MAGNUM_GL_EXPORT Debug& operator<<(Debug& debug, SizedMatrixAttribute<4>::Components value); template<> struct SizedAttribute<2, 2>: SizedVectorAttribute<2>, SizedMatrixAttribute<2> {}; template<> struct SizedAttribute<3, 3>: SizedVectorAttribute<3>, SizedMatrixAttribute<3> {}; template<> struct SizedAttribute<4, 4>: SizedVectorAttribute<4>, SizedMatrixAttribute<4> {}; @@ -600,12 +600,12 @@ struct FloatAttribute { }; typedef Containers::EnumSet DataOptions; - static UnsignedInt MAGNUM_EXPORT size(GLint components, DataType dataType); + static UnsignedInt MAGNUM_GL_EXPORT size(GLint components, DataType dataType); }; CORRADE_ENUMSET_OPERATORS(FloatAttribute::DataOptions) -MAGNUM_EXPORT Debug& operator<<(Debug& debug, FloatAttribute::DataType value); +MAGNUM_GL_EXPORT Debug& operator<<(Debug& debug, FloatAttribute::DataType value); #ifndef MAGNUM_TARGET_GLES2 /* Base for int attributes */ @@ -625,12 +625,12 @@ struct IntAttribute { enum class DataOption: UnsignedByte {}; typedef Containers::EnumSet DataOptions; - static UnsignedInt MAGNUM_EXPORT size(GLint components, DataType dataType); + static UnsignedInt MAGNUM_GL_EXPORT size(GLint components, DataType dataType); }; CORRADE_ENUMSET_OPERATORS(IntAttribute::DataOptions) -MAGNUM_EXPORT Debug& operator<<(Debug& debug, IntAttribute::DataType value); +MAGNUM_GL_EXPORT Debug& operator<<(Debug& debug, IntAttribute::DataType value); /* Base for unsigned int attributes */ struct UnsignedIntAttribute { @@ -661,10 +661,10 @@ struct DoubleAttribute { typedef IntAttribute::DataOption DataOption; typedef IntAttribute::DataOptions DataOptions; - static UnsignedInt MAGNUM_EXPORT size(GLint components, DataType dataType); + static UnsignedInt MAGNUM_GL_EXPORT size(GLint components, DataType dataType); }; -MAGNUM_EXPORT Debug& operator<<(Debug& debug, DoubleAttribute::DataType value); +MAGNUM_GL_EXPORT Debug& operator<<(Debug& debug, DoubleAttribute::DataType value); #endif /* Floating-point three-component vector has additional data type compared to @@ -697,10 +697,10 @@ template<> struct Attribute>: SizedAttribute<1, 3> { typedef FloatAttribute::DataOption DataOption; typedef FloatAttribute::DataOptions DataOptions; - static UnsignedInt MAGNUM_EXPORT size(GLint components, DataType dataType); + static UnsignedInt MAGNUM_GL_EXPORT size(GLint components, DataType dataType); }; -MAGNUM_EXPORT Debug& operator<<(Debug& debug, Attribute>::DataType value); +MAGNUM_GL_EXPORT Debug& operator<<(Debug& debug, Attribute>::DataType value); /* Floating-point four-component vector is absolutely special case */ template<> struct Attribute> { @@ -748,11 +748,11 @@ template<> struct Attribute> { enum: UnsignedInt { VectorCount = 1 }; - static UnsignedInt MAGNUM_EXPORT size(GLint components, DataType dataType); + static UnsignedInt MAGNUM_GL_EXPORT size(GLint components, DataType dataType); }; -MAGNUM_EXPORT Debug& operator<<(Debug& debug, Attribute>::Components value); -MAGNUM_EXPORT Debug& operator<<(Debug& debug, Attribute>::DataType value); +MAGNUM_GL_EXPORT Debug& operator<<(Debug& debug, Attribute>::Components value); +MAGNUM_GL_EXPORT Debug& operator<<(Debug& debug, Attribute>::DataType value); /* Common float, int, unsigned int and double scalar attributes */ template<> struct Attribute: FloatAttribute, SizedAttribute<1, 1> {}; diff --git a/src/Magnum/Buffer.cpp b/src/Magnum/GL/Buffer.cpp similarity index 98% rename from src/Magnum/Buffer.cpp rename to src/Magnum/GL/Buffer.cpp index 56b87ab11..1ad2ffd0f 100644 --- a/src/Magnum/Buffer.cpp +++ b/src/Magnum/GL/Buffer.cpp @@ -28,15 +28,14 @@ #include #include -#include "Magnum/Context.h" -#include "Magnum/Extensions.h" - -#include "Implementation/State.h" -#include "Implementation/BufferState.h" +#include "Magnum/GL/Context.h" +#include "Magnum/GL/Extensions.h" +#include "Magnum/GL/Implementation/State.h" +#include "Magnum/GL/Implementation/BufferState.h" #ifndef MAGNUM_TARGET_WEBGL -#include "Implementation/DebugState.h" +#include "Magnum/GL/Implementation/DebugState.h" #endif -#include "Implementation/MeshState.h" +#include "Magnum/GL/Implementation/MeshState.h" namespace Magnum { diff --git a/src/Magnum/Buffer.h b/src/Magnum/GL/Buffer.h similarity index 93% rename from src/Magnum/Buffer.h rename to src/Magnum/GL/Buffer.h index 81f4b7849..277c6a071 100644 --- a/src/Magnum/Buffer.h +++ b/src/Magnum/GL/Buffer.h @@ -1,5 +1,5 @@ -#ifndef Magnum_Buffer_h -#define Magnum_Buffer_h +#ifndef Magnum_GL_Buffer_h +#define Magnum_GL_Buffer_h /* This file is part of Magnum. @@ -36,9 +36,9 @@ #include #include -#include "Magnum/AbstractObject.h" -#include "Magnum/Magnum.h" #include "Magnum/Tags.h" +#include "Magnum/GL/AbstractObject.h" +#include "Magnum/GL/GL.h" #ifdef MAGNUM_BUILD_DEPRECATED #include @@ -147,32 +147,32 @@ Default way to set or update buffer data with @ref setData() or @ref setSubData( is to use @ref Corrade::Containers::ArrayView. See its documentation for more information about automatic conversions etc. -@snippet Magnum.cpp Buffer-setdata +@snippet MagnumGL.cpp Buffer-setdata There is also overload for array-like containers from STL, such as @ref std::vector or @link std::array @endlink: -@snippet Magnum.cpp Buffer-setdata-stl +@snippet MagnumGL.cpp Buffer-setdata-stl @section Buffer-data-mapping Memory mapping Buffer data can be also updated asynchronously. First you need to allocate the buffer to desired size by passing @cpp nullptr @ce to @ref setData(), e.g.: -@snippet Magnum.cpp Buffer-setdata-allocate +@snippet MagnumGL.cpp Buffer-setdata-allocate Then you can map the buffer to client memory and operate with the memory directly. After you are done with the operation, call @ref unmap() to unmap the buffer again. The @ref map() functions return a view on `char` array and you may want to cast it to some useful type first using @ref Containers::arrayCast(): -@snippet Magnum.cpp Buffer-map +@snippet MagnumGL.cpp Buffer-map If you are updating only a few discrete portions of the buffer, you can use @ref MapFlag::FlushExplicit and @ref flushMappedRange() to reduce number of memory operations performed by OpenGL on unmapping. Example: -@snippet Magnum.cpp Buffer-flush +@snippet MagnumGL.cpp Buffer-flush @section Buffer-webgl-restrictions WebGL restrictions @@ -183,13 +183,13 @@ default uses any sufficient target when binding the buffer internally (e.g. for setting data). To avoid GL errors, the following, while completely fine on desktop, is not sufficient on WebGL: -@snippet Magnum.cpp Buffer-webgl-nope +@snippet MagnumGL.cpp Buffer-webgl-nope You have to set target hint to desired target, either in constructor or using @ref Buffer::setTargetHint() like this (and similarly for other bufffer types such as UBOs): -@snippet Magnum.cpp Buffer-webgl +@snippet MagnumGL.cpp Buffer-webgl To simplify debugging, @ref Mesh checks proper target hint when adding vertex and index buffers in WebGL. @@ -219,7 +219,7 @@ by OpenGL in order to preserve the data. If running on OpenGL ES or extension @extension{ARB,invalidate_subdata} (part of OpenGL 4.3) is not available, these functions do nothing. */ -class MAGNUM_EXPORT Buffer: public AbstractObject { +class MAGNUM_GL_EXPORT Buffer: public AbstractObject { friend Implementation::BufferState; public: @@ -1226,34 +1226,34 @@ class MAGNUM_EXPORT Buffer: public AbstractObject { private: static void bindInternal(TargetHint hint, Buffer* buffer); - TargetHint MAGNUM_LOCAL bindSomewhereInternal(TargetHint hint); + TargetHint MAGNUM_GL_LOCAL bindSomewhereInternal(TargetHint hint); #ifndef MAGNUM_TARGET_GLES2 - static void MAGNUM_LOCAL bindImplementationFallback(Target target, GLuint firstIndex, Containers::ArrayView buffers); + static void MAGNUM_GL_LOCAL bindImplementationFallback(Target target, GLuint firstIndex, Containers::ArrayView buffers); #ifndef MAGNUM_TARGET_GLES - static void MAGNUM_LOCAL bindImplementationMulti(Target target, GLuint firstIndex, Containers::ArrayView buffers); + static void MAGNUM_GL_LOCAL bindImplementationMulti(Target target, GLuint firstIndex, Containers::ArrayView buffers); #endif - static void MAGNUM_LOCAL bindImplementationFallback(Target target, GLuint firstIndex, Containers::ArrayView> buffers); + static void MAGNUM_GL_LOCAL bindImplementationFallback(Target target, GLuint firstIndex, Containers::ArrayView> buffers); #ifndef MAGNUM_TARGET_GLES - static void MAGNUM_LOCAL bindImplementationMulti(Target target, GLuint firstIndex, Containers::ArrayView> buffers); + static void MAGNUM_GL_LOCAL bindImplementationMulti(Target target, GLuint firstIndex, Containers::ArrayView> buffers); #endif - static void MAGNUM_LOCAL copyImplementationDefault(Buffer& read, Buffer& write, GLintptr readOffset, GLintptr writeOffset, GLsizeiptr size); + static void MAGNUM_GL_LOCAL copyImplementationDefault(Buffer& read, Buffer& write, GLintptr readOffset, GLintptr writeOffset, GLsizeiptr size); #ifndef MAGNUM_TARGET_GLES - static void MAGNUM_LOCAL copyImplementationDSA(Buffer& read, Buffer& write, GLintptr readOffset, GLintptr writeOffset, GLsizeiptr size); - static void MAGNUM_LOCAL copyImplementationDSAEXT(Buffer& read, Buffer& write, GLintptr readOffset, GLintptr writeOffset, GLsizeiptr size); + static void MAGNUM_GL_LOCAL copyImplementationDSA(Buffer& read, Buffer& write, GLintptr readOffset, GLintptr writeOffset, GLsizeiptr size); + static void MAGNUM_GL_LOCAL copyImplementationDSAEXT(Buffer& read, Buffer& write, GLintptr readOffset, GLintptr writeOffset, GLsizeiptr size); #endif #endif explicit Buffer(GLuint id, TargetHint targetHint, ObjectFlags flags) noexcept: _id{id}, _targetHint{targetHint}, _flags{flags} {} - void MAGNUM_LOCAL createImplementationDefault(); + void MAGNUM_GL_LOCAL createImplementationDefault(); #ifndef MAGNUM_TARGET_GLES - void MAGNUM_LOCAL createImplementationDSA(); + void MAGNUM_GL_LOCAL createImplementationDSA(); #endif - void MAGNUM_LOCAL createIfNotAlready(); + void MAGNUM_GL_LOCAL createIfNotAlready(); #ifndef MAGNUM_TARGET_WEBGL Buffer& setLabelInternal(Containers::ArrayView label); @@ -1263,63 +1263,63 @@ class MAGNUM_EXPORT Buffer: public AbstractObject { CORRADE_DEPRECATED("used only by deprecated subData()") void subDataInternal(GLintptr offset, GLsizeiptr size, GLvoid* data); #endif - void MAGNUM_LOCAL getParameterImplementationDefault(GLenum value, GLint* data); + void MAGNUM_GL_LOCAL getParameterImplementationDefault(GLenum value, GLint* data); #ifndef MAGNUM_TARGET_GLES - void MAGNUM_LOCAL getParameterImplementationDSA(GLenum value, GLint* data); - void MAGNUM_LOCAL getParameterImplementationDSAEXT(GLenum value, GLint* data); + void MAGNUM_GL_LOCAL getParameterImplementationDSA(GLenum value, GLint* data); + void MAGNUM_GL_LOCAL getParameterImplementationDSAEXT(GLenum value, GLint* data); #endif #ifndef MAGNUM_TARGET_GLES - void MAGNUM_LOCAL getSubDataImplementationDefault(GLintptr offset, GLsizeiptr size, GLvoid* data); - void MAGNUM_LOCAL getSubDataImplementationDSA(GLintptr offset, GLsizeiptr size, GLvoid* data); - void MAGNUM_LOCAL getSubDataImplementationDSAEXT(GLintptr offset, GLsizeiptr size, GLvoid* data); + void MAGNUM_GL_LOCAL getSubDataImplementationDefault(GLintptr offset, GLsizeiptr size, GLvoid* data); + void MAGNUM_GL_LOCAL getSubDataImplementationDSA(GLintptr offset, GLsizeiptr size, GLvoid* data); + void MAGNUM_GL_LOCAL getSubDataImplementationDSAEXT(GLintptr offset, GLsizeiptr size, GLvoid* data); #endif - void MAGNUM_LOCAL dataImplementationDefault(GLsizeiptr size, const GLvoid* data, BufferUsage usage); + void MAGNUM_GL_LOCAL dataImplementationDefault(GLsizeiptr size, const GLvoid* data, BufferUsage usage); #ifndef MAGNUM_TARGET_GLES - void MAGNUM_LOCAL dataImplementationDSA(GLsizeiptr size, const GLvoid* data, BufferUsage usage); - void MAGNUM_LOCAL dataImplementationDSAEXT(GLsizeiptr size, const GLvoid* data, BufferUsage usage); + void MAGNUM_GL_LOCAL dataImplementationDSA(GLsizeiptr size, const GLvoid* data, BufferUsage usage); + void MAGNUM_GL_LOCAL dataImplementationDSAEXT(GLsizeiptr size, const GLvoid* data, BufferUsage usage); #endif - void MAGNUM_LOCAL subDataImplementationDefault(GLintptr offset, GLsizeiptr size, const GLvoid* data); + void MAGNUM_GL_LOCAL subDataImplementationDefault(GLintptr offset, GLsizeiptr size, const GLvoid* data); #ifndef MAGNUM_TARGET_GLES - void MAGNUM_LOCAL subDataImplementationDSA(GLintptr offset, GLsizeiptr size, const GLvoid* data); - void MAGNUM_LOCAL subDataImplementationDSAEXT(GLintptr offset, GLsizeiptr size, const GLvoid* data); + void MAGNUM_GL_LOCAL subDataImplementationDSA(GLintptr offset, GLsizeiptr size, const GLvoid* data); + void MAGNUM_GL_LOCAL subDataImplementationDSAEXT(GLintptr offset, GLsizeiptr size, const GLvoid* data); #endif - void MAGNUM_LOCAL invalidateImplementationNoOp(); + void MAGNUM_GL_LOCAL invalidateImplementationNoOp(); #ifndef MAGNUM_TARGET_GLES - void MAGNUM_LOCAL invalidateImplementationARB(); + void MAGNUM_GL_LOCAL invalidateImplementationARB(); #endif - void MAGNUM_LOCAL invalidateSubImplementationNoOp(GLintptr offset, GLsizeiptr length); + void MAGNUM_GL_LOCAL invalidateSubImplementationNoOp(GLintptr offset, GLsizeiptr length); #ifndef MAGNUM_TARGET_GLES - void MAGNUM_LOCAL invalidateSubImplementationARB(GLintptr offset, GLsizeiptr length); + void MAGNUM_GL_LOCAL invalidateSubImplementationARB(GLintptr offset, GLsizeiptr length); #endif #ifndef MAGNUM_TARGET_WEBGL - void MAGNUM_LOCAL * mapImplementationDefault(MapAccess access); + void MAGNUM_GL_LOCAL * mapImplementationDefault(MapAccess access); #ifndef MAGNUM_TARGET_GLES - void MAGNUM_LOCAL * mapImplementationDSA(MapAccess access); - void MAGNUM_LOCAL * mapImplementationDSAEXT(MapAccess access); + void MAGNUM_GL_LOCAL * mapImplementationDSA(MapAccess access); + void MAGNUM_GL_LOCAL * mapImplementationDSAEXT(MapAccess access); #endif - void MAGNUM_LOCAL * mapRangeImplementationDefault(GLintptr offset, GLsizeiptr length, MapFlags access); + void MAGNUM_GL_LOCAL * mapRangeImplementationDefault(GLintptr offset, GLsizeiptr length, MapFlags access); #ifndef MAGNUM_TARGET_GLES - void MAGNUM_LOCAL * mapRangeImplementationDSA(GLintptr offset, GLsizeiptr length, MapFlags access); - void MAGNUM_LOCAL * mapRangeImplementationDSAEXT(GLintptr offset, GLsizeiptr length, MapFlags access); + void MAGNUM_GL_LOCAL * mapRangeImplementationDSA(GLintptr offset, GLsizeiptr length, MapFlags access); + void MAGNUM_GL_LOCAL * mapRangeImplementationDSAEXT(GLintptr offset, GLsizeiptr length, MapFlags access); #endif - void MAGNUM_LOCAL flushMappedRangeImplementationDefault(GLintptr offset, GLsizeiptr length); + void MAGNUM_GL_LOCAL flushMappedRangeImplementationDefault(GLintptr offset, GLsizeiptr length); #ifndef MAGNUM_TARGET_GLES - void MAGNUM_LOCAL flushMappedRangeImplementationDSA(GLintptr offset, GLsizeiptr length); - void MAGNUM_LOCAL flushMappedRangeImplementationDSAEXT(GLintptr offset, GLsizeiptr length); + void MAGNUM_GL_LOCAL flushMappedRangeImplementationDSA(GLintptr offset, GLsizeiptr length); + void MAGNUM_GL_LOCAL flushMappedRangeImplementationDSAEXT(GLintptr offset, GLsizeiptr length); #endif - bool MAGNUM_LOCAL unmapImplementationDefault(); + bool MAGNUM_GL_LOCAL unmapImplementationDefault(); #ifndef MAGNUM_TARGET_GLES - bool MAGNUM_LOCAL unmapImplementationDSA(); - bool MAGNUM_LOCAL unmapImplementationDSAEXT(); + bool MAGNUM_GL_LOCAL unmapImplementationDSA(); + bool MAGNUM_GL_LOCAL unmapImplementationDSAEXT(); #endif #endif @@ -1333,11 +1333,11 @@ CORRADE_ENUMSET_OPERATORS(Buffer::MapFlags) #endif /** @debugoperatorclassenum{Magnum::Buffer,Magnum::Buffer::TargetHint} */ -MAGNUM_EXPORT Debug& operator<<(Debug& debug, Buffer::TargetHint value); +MAGNUM_GL_EXPORT Debug& operator<<(Debug& debug, Buffer::TargetHint value); #ifndef MAGNUM_TARGET_GLES2 /** @debugoperatorclassenum{Magnum::Buffer,Magnum::Buffer::Target} */ -MAGNUM_EXPORT Debug& operator<<(Debug& debug, Buffer::Target value); +MAGNUM_GL_EXPORT Debug& operator<<(Debug& debug, Buffer::Target value); #endif inline Buffer::Buffer(NoCreateT) noexcept: _id{0}, _targetHint{TargetHint::Array}, _flags{ObjectFlag::DeleteOnDestruction} {} diff --git a/src/Magnum/BufferImage.cpp b/src/Magnum/GL/BufferImage.cpp similarity index 94% rename from src/Magnum/BufferImage.cpp rename to src/Magnum/GL/BufferImage.cpp index 1061216b8..df0645aff 100644 --- a/src/Magnum/BufferImage.cpp +++ b/src/Magnum/GL/BufferImage.cpp @@ -25,7 +25,7 @@ #include "BufferImage.h" -#include "Magnum/PixelFormat.h" +#include "Magnum/GL/PixelFormat.h" namespace Magnum { @@ -122,13 +122,13 @@ template Buffer CompressedBufferImage::relea } #ifndef DOXYGEN_GENERATING_OUTPUT -template class MAGNUM_EXPORT BufferImage<1>; -template class MAGNUM_EXPORT BufferImage<2>; -template class MAGNUM_EXPORT BufferImage<3>; +template class MAGNUM_GL_EXPORT BufferImage<1>; +template class MAGNUM_GL_EXPORT BufferImage<2>; +template class MAGNUM_GL_EXPORT BufferImage<3>; -template class MAGNUM_EXPORT CompressedBufferImage<1>; -template class MAGNUM_EXPORT CompressedBufferImage<2>; -template class MAGNUM_EXPORT CompressedBufferImage<3>; +template class MAGNUM_GL_EXPORT CompressedBufferImage<1>; +template class MAGNUM_GL_EXPORT CompressedBufferImage<2>; +template class MAGNUM_GL_EXPORT CompressedBufferImage<3>; #endif #endif diff --git a/src/Magnum/BufferImage.h b/src/Magnum/GL/BufferImage.h similarity index 99% rename from src/Magnum/BufferImage.h rename to src/Magnum/GL/BufferImage.h index 9041490ac..a78586af0 100644 --- a/src/Magnum/BufferImage.h +++ b/src/Magnum/GL/BufferImage.h @@ -1,5 +1,5 @@ -#ifndef Magnum_BufferImage_h -#define Magnum_BufferImage_h +#ifndef Magnum_GL_BufferImage_h +#define Magnum_GL_BufferImage_h /* This file is part of Magnum. @@ -31,9 +31,9 @@ */ #endif -#include "Magnum/Buffer.h" #include "Magnum/DimensionTraits.h" #include "Magnum/PixelStorage.h" +#include "Magnum/GL/Buffer.h" #include "Magnum/Math/Vector4.h" namespace Magnum { diff --git a/src/Magnum/BufferTexture.cpp b/src/Magnum/GL/BufferTexture.cpp similarity index 96% rename from src/Magnum/BufferTexture.cpp rename to src/Magnum/GL/BufferTexture.cpp index cfbc47bff..ef702a0e1 100644 --- a/src/Magnum/BufferTexture.cpp +++ b/src/Magnum/GL/BufferTexture.cpp @@ -26,12 +26,11 @@ #include "BufferTexture.h" #if !defined(MAGNUM_TARGET_GLES2) && !defined(MAGNUM_TARGET_WEBGL) -#include "Magnum/Buffer.h" -#include "Magnum/Context.h" -#include "Magnum/Extensions.h" - -#include "Implementation/State.h" -#include "Implementation/TextureState.h" +#include "Magnum/GL/Buffer.h" +#include "Magnum/GL/Context.h" +#include "Magnum/GL/Extensions.h" +#include "Magnum/GL/Implementation/State.h" +#include "Magnum/GL/Implementation/TextureState.h" namespace Magnum { diff --git a/src/Magnum/BufferTexture.h b/src/Magnum/GL/BufferTexture.h similarity index 90% rename from src/Magnum/BufferTexture.h rename to src/Magnum/GL/BufferTexture.h index a81b19b54..c313a7a80 100644 --- a/src/Magnum/BufferTexture.h +++ b/src/Magnum/GL/BufferTexture.h @@ -1,5 +1,5 @@ -#ifndef Magnum_BufferTexture_h -#define Magnum_BufferTexture_h +#ifndef Magnum_GL_BufferTexture_h +#define Magnum_GL_BufferTexture_h /* This file is part of Magnum. @@ -31,7 +31,7 @@ */ #endif -#include "Magnum/AbstractTexture.h" +#include "Magnum/GL/AbstractTexture.h" #if !defined(MAGNUM_TARGET_GLES2) && !defined(MAGNUM_TARGET_WEBGL) namespace Magnum { @@ -55,7 +55,7 @@ for more textures or store more than one data in it. Example usage: -@snippet Magnum.cpp BufferTexture-usage +@snippet MagnumGL.cpp BufferTexture-usage In shader, the texture is used via @glsl samplerBuffer @ce, @glsl isamplerBuffer @ce or @glsl usamplerBuffer @ce. Unlike in classic @@ -81,7 +81,7 @@ and respective function documentation for more information. @extension{EXT,texture_buffer} @requires_gles Texture buffers are not available in WebGL. */ -class MAGNUM_EXPORT BufferTexture: public AbstractTexture { +class MAGNUM_GL_EXPORT BufferTexture: public AbstractTexture { friend Implementation::TextureState; public: @@ -223,22 +223,22 @@ class MAGNUM_EXPORT BufferTexture: public AbstractTexture { private: explicit BufferTexture(GLuint id, ObjectFlags flags): AbstractTexture{id, GL_TEXTURE_BUFFER, flags} {} - void MAGNUM_LOCAL setBufferImplementationDefault(BufferTextureFormat internalFormat, Buffer& buffer); + void MAGNUM_GL_LOCAL setBufferImplementationDefault(BufferTextureFormat internalFormat, Buffer& buffer); #ifdef MAGNUM_TARGET_GLES - void MAGNUM_LOCAL setBufferImplementationEXT(BufferTextureFormat internalFormat, Buffer& buffer); + void MAGNUM_GL_LOCAL setBufferImplementationEXT(BufferTextureFormat internalFormat, Buffer& buffer); #endif #ifndef MAGNUM_TARGET_GLES - void MAGNUM_LOCAL setBufferImplementationDSA(BufferTextureFormat internalFormat, Buffer& buffer); - void MAGNUM_LOCAL setBufferImplementationDSAEXT(BufferTextureFormat internalFormat, Buffer& buffer); + void MAGNUM_GL_LOCAL setBufferImplementationDSA(BufferTextureFormat internalFormat, Buffer& buffer); + void MAGNUM_GL_LOCAL setBufferImplementationDSAEXT(BufferTextureFormat internalFormat, Buffer& buffer); #endif - void MAGNUM_LOCAL setBufferRangeImplementationDefault(BufferTextureFormat internalFormat, Buffer& buffer, GLintptr offset, GLsizeiptr size); + void MAGNUM_GL_LOCAL setBufferRangeImplementationDefault(BufferTextureFormat internalFormat, Buffer& buffer, GLintptr offset, GLsizeiptr size); #ifdef MAGNUM_TARGET_GLES - void MAGNUM_LOCAL setBufferRangeImplementationEXT(BufferTextureFormat internalFormat, Buffer& buffer, GLintptr offset, GLsizeiptr size); + void MAGNUM_GL_LOCAL setBufferRangeImplementationEXT(BufferTextureFormat internalFormat, Buffer& buffer, GLintptr offset, GLsizeiptr size); #endif #ifndef MAGNUM_TARGET_GLES - void MAGNUM_LOCAL setBufferRangeImplementationDSA(BufferTextureFormat internalFormat, Buffer& buffer, GLintptr offset, GLsizeiptr size); - void MAGNUM_LOCAL setBufferRangeImplementationDSAEXT(BufferTextureFormat internalFormat, Buffer& buffer, GLintptr offset, GLsizeiptr size); + void MAGNUM_GL_LOCAL setBufferRangeImplementationDSA(BufferTextureFormat internalFormat, Buffer& buffer, GLintptr offset, GLsizeiptr size); + void MAGNUM_GL_LOCAL setBufferRangeImplementationDSAEXT(BufferTextureFormat internalFormat, Buffer& buffer, GLintptr offset, GLsizeiptr size); #endif }; diff --git a/src/Magnum/BufferTextureFormat.h b/src/Magnum/GL/BufferTextureFormat.h similarity index 97% rename from src/Magnum/BufferTextureFormat.h rename to src/Magnum/GL/BufferTextureFormat.h index 7ff33cb0d..f861afee0 100644 --- a/src/Magnum/BufferTextureFormat.h +++ b/src/Magnum/GL/BufferTextureFormat.h @@ -1,5 +1,5 @@ -#ifndef Magnum_BufferTextureFormat_h -#define Magnum_BufferTextureFormat_h +#ifndef Magnum_GL_BufferTextureFormat_h +#define Magnum_GL_BufferTextureFormat_h /* This file is part of Magnum. @@ -31,7 +31,7 @@ */ #endif -#include "Magnum/OpenGL.h" +#include "Magnum/GL/OpenGL.h" #if !defined(MAGNUM_TARGET_GLES2) && !defined(MAGNUM_TARGET_WEBGL) namespace Magnum { diff --git a/src/Magnum/GL/CMakeLists.txt b/src/Magnum/GL/CMakeLists.txt new file mode 100644 index 000000000..1408e5aa7 --- /dev/null +++ b/src/Magnum/GL/CMakeLists.txt @@ -0,0 +1,257 @@ +# +# This file is part of Magnum. +# +# Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018 +# Vladimír Vondruš +# +# Permission is hereby granted, free of charge, to any person obtaining a +# copy of this software and associated documentation files (the "Software"), +# to deal in the Software without restriction, including without limitation +# the rights to use, copy, modify, merge, publish, distribute, sublicense, +# and/or sell copies of the Software, and to permit persons to whom the +# Software is furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included +# in all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +# DEALINGS IN THE SOFTWARE. +# + +set(MagnumGL_SRCS + AbstractFramebuffer.cpp + AbstractObject.cpp + AbstractTexture.cpp + AbstractShaderProgram.cpp + Attribute.cpp + Buffer.cpp + CubeMapTexture.cpp + Context.cpp + DefaultFramebuffer.cpp + Framebuffer.cpp + ../Image.cpp # temporary + ../ImageView.cpp # temporary + Mesh.cpp + MeshView.cpp + OpenGL.cpp + PixelFormat.cpp + ../PixelStorage.cpp # temporary + Renderbuffer.cpp + Renderer.cpp + Sampler.cpp + Shader.cpp + Texture.cpp + Version.cpp + + Implementation/BufferState.cpp + Implementation/ContextState.cpp + Implementation/FramebufferState.cpp + Implementation/MeshState.cpp + Implementation/RendererState.cpp + Implementation/ShaderProgramState.cpp + Implementation/ShaderState.cpp + Implementation/State.cpp + Implementation/TextureState.cpp + Implementation/driverSpecific.cpp + Implementation/maxTextureSize.cpp) + +set(MagnumGL_HEADERS + AbstractFramebuffer.h + AbstractObject.h + AbstractShaderProgram.h + AbstractTexture.h + Attribute.h + Buffer.h + Context.h + CubeMapTexture.h + DefaultFramebuffer.h + Extensions.h + Framebuffer.h + GL.h + Mesh.h + MeshView.h + OpenGL.h + PixelFormat.h + Renderbuffer.h + RenderbufferFormat.h + Renderer.h + Sampler.h + Shader.h + Texture.h + TextureFormat.h + Version.h + + visibility.h) + +# Header files to display in project view of IDEs only +set(MagnumGL_PRIVATE_HEADERS + Implementation/BufferState.h + Implementation/ContextState.h + Implementation/FramebufferState.h + Implementation/maxTextureSize.h + Implementation/MeshState.h + Implementation/RendererState.h + Implementation/ShaderProgramState.h + Implementation/ShaderState.h + Implementation/State.h + Implementation/TextureState.h) + +# Desktop-only stuff +if(NOT TARGET_GLES) + list(APPEND MagnumGL_SRCS RectangleTexture.cpp) + list(APPEND MagnumGL_HEADERS RectangleTexture.h) +endif() + +# OpenGL ES 3.0 and WebGL 2.0 stuff +if(NOT TARGET_GLES2) + list(APPEND MagnumGL_SRCS + BufferImage.cpp + PrimitiveQuery.cpp + TextureArray.cpp + TransformFeedback.cpp + + Implementation/TransformFeedbackState.cpp) + + list(APPEND MagnumGL_HEADERS + BufferImage.h + PrimitiveQuery.h + TextureArray.h + TransformFeedback.h) + + list(APPEND MagnumGL_PRIVATE_HEADES + Implementation/TransformFeedbackState.h) +endif() + +# Desktop and OpenGL ES stuff that is not available in WebGL +if(NOT TARGET_WEBGL) + list(APPEND MagnumGL_SRCS + DebugOutput.cpp + + Implementation/DebugState.cpp) + + list(APPEND MagnumGL_HEADERS + DebugOutput.h + TimeQuery.h) + + list(APPEND MagnumGL_PRIVATE_HEADERS + Implementation/DebugState.h) + + # Desktop and OpenGL ES 3.0 stuff that is not available in ES2 and WebGL + if(NOT TARGET_GLES2) + list(APPEND MagnumGL_SRCS + BufferTexture.cpp + CubeMapTextureArray.cpp + MultisampleTexture.cpp) + list(APPEND MagnumGL_HEADERS + BufferTexture.h + BufferTextureFormat.h + CubeMapTextureArray.h + ImageFormat.h + MultisampleTexture.h) + endif() +endif() + +# Desktop, OpenGL ES and WebGL 2.0 stuff that is not available in WebGL 1.0 +if(NOT (TARGET_WEBGL AND TARGET_GLES2)) + list(APPEND MagnumGL_SRCS + AbstractQuery.cpp + + Implementation/QueryState.cpp) + + list(APPEND MagnumGL_HEADERS + AbstractQuery.h + SampleQuery.h) + + list(APPEND MagnumGL_PRIVATE_HEADERS + Implementation/QueryState.h) +endif() + +# Link in GL function pointer variables on platforms that support it +if(NOT CORRADE_TARGET_EMSCRIPTEN) + list(APPEND MagnumGL_SRCS $) +endif() + +# GL library +add_library(MagnumGL ${SHARED_OR_STATIC} + ${MagnumGL_SRCS} + ${MagnumGL_HEADERS} + ${MagnumGL_PRIVATE_HEADERS}) +set_target_properties(MagnumGL PROPERTIES + DEBUG_POSTFIX "-d" + FOLDER "Magnum/GL") +if(NOT BUILD_STATIC) + target_compile_definitions(MagnumGL PRIVATE "FlextGL_EXPORTS") + set_target_properties(MagnumGL PROPERTIES VERSION ${MAGNUM_LIBRARY_VERSION} SOVERSION ${MAGNUM_LIBRARY_SOVERSION}) +elseif(BUILD_STATIC_PIC) + set_target_properties(MagnumGL PROPERTIES POSITION_INDEPENDENT_CODE ON) +endif() +# We can use both implicit include path (GLES2/gl2.h) where our headers can +# be overriden with system ones or explicit (MagnumExternal/OpenGL/GLES2/gl2ext.h) +# where only our headers will be used +target_include_directories(MagnumGL PUBLIC + ${PROJECT_SOURCE_DIR}/src + ${PROJECT_BINARY_DIR}/src + ${PROJECT_SOURCE_DIR}/src/MagnumExternal/OpenGL) +target_link_libraries(MagnumGL PUBLIC Magnum) +if(NOT TARGET_GLES OR TARGET_DESKTOP_GLES) + target_link_libraries(MagnumGL PUBLIC ${OPENGL_gl_LIBRARY}) +elseif(TARGET_GLES2) + target_link_libraries(MagnumGL PUBLIC OpenGLES2::OpenGLES2) +else() + target_link_libraries(MagnumGL PUBLIC OpenGLES3::OpenGLES3) +endif() + +install(TARGETS MagnumGL + RUNTIME DESTINATION ${MAGNUM_BINARY_INSTALL_DIR} + LIBRARY DESTINATION ${MAGNUM_LIBRARY_INSTALL_DIR} + ARCHIVE DESTINATION ${MAGNUM_LIBRARY_INSTALL_DIR}) +install(FILES ${MagnumGL_HEADERS} DESTINATION ${MAGNUM_INCLUDE_INSTALL_DIR}/GL) + +# OpenGLTester class +if(WITH_OPENGLTESTER) + find_package(Corrade REQUIRED TestSuite) + + set(MagnumOpenGLTester_SRCS OpenGLTester.cpp) + set(MagnumOpenGLTester_HEADERS OpenGLTester.h) + if(BUILD_DEPRECATED) + set(MagnumOpenGLTester_DEPRECATED_HEADERS ../Test/AbstractOpenGLTester.h) + endif() + + add_library(MagnumOpenGLTester STATIC + ${MagnumOpenGLTester_SRCS} + ${MagnumOpenGLTester_HEADERS} + ${MagnumOpenGLTester_DEPRECATED_HEADERS}) # TODO: remove when the header is removed + set_target_properties(MagnumOpenGLTester PROPERTIES + DEBUG_POSTFIX "-d" + FOLDER "Magnum/GL") + # Assuming that PIC is not needed because the Tester lib is always linked + # to the executable and not to any intermediate shared lib + + # OPENGLTESTER_APPLICATION defined in the root CMakeLists, because it also + # enables the application library dependencies + target_link_libraries(MagnumOpenGLTester Magnum Corrade::TestSuite ${OPENGLTESTER_APPLICATION}) + + install(FILES ${MagnumOpenGLTester_HEADERS} DESTINATION ${MAGNUM_INCLUDE_INSTALL_DIR}/GL) + if(BUILD_DEPRECATED) + install(FILES ${MagnumOpenGLTester_DEPRECATED_HEADERS} DESTINATION ${MAGNUM_INCLUDE_INSTALL_DIR}/Test) + endif() + install(TARGETS MagnumOpenGLTester + RUNTIME DESTINATION ${MAGNUM_BINARY_INSTALL_DIR} + LIBRARY DESTINATION ${MAGNUM_LIBRARY_INSTALL_DIR} + ARCHIVE DESTINATION ${MAGNUM_LIBRARY_INSTALL_DIR}) + + # Magnum OpenGLTester target alias for superprojects + add_library(Magnum::OpenGLTester ALIAS MagnumOpenGLTester) +endif() + +if(BUILD_TESTS) + add_subdirectory(Test) +endif() + +# Magnum GL library target alias for superprojects +add_library(Magnum::GL ALIAS MagnumGL) diff --git a/src/Magnum/Context.cpp b/src/Magnum/GL/Context.cpp similarity index 97% rename from src/Magnum/Context.cpp rename to src/Magnum/GL/Context.cpp index a064b8344..adad03dfe 100644 --- a/src/Magnum/Context.cpp +++ b/src/Magnum/GL/Context.cpp @@ -36,30 +36,29 @@ #include #include -#include "Magnum/AbstractFramebuffer.h" -#include "Magnum/AbstractShaderProgram.h" -#include "Magnum/AbstractTexture.h" -#include "Magnum/Buffer.h" +#include "Magnum/GL/AbstractFramebuffer.h" +#include "Magnum/GL/AbstractShaderProgram.h" +#include "Magnum/GL/AbstractTexture.h" +#include "Magnum/GL/Buffer.h" #ifndef MAGNUM_TARGET_GLES -#include "Magnum/BufferTexture.h" +#include "Magnum/GL/BufferTexture.h" #endif -#include "Magnum/DefaultFramebuffer.h" -#include "Magnum/Extensions.h" -#include "Magnum/Framebuffer.h" -#include "Magnum/Mesh.h" -#include "Magnum/Renderbuffer.h" -#include "Magnum/Renderer.h" - -#include "Implementation/State.h" -#include "Implementation/ContextState.h" -#include "Implementation/BufferState.h" -#include "Implementation/FramebufferState.h" -#include "Implementation/MeshState.h" -#include "Implementation/RendererState.h" -#include "Implementation/ShaderProgramState.h" -#include "Implementation/TextureState.h" +#include "Magnum/GL/DefaultFramebuffer.h" +#include "Magnum/GL/Extensions.h" +#include "Magnum/GL/Framebuffer.h" +#include "Magnum/GL/Mesh.h" +#include "Magnum/GL/Renderbuffer.h" +#include "Magnum/GL/Renderer.h" +#include "Magnum/GL/Implementation/State.h" +#include "Magnum/GL/Implementation/ContextState.h" +#include "Magnum/GL/Implementation/BufferState.h" +#include "Magnum/GL/Implementation/FramebufferState.h" +#include "Magnum/GL/Implementation/MeshState.h" +#include "Magnum/GL/Implementation/RendererState.h" +#include "Magnum/GL/Implementation/ShaderProgramState.h" +#include "Magnum/GL/Implementation/TextureState.h" #ifndef MAGNUM_TARGET_GLES2 -#include "Implementation/TransformFeedbackState.h" +#include "Magnum/GL/Implementation/TransformFeedbackState.h" #endif namespace Magnum { diff --git a/src/Magnum/Context.h b/src/Magnum/GL/Context.h similarity index 96% rename from src/Magnum/Context.h rename to src/Magnum/GL/Context.h index a867c9161..0ea1f3b73 100644 --- a/src/Magnum/Context.h +++ b/src/Magnum/GL/Context.h @@ -1,5 +1,5 @@ -#ifndef Magnum_Context_h -#define Magnum_Context_h +#ifndef Magnum_GL_Context_h +#define Magnum_GL_Context_h /* This file is part of Magnum. @@ -37,9 +37,11 @@ #include #include "Magnum/Magnum.h" -#include "Magnum/OpenGL.h" #include "Magnum/Tags.h" -#include "Magnum/visibility.h" +#include "Magnum/GL/GL.h" +#include "Magnum/GL/OpenGL.h" + +#include "Magnum/GL/visibility.h" namespace Magnum { @@ -71,7 +73,7 @@ to core. See also @ref Extensions namespace, which contain compile-time information about OpenGL extensions. */ -class MAGNUM_EXPORT Extension { +class MAGNUM_GL_EXPORT Extension { public: /** @brief All extensions for given OpenGL version */ static const std::vector& extensions(Version version); @@ -133,7 +135,7 @@ options passed to the application itself. Options that don't have this prefix are completely ignored, see documentation of the @ref Utility-Arguments-delegating "Utility::Arguments" class for details. */ -class MAGNUM_EXPORT Context { +class MAGNUM_GL_EXPORT Context { public: #ifndef MAGNUM_TARGET_WEBGL /** @@ -502,7 +504,7 @@ class MAGNUM_EXPORT Context { * equivalent to subsequent @ref isVersionSupported() calls --- the two * following examples produce the same result: * - * @snippet Magnum.cpp Context-supportedVersion + * @snippet MagnumGL.cpp Context-supportedVersion * * If no version from the list is supported, returns lowest available * OpenGL version (@ref Version::GL210 for desktop OpenGL, @@ -517,7 +519,7 @@ class MAGNUM_EXPORT Context { * Extensions usable with this function are listed in @ref Extensions * namespace in header @ref Extensions.h. Example usage: * - * @snippet Magnum.cpp Context-isExtensionSupported + * @snippet MagnumGL.cpp Context-isExtensionSupported * * @see @ref isExtensionSupported(const Extension&) const, * @ref MAGNUM_ASSERT_EXTENSION_SUPPORTED(), @@ -535,7 +537,7 @@ class MAGNUM_EXPORT Context { * @p version. Useful mainly in shader compilation when the decisions * depend on selected GLSL version, for example: * - * @snippet Magnum.cpp Context-isExtensionSupported-version + * @snippet MagnumGL.cpp Context-isExtensionSupported-version */ template bool isExtensionSupported(Version version) const { return _extensionRequiredVersion[T::Index] <= version && _extensionStatus[T::Index]; @@ -625,7 +627,7 @@ class MAGNUM_EXPORT Context { /* This function is called from MeshState constructor, which means the state() pointer is not ready yet so we have to pass it directly */ - MAGNUM_LOCAL bool isCoreProfileInternal(Implementation::ContextState& state); + MAGNUM_GL_LOCAL bool isCoreProfileInternal(Implementation::ContextState& state); private: #ifndef DOXYGEN_GENERATING_OUTPUT /* https://bugzilla.gnome.org/show_bug.cgi?id=776986 */ @@ -640,11 +642,11 @@ class MAGNUM_EXPORT Context { void disableDriverWorkaround(const std::string& workaround); /* Defined in Implementation/driverSpecific.cpp */ - MAGNUM_LOCAL void setupDriverWorkarounds(); + MAGNUM_GL_LOCAL void setupDriverWorkarounds(); #ifndef MAGNUM_TARGET_GLES - MAGNUM_LOCAL bool isCoreProfileImplementationDefault(); - MAGNUM_LOCAL bool isCoreProfileImplementationNV(); + MAGNUM_GL_LOCAL bool isCoreProfileImplementationDefault(); + MAGNUM_GL_LOCAL bool isCoreProfileImplementationNV(); #endif void(*_functionLoader)(); @@ -674,17 +676,17 @@ CORRADE_ENUMSET_OPERATORS(Context::DetectedDrivers) #ifndef MAGNUM_TARGET_WEBGL /** @debugoperatorclassenum{Magnum::Context,Magnum::Context::Flag} */ -MAGNUM_EXPORT Debug& operator<<(Debug& debug, Context::Flag value); +MAGNUM_GL_EXPORT Debug& operator<<(Debug& debug, Context::Flag value); /** @debugoperatorclassenum{Magnum::Context,Magnum::Context::Flags} */ -MAGNUM_EXPORT Debug& operator<<(Debug& debug, Context::Flags value); +MAGNUM_GL_EXPORT Debug& operator<<(Debug& debug, Context::Flags value); #endif /** @debugoperatorclassenum{Magnum::Context,Magnum::Context::DetectedDriver} */ -MAGNUM_EXPORT Debug& operator<<(Debug& debug, Context::DetectedDriver value); +MAGNUM_GL_EXPORT Debug& operator<<(Debug& debug, Context::DetectedDriver value); /** @debugoperatorclassenum{Magnum::Context,Magnum::Context::DetectedDrivers} */ -MAGNUM_EXPORT Debug& operator<<(Debug& debug, Context::DetectedDrivers value); +MAGNUM_GL_EXPORT Debug& operator<<(Debug& debug, Context::DetectedDrivers value); /** @hideinitializer @brief Assert that given OpenGL version is supported @@ -696,7 +698,7 @@ By default, if assertion fails, an message is printed to error output and the application aborts. If `CORRADE_NO_ASSERT` is defined, this macro does nothing. Example usage: -@snippet Magnum.cpp Context-MAGNUM_ASSERT_VERSION_SUPPORTED +@snippet MagnumGL.cpp Context-MAGNUM_ASSERT_VERSION_SUPPORTED @see @ref Magnum::Context::isVersionSupported() "Context::isVersionSupported()", @ref MAGNUM_ASSERT_EXTENSION_SUPPORTED(), @ref CORRADE_ASSERT(), @@ -725,7 +727,7 @@ By default, if assertion fails, an message is printed to error output and the application aborts. If `CORRADE_NO_ASSERT` is defined, this macro does nothing. Example usage: -@snippet Magnum.cpp Context-MAGNUM_ASSERT_EXTENSION_SUPPORTED +@snippet MagnumGL.cpp Context-MAGNUM_ASSERT_EXTENSION_SUPPORTED @see @ref Magnum::Context::isExtensionSupported() "Context::isExtensionSupported()", @ref MAGNUM_ASSERT_VERSION_SUPPORTED(), @ref CORRADE_ASSERT(), diff --git a/src/Magnum/CubeMapTexture.cpp b/src/Magnum/GL/CubeMapTexture.cpp similarity index 99% rename from src/Magnum/CubeMapTexture.cpp rename to src/Magnum/GL/CubeMapTexture.cpp index 340626869..254339b4b 100644 --- a/src/Magnum/CubeMapTexture.cpp +++ b/src/Magnum/GL/CubeMapTexture.cpp @@ -25,15 +25,14 @@ #include "CubeMapTexture.h" +#include "Magnum/Image.h" #ifndef MAGNUM_TARGET_GLES2 -#include "Magnum/BufferImage.h" +#include "Magnum/GL/BufferImage.h" #endif -#include "Magnum/Context.h" -#include "Magnum/Image.h" - -#include "Implementation/maxTextureSize.h" -#include "Implementation/State.h" -#include "Implementation/TextureState.h" +#include "Magnum/GL/Context.h" +#include "Magnum/GL/Implementation/maxTextureSize.h" +#include "Magnum/GL/Implementation/State.h" +#include "Magnum/GL/Implementation/TextureState.h" namespace Magnum { diff --git a/src/Magnum/CubeMapTexture.h b/src/Magnum/GL/CubeMapTexture.h similarity index 91% rename from src/Magnum/CubeMapTexture.h rename to src/Magnum/GL/CubeMapTexture.h index 92559183c..789f210b6 100644 --- a/src/Magnum/CubeMapTexture.h +++ b/src/Magnum/GL/CubeMapTexture.h @@ -1,5 +1,5 @@ -#ifndef Magnum_CubeMapTexture_h -#define Magnum_CubeMapTexture_h +#ifndef Magnum_GL_CubeMapTexture_h +#define Magnum_GL_CubeMapTexture_h /* This file is part of Magnum. @@ -29,8 +29,8 @@ * @brief Class @ref Magnum::CubeMapTexture, enum @ref Magnum::CubeMapCoordinate */ -#include "Magnum/AbstractTexture.h" #include "Magnum/Array.h" +#include "Magnum/GL/AbstractTexture.h" #include "Magnum/Math/Vector2.h" namespace Magnum { @@ -72,7 +72,7 @@ See @ref Texture documentation for introduction. Common usage is to fully configure all texture parameters and then set the data from e.g. set of Image objects: -@snippet Magnum.cpp CubeMapTexture-usage +@snippet MagnumGL.cpp CubeMapTexture-usage In shader, the texture is used via @glsl samplerCube @ce, @glsl samplerCubeShadow @ce, @glsl isamplerCube @ce or @glsl usamplerCube @ce. Unlike in classic textures, @@ -85,7 +85,7 @@ of the cube, which intersects one of the six sides of the cube map. See @ref MultisampleTexture @m_keywords{GL_TEXTURE_CUBE_MAP} */ -class MAGNUM_EXPORT CubeMapTexture: public AbstractTexture { +class MAGNUM_GL_EXPORT CubeMapTexture: public AbstractTexture { friend Implementation::TextureState; public: @@ -531,7 +531,7 @@ class MAGNUM_EXPORT CubeMapTexture: public AbstractTexture { * * Convenience alternative to the above, example usage: * - * @snippet Magnum.cpp CubeMapTexture-image1 + * @snippet MagnumGL.cpp CubeMapTexture-image1 */ Image3D image(Int level, Image3D&& image); @@ -552,7 +552,7 @@ class MAGNUM_EXPORT CubeMapTexture: public AbstractTexture { * * Convenience alternative to the above, example usage: * - * @snippet Magnum.cpp CubeMapTexture-image2 + * @snippet MagnumGL.cpp CubeMapTexture-image2 */ BufferImage3D image(Int level, BufferImage3D&& image, BufferUsage usage); @@ -578,7 +578,7 @@ class MAGNUM_EXPORT CubeMapTexture: public AbstractTexture { * * Convenience alternative to the above, example usage: * - * @snippet Magnum.cpp CubeMapTexture-compressedImage1 + * @snippet MagnumGL.cpp CubeMapTexture-compressedImage1 */ CompressedImage3D compressedImage(Int level, CompressedImage3D&& image); @@ -599,7 +599,7 @@ class MAGNUM_EXPORT CubeMapTexture: public AbstractTexture { * * Convenience alternative to the above, example usage: * - * @snippet Magnum.cpp CubeMapTexture-compressedImage2 + * @snippet MagnumGL.cpp CubeMapTexture-compressedImage2 */ CompressedBufferImage3D compressedImage(Int level, CompressedBufferImage3D&& image, BufferUsage usage); @@ -639,7 +639,7 @@ class MAGNUM_EXPORT CubeMapTexture: public AbstractTexture { * * Convenience alternative to the above, example usage: * - * @snippet Magnum.cpp CubeMapTexture-image3 + * @snippet MagnumGL.cpp CubeMapTexture-image3 */ Image2D image(CubeMapCoordinate coordinate, Int level, Image2D&& image); @@ -659,7 +659,7 @@ class MAGNUM_EXPORT CubeMapTexture: public AbstractTexture { * * Convenience alternative to the above, example usage: * - * @snippet Magnum.cpp CubeMapTexture-image4 + * @snippet MagnumGL.cpp CubeMapTexture-image4 */ BufferImage2D image(CubeMapCoordinate coordinate, Int level, BufferImage2D&& image, BufferUsage usage); @@ -699,7 +699,7 @@ class MAGNUM_EXPORT CubeMapTexture: public AbstractTexture { * * Convenience alternative to the above, example usage: * - * @snippet Magnum.cpp CubeMapTexture-compressedImage3 + * @snippet MagnumGL.cpp CubeMapTexture-compressedImage3 */ CompressedImage2D compressedImage(CubeMapCoordinate coordinate, Int level, CompressedImage2D&& image); @@ -720,7 +720,7 @@ class MAGNUM_EXPORT CubeMapTexture: public AbstractTexture { * * Convenience alternative to the above, example usage: * - * @snippet Magnum.cpp CubeMapTexture-compressedImage4 + * @snippet MagnumGL.cpp CubeMapTexture-compressedImage4 */ CompressedBufferImage2D compressedImage(CubeMapCoordinate coordinate, Int level, CompressedBufferImage2D&& image, BufferUsage usage); @@ -742,7 +742,7 @@ class MAGNUM_EXPORT CubeMapTexture: public AbstractTexture { * * Convenience alternative to the above, example usage: * - * @snippet Magnum.cpp CubeMapTexture-subImage1 + * @snippet MagnumGL.cpp CubeMapTexture-subImage1 */ Image3D subImage(Int level, const Range3Di& range, Image3D&& image); @@ -764,7 +764,7 @@ class MAGNUM_EXPORT CubeMapTexture: public AbstractTexture { * * Convenience alternative to the above, example usage: * - * @snippet Magnum.cpp CubeMapTexture-subImage2 + * @snippet MagnumGL.cpp CubeMapTexture-subImage2 */ BufferImage3D subImage(Int level, const Range3Di& range, BufferImage3D&& image, BufferUsage usage); @@ -790,7 +790,7 @@ class MAGNUM_EXPORT CubeMapTexture: public AbstractTexture { * * Convenience alternative to the above, example usage: * - * @snippet Magnum.cpp CubeMapTexture-compressedSubImage1 + * @snippet MagnumGL.cpp CubeMapTexture-compressedSubImage1 */ CompressedImage3D compressedSubImage(Int level, const Range3Di& range, CompressedImage3D&& image); @@ -816,7 +816,7 @@ class MAGNUM_EXPORT CubeMapTexture: public AbstractTexture { * * Convenience alternative to the above, example usage: * - * @snippet Magnum.cpp CubeMapTexture-compressedSubImage2 + * @snippet MagnumGL.cpp CubeMapTexture-compressedSubImage2 */ CompressedBufferImage3D compressedSubImage(Int level, const Range3Di& range, CompressedBufferImage3D&& image, BufferUsage usage); #endif @@ -1071,52 +1071,52 @@ class MAGNUM_EXPORT CubeMapTexture: public AbstractTexture { explicit CubeMapTexture(GLuint id, ObjectFlags flags) noexcept: AbstractTexture{id, GL_TEXTURE_CUBE_MAP, flags} {} #if !defined(MAGNUM_TARGET_GLES2) && !defined(MAGNUM_TARGET_WEBGL) - void MAGNUM_LOCAL getLevelParameterImplementationDefault(GLint level, GLenum parameter, GLint* values); + void MAGNUM_GL_LOCAL getLevelParameterImplementationDefault(GLint level, GLenum parameter, GLint* values); #ifndef MAGNUM_TARGET_GLES - void MAGNUM_LOCAL getLevelParameterImplementationDSA(GLint level, GLenum parameter, GLint* values); - void MAGNUM_LOCAL getLevelParameterImplementationDSAEXT(GLint level, GLenum parameter, GLint* values); + void MAGNUM_GL_LOCAL getLevelParameterImplementationDSA(GLint level, GLenum parameter, GLint* values); + void MAGNUM_GL_LOCAL getLevelParameterImplementationDSAEXT(GLint level, GLenum parameter, GLint* values); #endif #endif #ifndef MAGNUM_TARGET_GLES - GLint MAGNUM_LOCAL getLevelCompressedImageSizeImplementationDefault(GLint level); - GLint MAGNUM_LOCAL getLevelCompressedImageSizeImplementationDefaultImmutableWorkaround(GLint level); - GLint MAGNUM_LOCAL getLevelCompressedImageSizeImplementationDSA(GLint level); - GLint MAGNUM_LOCAL getLevelCompressedImageSizeImplementationDSANonImmutableWorkaround(GLint level); - GLint MAGNUM_LOCAL getLevelCompressedImageSizeImplementationDSAEXT(GLint level); - GLint MAGNUM_LOCAL getLevelCompressedImageSizeImplementationDSAEXTImmutableWorkaround(GLint level); + GLint MAGNUM_GL_LOCAL getLevelCompressedImageSizeImplementationDefault(GLint level); + GLint MAGNUM_GL_LOCAL getLevelCompressedImageSizeImplementationDefaultImmutableWorkaround(GLint level); + GLint MAGNUM_GL_LOCAL getLevelCompressedImageSizeImplementationDSA(GLint level); + GLint MAGNUM_GL_LOCAL getLevelCompressedImageSizeImplementationDSANonImmutableWorkaround(GLint level); + GLint MAGNUM_GL_LOCAL getLevelCompressedImageSizeImplementationDSAEXT(GLint level); + GLint MAGNUM_GL_LOCAL getLevelCompressedImageSizeImplementationDSAEXTImmutableWorkaround(GLint level); #endif #ifndef MAGNUM_TARGET_GLES - void MAGNUM_LOCAL getCompressedImageImplementationDSA(GLint level, const Vector2i& size, std::size_t dataOffset, std::size_t dataSize, GLvoid* data); - void MAGNUM_LOCAL getCompressedImageImplementationDSASingleSliceWorkaround(GLint level, const Vector2i& size, std::size_t dataOffset, std::size_t dataSize, GLvoid* data); - - void MAGNUM_LOCAL getImageImplementationDefault(CubeMapCoordinate coordinate, GLint level, const Vector2i& size, PixelFormat format, PixelType type, std::size_t dataSize, GLvoid* data); - void MAGNUM_LOCAL getImageImplementationDSA(CubeMapCoordinate coordinate, GLint level, const Vector2i& size, PixelFormat format, PixelType type, std::size_t dataSize, GLvoid* data); - void MAGNUM_LOCAL getImageImplementationDSAEXT(CubeMapCoordinate coordinate, GLint level, const Vector2i& size, PixelFormat format, PixelType type, std::size_t dataSize, GLvoid* data); - void MAGNUM_LOCAL getImageImplementationRobustness(CubeMapCoordinate coordinate, GLint level, const Vector2i& size, PixelFormat format, PixelType type, std::size_t dataSize, GLvoid* data); - - void MAGNUM_LOCAL getCompressedImageImplementationDefault(CubeMapCoordinate coordinate, GLint level, const Vector2i& size, std::size_t dataSize, GLvoid* data); - void MAGNUM_LOCAL getCompressedImageImplementationDSA(CubeMapCoordinate coordinate, GLint level, const Vector2i& size, std::size_t dataSize, GLvoid* data); - void MAGNUM_LOCAL getCompressedImageImplementationDSAEXT(CubeMapCoordinate coordinate, GLint level, const Vector2i& size, std::size_t dataSize, GLvoid* data); - void MAGNUM_LOCAL getCompressedImageImplementationRobustness(CubeMapCoordinate coordinate, GLint level, const Vector2i& size, std::size_t dataSize, GLvoid* data); + void MAGNUM_GL_LOCAL getCompressedImageImplementationDSA(GLint level, const Vector2i& size, std::size_t dataOffset, std::size_t dataSize, GLvoid* data); + void MAGNUM_GL_LOCAL getCompressedImageImplementationDSASingleSliceWorkaround(GLint level, const Vector2i& size, std::size_t dataOffset, std::size_t dataSize, GLvoid* data); + + void MAGNUM_GL_LOCAL getImageImplementationDefault(CubeMapCoordinate coordinate, GLint level, const Vector2i& size, PixelFormat format, PixelType type, std::size_t dataSize, GLvoid* data); + void MAGNUM_GL_LOCAL getImageImplementationDSA(CubeMapCoordinate coordinate, GLint level, const Vector2i& size, PixelFormat format, PixelType type, std::size_t dataSize, GLvoid* data); + void MAGNUM_GL_LOCAL getImageImplementationDSAEXT(CubeMapCoordinate coordinate, GLint level, const Vector2i& size, PixelFormat format, PixelType type, std::size_t dataSize, GLvoid* data); + void MAGNUM_GL_LOCAL getImageImplementationRobustness(CubeMapCoordinate coordinate, GLint level, const Vector2i& size, PixelFormat format, PixelType type, std::size_t dataSize, GLvoid* data); + + void MAGNUM_GL_LOCAL getCompressedImageImplementationDefault(CubeMapCoordinate coordinate, GLint level, const Vector2i& size, std::size_t dataSize, GLvoid* data); + void MAGNUM_GL_LOCAL getCompressedImageImplementationDSA(CubeMapCoordinate coordinate, GLint level, const Vector2i& size, std::size_t dataSize, GLvoid* data); + void MAGNUM_GL_LOCAL getCompressedImageImplementationDSAEXT(CubeMapCoordinate coordinate, GLint level, const Vector2i& size, std::size_t dataSize, GLvoid* data); + void MAGNUM_GL_LOCAL getCompressedImageImplementationRobustness(CubeMapCoordinate coordinate, GLint level, const Vector2i& size, std::size_t dataSize, GLvoid* data); #endif - void MAGNUM_LOCAL subImageImplementationDefault(GLint level, const Vector3i& offset, const Vector3i& size, PixelFormat format, PixelType type, const GLvoid* data, const PixelStorage&); + void MAGNUM_GL_LOCAL subImageImplementationDefault(GLint level, const Vector3i& offset, const Vector3i& size, PixelFormat format, PixelType type, const GLvoid* data, const PixelStorage&); #ifndef MAGNUM_TARGET_WEBGL - void MAGNUM_LOCAL subImageImplementationSvga3DSliceBySlice(GLint level, const Vector3i& offset, const Vector3i& size, PixelFormat format, PixelType type, const GLvoid* data, const PixelStorage&); + void MAGNUM_GL_LOCAL subImageImplementationSvga3DSliceBySlice(GLint level, const Vector3i& offset, const Vector3i& size, PixelFormat format, PixelType type, const GLvoid* data, const PixelStorage&); #endif - void MAGNUM_LOCAL subImageImplementationDefault(CubeMapCoordinate coordinate, GLint level, const Vector2i& offset, const Vector2i& size, PixelFormat format, PixelType type, const GLvoid* data); + void MAGNUM_GL_LOCAL subImageImplementationDefault(CubeMapCoordinate coordinate, GLint level, const Vector2i& offset, const Vector2i& size, PixelFormat format, PixelType type, const GLvoid* data); #ifndef MAGNUM_TARGET_GLES - void MAGNUM_LOCAL subImageImplementationDSA(CubeMapCoordinate coordinate, GLint level, const Vector2i& offset, const Vector2i& size, PixelFormat format, PixelType type, const GLvoid* data); - void MAGNUM_LOCAL subImageImplementationDSAEXT(CubeMapCoordinate coordinate, GLint level, const Vector2i& offset, const Vector2i& size, PixelFormat format, PixelType type, const GLvoid* data); + void MAGNUM_GL_LOCAL subImageImplementationDSA(CubeMapCoordinate coordinate, GLint level, const Vector2i& offset, const Vector2i& size, PixelFormat format, PixelType type, const GLvoid* data); + void MAGNUM_GL_LOCAL subImageImplementationDSAEXT(CubeMapCoordinate coordinate, GLint level, const Vector2i& offset, const Vector2i& size, PixelFormat format, PixelType type, const GLvoid* data); #endif - void MAGNUM_LOCAL compressedSubImageImplementationDefault(CubeMapCoordinate coordinate, GLint level, const Vector2i& offset, const Vector2i& size, CompressedPixelFormat format, const GLvoid* data, GLsizei dataSize); + void MAGNUM_GL_LOCAL compressedSubImageImplementationDefault(CubeMapCoordinate coordinate, GLint level, const Vector2i& offset, const Vector2i& size, CompressedPixelFormat format, const GLvoid* data, GLsizei dataSize); #ifndef MAGNUM_TARGET_GLES - void MAGNUM_LOCAL compressedSubImageImplementationDSA(CubeMapCoordinate coordinate, GLint level, const Vector2i& offset, const Vector2i& size, CompressedPixelFormat format, const GLvoid* data, GLsizei dataSize); - void MAGNUM_LOCAL compressedSubImageImplementationDSAEXT(CubeMapCoordinate coordinate, GLint level, const Vector2i& offset, const Vector2i& size, CompressedPixelFormat format, const GLvoid* data, GLsizei dataSize); + void MAGNUM_GL_LOCAL compressedSubImageImplementationDSA(CubeMapCoordinate coordinate, GLint level, const Vector2i& offset, const Vector2i& size, CompressedPixelFormat format, const GLvoid* data, GLsizei dataSize); + void MAGNUM_GL_LOCAL compressedSubImageImplementationDSAEXT(CubeMapCoordinate coordinate, GLint level, const Vector2i& offset, const Vector2i& size, CompressedPixelFormat format, const GLvoid* data, GLsizei dataSize); #endif }; diff --git a/src/Magnum/CubeMapTextureArray.cpp b/src/Magnum/GL/CubeMapTextureArray.cpp similarity index 95% rename from src/Magnum/CubeMapTextureArray.cpp rename to src/Magnum/GL/CubeMapTextureArray.cpp index 5f614fc8d..c93543181 100644 --- a/src/Magnum/CubeMapTextureArray.cpp +++ b/src/Magnum/GL/CubeMapTextureArray.cpp @@ -26,12 +26,11 @@ #include "CubeMapTextureArray.h" #if !defined(MAGNUM_TARGET_GLES2) && !defined(MAGNUM_TARGET_WEBGL) -#include "Magnum/BufferImage.h" -#include "Magnum/Context.h" -#include "Magnum/Extensions.h" #include "Magnum/Image.h" - -#include "Implementation/maxTextureSize.h" +#include "Magnum/GL/BufferImage.h" +#include "Magnum/GL/Context.h" +#include "Magnum/GL/Extensions.h" +#include "Magnum/GL/Implementation/maxTextureSize.h" namespace Magnum { diff --git a/src/Magnum/CubeMapTextureArray.h b/src/Magnum/GL/CubeMapTextureArray.h similarity index 97% rename from src/Magnum/CubeMapTextureArray.h rename to src/Magnum/GL/CubeMapTextureArray.h index 559ea2d02..8a08c6eba 100644 --- a/src/Magnum/CubeMapTextureArray.h +++ b/src/Magnum/GL/CubeMapTextureArray.h @@ -1,5 +1,5 @@ -#ifndef Magnum_CubeMapTextureArray_h -#define Magnum_CubeMapTextureArray_h +#ifndef Magnum_GL_CubeMapTextureArray_h +#define Magnum_GL_CubeMapTextureArray_h /* This file is part of Magnum. @@ -31,8 +31,8 @@ */ #endif -#include "Magnum/AbstractTexture.h" #include "Magnum/Array.h" +#include "Magnum/GL/AbstractTexture.h" #include "Magnum/Math/Vector3.h" #if !defined(MAGNUM_TARGET_GLES2) && !defined(MAGNUM_TARGET_WEBGL) @@ -52,7 +52,7 @@ You have to allocate the memory for all layers and faces first by calling @ref setStorage(). Example: array with 4 layers of cube maps, each cube map consisting of six 64x64 images, i.e. 24 layers total: -@snippet Magnum.cpp CubeMapTextureArray-usage +@snippet MagnumGL.cpp CubeMapTextureArray-usage In shader, the texture is used via @glsl samplerCubeArray @ce, @glsl samplerCubeArrayShadow @ce, @glsl isamplerCubeArray @ce or @@ -72,7 +72,7 @@ more information about usage in shaders. @extension{EXT,texture_cube_map_array} @requires_gles Cube map texture arrays are not available in WebGL. */ -class MAGNUM_EXPORT CubeMapTextureArray: public AbstractTexture { +class MAGNUM_GL_EXPORT CubeMapTextureArray: public AbstractTexture { public: /** * @brief Max supported size of one side of cube map texture array @@ -443,7 +443,7 @@ class MAGNUM_EXPORT CubeMapTextureArray: public AbstractTexture { * * Convenience alternative to the above, example usage: * - * @snippet Magnum.cpp CubeMapTextureArray-image1 + * @snippet MagnumGL.cpp CubeMapTextureArray-image1 */ Image3D image(Int level, Image3D&& image); @@ -464,7 +464,7 @@ class MAGNUM_EXPORT CubeMapTextureArray: public AbstractTexture { * * Convenience alternative to the above, example usage: * - * @snippet Magnum.cpp CubeMapTextureArray-image2 + * @snippet MagnumGL.cpp CubeMapTextureArray-image2 */ BufferImage3D image(Int level, BufferImage3D&& image, BufferUsage usage); @@ -485,7 +485,7 @@ class MAGNUM_EXPORT CubeMapTextureArray: public AbstractTexture { * * Convenience alternative to the above, example usage: * - * @snippet Magnum.cpp CubeMapTextureArray-compressedImage1 + * @snippet MagnumGL.cpp CubeMapTextureArray-compressedImage1 */ CompressedImage3D compressedImage(Int level, CompressedImage3D&& image); @@ -506,7 +506,7 @@ class MAGNUM_EXPORT CubeMapTextureArray: public AbstractTexture { * * Convenience alternative to the above, example usage: * - * @snippet Magnum.cpp CubeMapTextureArray-compressedImage2 + * @snippet MagnumGL.cpp CubeMapTextureArray-compressedImage2 */ CompressedBufferImage3D compressedImage(Int level, CompressedBufferImage3D&& image, BufferUsage usage); @@ -528,7 +528,7 @@ class MAGNUM_EXPORT CubeMapTextureArray: public AbstractTexture { * * Convenience alternative to the above, example usage: * - * @snippet Magnum.cpp CubeMapTextureArray-subImage1 + * @snippet MagnumGL.cpp CubeMapTextureArray-subImage1 */ Image3D subImage(Int level, const Range3Di& range, Image3D&& image); @@ -550,7 +550,7 @@ class MAGNUM_EXPORT CubeMapTextureArray: public AbstractTexture { * * Convenience alternative to the above, example usage: * - * @snippet Magnum.cpp CubeMapTextureArray-subImage2 + * @snippet MagnumGL.cpp CubeMapTextureArray-subImage2 */ BufferImage3D subImage(Int level, const Range3Di& range, BufferImage3D&& image, BufferUsage usage); @@ -576,7 +576,7 @@ class MAGNUM_EXPORT CubeMapTextureArray: public AbstractTexture { * * Convenience alternative to the above, example usage: * - * @snippet Magnum.cpp CubeMapTextureArray-compressedSubImage1 + * @snippet MagnumGL.cpp CubeMapTextureArray-compressedSubImage1 */ CompressedImage3D compressedSubImage(Int level, const Range3Di& range, CompressedImage3D&& image); @@ -602,7 +602,7 @@ class MAGNUM_EXPORT CubeMapTextureArray: public AbstractTexture { * * Convenience alternative to the above, example usage: * - * @snippet Magnum.cpp CubeMapTextureArray-compressedSubImage2 + * @snippet MagnumGL.cpp CubeMapTextureArray-compressedSubImage2 */ CompressedBufferImage3D compressedSubImage(Int level, const Range3Di& range, CompressedBufferImage3D&& image, BufferUsage usage); #endif diff --git a/src/Magnum/DebugOutput.cpp b/src/Magnum/GL/DebugOutput.cpp similarity index 98% rename from src/Magnum/DebugOutput.cpp rename to src/Magnum/GL/DebugOutput.cpp index d1775dd27..ec092b361 100644 --- a/src/Magnum/DebugOutput.cpp +++ b/src/Magnum/GL/DebugOutput.cpp @@ -29,10 +29,10 @@ #include #include -#include "Magnum/Context.h" -#include "Magnum/Extensions.h" -#include "Magnum/Implementation/State.h" -#include "Magnum/Implementation/DebugState.h" +#include "Magnum/GL/Context.h" +#include "Magnum/GL/Extensions.h" +#include "Magnum/GL/Implementation/State.h" +#include "Magnum/GL/Implementation/DebugState.h" namespace Magnum { diff --git a/src/Magnum/DebugOutput.h b/src/Magnum/GL/DebugOutput.h similarity index 89% rename from src/Magnum/DebugOutput.h rename to src/Magnum/GL/DebugOutput.h index ffd7177a4..e1cab3031 100644 --- a/src/Magnum/DebugOutput.h +++ b/src/Magnum/GL/DebugOutput.h @@ -1,5 +1,5 @@ -#ifndef Magnum_DebugOutput_h -#define Magnum_DebugOutput_h +#ifndef Magnum_GL_DebugOutput_h +#define Magnum_GL_DebugOutput_h /* This file is part of Magnum. @@ -34,9 +34,9 @@ #include #include -#include "Magnum/OpenGL.h" #include "Magnum/Magnum.h" -#include "Magnum/visibility.h" +#include "Magnum/GL/OpenGL.h" +#include "Magnum/GL/visibility.h" #ifndef MAGNUM_TARGET_WEBGL namespace Magnum { @@ -74,7 +74,7 @@ application itself by setting up message callback using @ref setCallback() or @ref Renderer::Feature::DebugOutputSynchronous. Example usage, completely with @ref DebugGroup and @link DebugMessage @endlink: -@snippet Magnum.cpp DebugOutput-usage +@snippet MagnumGL.cpp DebugOutput-usage With default callback the group entering/leaving and the inserted message (and possibly also other messages) will be printed on standard output: @@ -103,7 +103,7 @@ objects with labels. See @ref AbstractQuery::setLabel(), @requires_gles Debug output is not available in WebGL. */ -class MAGNUM_EXPORT DebugOutput { +class MAGNUM_GL_EXPORT DebugOutput { friend Implementation::DebugState; public: @@ -382,7 +382,7 @@ class MAGNUM_EXPORT DebugOutput { * to @ref Corrade::Utility::Debug "Debug" output in the following * format: * - * @snippet Magnum.cpp DebugOutput-setDefaultCallback + * @snippet MagnumGL.cpp DebugOutput-setDefaultCallback * * @code{.shell-session} * Debug output: application marker (1337): Hello from OpenGL command stream! @@ -395,31 +395,31 @@ class MAGNUM_EXPORT DebugOutput { private: static void setEnabledInternal(GLenum source, GLenum type, GLenum severity, std::initializer_list ids, bool enabled); - static MAGNUM_LOCAL void controlImplementationNoOp(GLenum, GLenum, GLenum, std::initializer_list, bool); + static MAGNUM_GL_LOCAL void controlImplementationNoOp(GLenum, GLenum, GLenum, std::initializer_list, bool); #ifndef MAGNUM_TARGET_GLES2 - static MAGNUM_LOCAL void controlImplementationKhrDesktopES32(GLenum source, GLenum type, GLenum severity, std::initializer_list ids, bool enabled); + static MAGNUM_GL_LOCAL void controlImplementationKhrDesktopES32(GLenum source, GLenum type, GLenum severity, std::initializer_list ids, bool enabled); #endif #ifdef MAGNUM_TARGET_GLES - static MAGNUM_LOCAL void controlImplementationKhrES(GLenum source, GLenum type, GLenum severity, std::initializer_list ids, bool enabled); + static MAGNUM_GL_LOCAL void controlImplementationKhrES(GLenum source, GLenum type, GLenum severity, std::initializer_list ids, bool enabled); #endif - static MAGNUM_LOCAL void callbackImplementationNoOp(Callback, const void*); + static MAGNUM_GL_LOCAL void callbackImplementationNoOp(Callback, const void*); #ifndef MAGNUM_TARGET_GLES2 - static MAGNUM_LOCAL void callbackImplementationKhrDesktopES32(Callback callback, const void* userParam); + static MAGNUM_GL_LOCAL void callbackImplementationKhrDesktopES32(Callback callback, const void* userParam); #endif #ifdef MAGNUM_TARGET_GLES - static MAGNUM_LOCAL void callbackImplementationKhrES(Callback callback, const void* userParam); + static MAGNUM_GL_LOCAL void callbackImplementationKhrES(Callback callback, const void* userParam); #endif }; /** @debugoperatorclassenum{Magnum::DebugOutput,Magnum::DebugOutput::Source} */ -MAGNUM_EXPORT Debug& operator<<(Debug& debug, DebugOutput::Source value); +MAGNUM_GL_EXPORT Debug& operator<<(Debug& debug, DebugOutput::Source value); /** @debugoperatorclassenum{Magnum::DebugOutput,Magnum::DebugOutput::Type} */ -MAGNUM_EXPORT Debug& operator<<(Debug& debug, DebugOutput::Type value); +MAGNUM_GL_EXPORT Debug& operator<<(Debug& debug, DebugOutput::Type value); /** @debugoperatorclassenum{Magnum::DebugOutput,Magnum::DebugOutput::Severity} */ -MAGNUM_EXPORT Debug& operator<<(Debug& debug, DebugOutput::Severity value); +MAGNUM_GL_EXPORT Debug& operator<<(Debug& debug, DebugOutput::Severity value); /** @brief Debug message @@ -438,7 +438,7 @@ available and default debug output callback is enabled for given kind of messages, the inserted message will be printed on standard output in the following form: -@snippet Magnum.cpp DebugMessage-usage +@snippet MagnumGL.cpp DebugMessage-usage

    @code{.shell-session} @@ -463,7 +463,7 @@ performance effects. @see @ref DebugGroup @requires_gles Debug output is not available in WebGL. */ -class MAGNUM_EXPORT DebugMessage { +class MAGNUM_GL_EXPORT DebugMessage { friend Implementation::DebugState; public: @@ -582,24 +582,24 @@ class MAGNUM_EXPORT DebugMessage { private: static void insertInternal(Source source, Type type, UnsignedInt id, DebugOutput::Severity severity, Containers::ArrayView string); - static MAGNUM_LOCAL void insertImplementationNoOp(Source, Type, UnsignedInt, DebugOutput::Severity, Containers::ArrayView); + static MAGNUM_GL_LOCAL void insertImplementationNoOp(Source, Type, UnsignedInt, DebugOutput::Severity, Containers::ArrayView); #ifndef MAGNUM_TARGET_GLES2 - static MAGNUM_LOCAL void insertImplementationKhrDesktopES32(Source source, Type type, UnsignedInt id, DebugOutput::Severity severity, Containers::ArrayView string); + static MAGNUM_GL_LOCAL void insertImplementationKhrDesktopES32(Source source, Type type, UnsignedInt id, DebugOutput::Severity severity, Containers::ArrayView string); #endif #ifdef MAGNUM_TARGET_GLES - static MAGNUM_LOCAL void insertImplementationKhrES(Source source, Type type, UnsignedInt id, DebugOutput::Severity severity, Containers::ArrayView string); + static MAGNUM_GL_LOCAL void insertImplementationKhrES(Source source, Type type, UnsignedInt id, DebugOutput::Severity severity, Containers::ArrayView string); #endif - static MAGNUM_LOCAL void insertImplementationExt(Source, Type, UnsignedInt, DebugOutput::Severity, Containers::ArrayView string); + static MAGNUM_GL_LOCAL void insertImplementationExt(Source, Type, UnsignedInt, DebugOutput::Severity, Containers::ArrayView string); #ifndef MAGNUM_TARGET_GLES - static MAGNUM_LOCAL void insertImplementationGremedy(Source, Type, UnsignedInt, DebugOutput::Severity, Containers::ArrayView string); + static MAGNUM_GL_LOCAL void insertImplementationGremedy(Source, Type, UnsignedInt, DebugOutput::Severity, Containers::ArrayView string); #endif }; /** @debugoperatorclassenum{Magnum::DebugMessage,Magnum::DebugMessage::Source} */ -MAGNUM_EXPORT Debug& operator<<(Debug& debug, DebugMessage::Source value); +MAGNUM_GL_EXPORT Debug& operator<<(Debug& debug, DebugMessage::Source value); /** @debugoperatorclassenum{Magnum::DebugMessage,Magnum::DebugMessage::Type} */ -MAGNUM_EXPORT Debug& operator<<(Debug& debug, DebugMessage::Type value); +MAGNUM_GL_EXPORT Debug& operator<<(Debug& debug, DebugMessage::Type value); /** @brief Debug group @@ -614,12 +614,12 @@ See @ref DebugOutput for introduction. Easiest way is to push debug group by creating instance and pop it automatically at the end of scope: -@snippet Magnum.cpp DebugGroup-usage1 +@snippet MagnumGL.cpp DebugGroup-usage1 If, for some reason, you need to pop in different scope, you can call @ref push() and @ref pop() manually: -@snippet Magnum.cpp DebugGroup-usage2 +@snippet MagnumGL.cpp DebugGroup-usage2 If OpenGL 4.3 / OpenGL ES 3.2 is supported or @extension{KHR,debug} desktop or ES extension (covered also by @extension{ANDROID,extension_pack_es31a}) is @@ -665,7 +665,7 @@ performance effects. @see @ref DebugMessage @requires_gles Debug output is not available in WebGL. */ -class MAGNUM_EXPORT DebugGroup { +class MAGNUM_GL_EXPORT DebugGroup { friend Implementation::DebugState; public: @@ -781,29 +781,29 @@ class MAGNUM_EXPORT DebugGroup { private: void pushInternal(Source source, UnsignedInt id, Containers::ArrayView message); - static MAGNUM_LOCAL void pushImplementationNoOp(Source source, UnsignedInt id, Containers::ArrayView message); + static MAGNUM_GL_LOCAL void pushImplementationNoOp(Source source, UnsignedInt id, Containers::ArrayView message); #ifndef MAGNUM_TARGET_GLES2 - static MAGNUM_LOCAL void pushImplementationKhrDesktopES32(Source source, UnsignedInt id, Containers::ArrayView message); + static MAGNUM_GL_LOCAL void pushImplementationKhrDesktopES32(Source source, UnsignedInt id, Containers::ArrayView message); #endif #ifdef MAGNUM_TARGET_GLES - static MAGNUM_LOCAL void pushImplementationKhrES(Source source, UnsignedInt id, Containers::ArrayView message); + static MAGNUM_GL_LOCAL void pushImplementationKhrES(Source source, UnsignedInt id, Containers::ArrayView message); #endif - static MAGNUM_LOCAL void pushImplementationExt(Source source, UnsignedInt id, Containers::ArrayView message); + static MAGNUM_GL_LOCAL void pushImplementationExt(Source source, UnsignedInt id, Containers::ArrayView message); - static MAGNUM_LOCAL void popImplementationNoOp(); + static MAGNUM_GL_LOCAL void popImplementationNoOp(); #ifndef MAGNUM_TARGET_GLES2 - static MAGNUM_LOCAL void popImplementationKhrDesktopES32(); + static MAGNUM_GL_LOCAL void popImplementationKhrDesktopES32(); #endif #ifdef MAGNUM_TARGET_GLES - static MAGNUM_LOCAL void popImplementationKhrES(); + static MAGNUM_GL_LOCAL void popImplementationKhrES(); #endif - static MAGNUM_LOCAL void popImplementationExt(); + static MAGNUM_GL_LOCAL void popImplementationExt(); bool _active; }; /** @debugoperatorclassenum{Magnum::DebugGroup,Magnum::DebugGroup::Source} */ -MAGNUM_EXPORT Debug& operator<<(Debug& debug, DebugGroup::Source value); +MAGNUM_GL_EXPORT Debug& operator<<(Debug& debug, DebugGroup::Source value); } #else diff --git a/src/Magnum/DefaultFramebuffer.cpp b/src/Magnum/GL/DefaultFramebuffer.cpp similarity index 97% rename from src/Magnum/DefaultFramebuffer.cpp rename to src/Magnum/GL/DefaultFramebuffer.cpp index f7e1cb4d3..6763b9acd 100644 --- a/src/Magnum/DefaultFramebuffer.cpp +++ b/src/Magnum/GL/DefaultFramebuffer.cpp @@ -27,10 +27,10 @@ #include -#include "Magnum/Context.h" -#include "Magnum/Extensions.h" -#include "Magnum/Implementation/State.h" -#include "Magnum/Implementation/FramebufferState.h" +#include "Magnum/GL/Context.h" +#include "Magnum/GL/Extensions.h" +#include "Magnum/GL/Implementation/State.h" +#include "Magnum/GL/Implementation/FramebufferState.h" #ifndef MAGNUM_TARGET_GLES2 #include "Magnum/Math/Color.h" #endif diff --git a/src/Magnum/DefaultFramebuffer.h b/src/Magnum/GL/DefaultFramebuffer.h similarity index 96% rename from src/Magnum/DefaultFramebuffer.h rename to src/Magnum/GL/DefaultFramebuffer.h index 6c28f237d..c57cff2b7 100644 --- a/src/Magnum/DefaultFramebuffer.h +++ b/src/Magnum/GL/DefaultFramebuffer.h @@ -1,5 +1,5 @@ -#ifndef Magnum_DefaultFramebuffer_h -#define Magnum_DefaultFramebuffer_h +#ifndef Magnum_GL_DefaultFramebuffer_h +#define Magnum_GL_DefaultFramebuffer_h /* This file is part of Magnum. @@ -29,7 +29,7 @@ * @brief Class @ref Magnum::DefaultFramebuffer */ -#include "Magnum/AbstractFramebuffer.h" +#include "Magnum/GL/AbstractFramebuffer.h" namespace Magnum { @@ -49,7 +49,7 @@ classes, pass the new size in your @ref Platform::Sdl2Application::viewportEvent() "viewportEvent()" implementation, for example: -@snippet Magnum-framebuffer.cpp DefaultFramebuffer-usage-viewport +@snippet MagnumGL-framebuffer.cpp DefaultFramebuffer-usage-viewport Next thing you probably want is to clear all used buffers before performing any drawing. Again, in case you're using one of the @@ -57,7 +57,7 @@ any drawing. Again, in case you're using one of the @ref Platform::Sdl2Application::drawEvent() "drawEvent()" implementation, for example: -@snippet Magnum-framebuffer.cpp DefaultFramebuffer-usage-clear +@snippet MagnumGL-framebuffer.cpp DefaultFramebuffer-usage-clear See documentation of particular functions and @ref Framebuffer documentation for more involved usage, usage of non-default or multiple framebuffers. @@ -72,7 +72,7 @@ If either @extension{ARB,direct_state_access} (part of OpenGL 4.5) or use DSA to avoid unnecessary calls to @fn_gl{BindFramebuffer}. See their respective documentation for more information. */ -class MAGNUM_EXPORT DefaultFramebuffer: public AbstractFramebuffer { +class MAGNUM_GL_EXPORT DefaultFramebuffer: public AbstractFramebuffer { friend Context; public: @@ -306,7 +306,7 @@ class MAGNUM_EXPORT DefaultFramebuffer: public AbstractFramebuffer { }; #endif - explicit MAGNUM_LOCAL DefaultFramebuffer(); + explicit MAGNUM_GL_LOCAL DefaultFramebuffer(); /** @brief Copying is not allowed */ DefaultFramebuffer(const DefaultFramebuffer&) = delete; @@ -371,7 +371,7 @@ class MAGNUM_EXPORT DefaultFramebuffer: public AbstractFramebuffer { * can achieve the same by passing @ref DrawAttachment::None as * attachment. Example usage: * - * @snippet Magnum.cpp DefaultFramebuffer-usage-map + * @snippet MagnumGL.cpp DefaultFramebuffer-usage-map * * If neither @extension{ARB,direct_state_access} (part of OpenGL 4.5) * nor @extension{EXT,direct_state_access} desktop extension is @@ -500,14 +500,14 @@ class MAGNUM_EXPORT DefaultFramebuffer: public AbstractFramebuffer { #endif private: - static void MAGNUM_LOCAL initializeContextBasedFunctionality(Context& context); + static void MAGNUM_GL_LOCAL initializeContextBasedFunctionality(Context& context); }; /** @brief Default framebuffer instance */ -extern DefaultFramebuffer MAGNUM_EXPORT defaultFramebuffer; +extern DefaultFramebuffer MAGNUM_GL_EXPORT defaultFramebuffer; /** @debugoperatorclassenum{Magnum::DefaultFramebuffer,Magnum::DefaultFramebuffer::Status} */ -MAGNUM_EXPORT Debug& operator<<(Debug& debug, DefaultFramebuffer::Status value); +MAGNUM_GL_EXPORT Debug& operator<<(Debug& debug, DefaultFramebuffer::Status value); } diff --git a/src/Magnum/Extensions.h b/src/Magnum/GL/Extensions.h similarity index 98% rename from src/Magnum/Extensions.h rename to src/Magnum/GL/Extensions.h index be040a870..fa320f14d 100644 --- a/src/Magnum/Extensions.h +++ b/src/Magnum/GL/Extensions.h @@ -1,5 +1,5 @@ -#ifndef Magnum_Extensions_h -#define Magnum_Extensions_h +#ifndef Magnum_GL_Extensions_h +#define Magnum_GL_Extensions_h /* This file is part of Magnum. @@ -29,7 +29,7 @@ * @brief Namespace @ref Magnum::Extensions */ -#include "Magnum/Version.h" +#include "Magnum/GL/Version.h" namespace Magnum { @@ -60,17 +60,18 @@ but these structs are better suited for compile-time decisions rather than @ref Extension instances. See @ref Context::isExtensionSupported() for example usage. -This library is built by default. To use this library with CMake, you need to -find the `Magnum` package and link to the `Magnum::Magnum` target: +This library is built if `WITH_GL` is enabled when building Magnum. To use this +library with CMake, you need to request the `GL` component of the `Magnum` +package and link to the `Magnum::GL` target: @code{.cmake} -find_package(Magnum REQUIRED) +find_package(Magnum REQUIRED GL) # ... -target_link_libraries(your-app Magnum::Magnum) +target_link_libraries(your-app Magnum::GL) @endcode -See @ref building and @ref cmake for more information. +See @ref building, @ref cmake and @ref opengl for more information. @see @ref MAGNUM_ASSERT_EXTENSION_SUPPORTED() */ namespace Extensions { diff --git a/src/Magnum/Framebuffer.cpp b/src/Magnum/GL/Framebuffer.cpp similarity index 97% rename from src/Magnum/Framebuffer.cpp rename to src/Magnum/GL/Framebuffer.cpp index 99cd4917b..8491b6783 100644 --- a/src/Magnum/Framebuffer.cpp +++ b/src/Magnum/GL/Framebuffer.cpp @@ -27,36 +27,34 @@ #include -#include "Magnum/Context.h" -#include "Magnum/CubeMapTexture.h" -#include "Magnum/DefaultFramebuffer.h" -#include "Magnum/Extensions.h" #include "Magnum/Image.h" -#include "Magnum/Renderbuffer.h" -#include "Magnum/Texture.h" +#include "Magnum/GL/Context.h" +#include "Magnum/GL/CubeMapTexture.h" +#include "Magnum/GL/DefaultFramebuffer.h" +#include "Magnum/GL/Extensions.h" +#include "Magnum/GL/Renderbuffer.h" +#include "Magnum/GL/Texture.h" #ifndef MAGNUM_TARGET_GLES2 -#include "Magnum/Math/Color.h" -#endif - -#ifndef MAGNUM_TARGET_GLES2 -#include "Magnum/BufferImage.h" +#include "Magnum/GL/BufferImage.h" #ifndef MAGNUM_TARGET_WEBGL -#include "Magnum/MultisampleTexture.h" +#include "Magnum/GL/MultisampleTexture.h" #endif -#include "Magnum/TextureArray.h" +#include "Magnum/GL/TextureArray.h" #endif #if !defined(MAGNUM_TARGET_GLES2) && !defined(MAGNUM_TARGET_WEBGL) -#include "Magnum/CubeMapTextureArray.h" +#include "Magnum/GL/CubeMapTextureArray.h" #endif #ifndef MAGNUM_TARGET_GLES -#include "Magnum/RectangleTexture.h" +#include "Magnum/GL/RectangleTexture.h" #endif - #ifndef MAGNUM_TARGET_WEBGL -#include "Implementation/DebugState.h" +#include "Magnum/GL/Implementation/DebugState.h" +#endif +#include "Magnum/GL/Implementation/State.h" +#include "Magnum/GL/Implementation/FramebufferState.h" +#ifndef MAGNUM_TARGET_GLES2 +#include "Magnum/Math/Color.h" #endif -#include "Implementation/State.h" -#include "Implementation/FramebufferState.h" namespace Magnum { diff --git a/src/Magnum/Framebuffer.h b/src/Magnum/GL/Framebuffer.h similarity index 94% rename from src/Magnum/Framebuffer.h rename to src/Magnum/GL/Framebuffer.h index 24188186b..f0a491aab 100644 --- a/src/Magnum/Framebuffer.h +++ b/src/Magnum/GL/Framebuffer.h @@ -1,5 +1,5 @@ -#ifndef Magnum_Framebuffer_h -#define Magnum_Framebuffer_h +#ifndef Magnum_GL_Framebuffer_h +#define Magnum_GL_Framebuffer_h /* This file is part of Magnum. @@ -31,8 +31,8 @@ #include -#include "Magnum/AbstractFramebuffer.h" #include "Magnum/Tags.h" +#include "Magnum/GL/AbstractFramebuffer.h" #ifdef _X11_XLIB_H_ /* Xlib.h, I hate you sincerely */ #undef Status @@ -56,18 +56,18 @@ textures for actual on-screen rendering. First you need to create the framebuffer with the same viewport as default framebuffer and attach textures and renderbuffers to desired outputs: -@snippet Magnum.cpp Framebuffer-usage-attach +@snippet MagnumGL.cpp Framebuffer-usage-attach Then you need to map outputs of your shader to color attachments in the framebuffer: -@snippet Magnum.cpp Framebuffer-usage-map +@snippet MagnumGL.cpp Framebuffer-usage-map The actual @ref Platform::Sdl2Application::drawEvent() "drawEvent()" might look like this. First you clear all buffers you need, perform drawing to off-screen framebuffer, then bind the default and render the textures on screen: -@snippet Magnum-framebuffer.cpp Framebuffer-usage-draw +@snippet MagnumGL-framebuffer.cpp Framebuffer-usage-draw @section Framebuffer-performance-optimizations Performance optimizations @@ -83,7 +83,7 @@ information. @requires_gl30 Extension @extension{ARB,framebuffer_object} */ -class MAGNUM_EXPORT Framebuffer: public AbstractFramebuffer, public AbstractObject { +class MAGNUM_GL_EXPORT Framebuffer: public AbstractFramebuffer, public AbstractObject { friend Implementation::FramebufferState; public: @@ -128,7 +128,7 @@ class MAGNUM_EXPORT Framebuffer: public AbstractFramebuffer, public AbstractObje * @requires_webgl20 Extension @webgl_extension{WEBGL,draw_buffers} in * WebGL 1.0. */ - class MAGNUM_EXPORT DrawAttachment { + class MAGNUM_GL_EXPORT DrawAttachment { public: /** * @brief No attachment @@ -160,7 +160,7 @@ class MAGNUM_EXPORT Framebuffer: public AbstractFramebuffer, public AbstractObje * @requires_webgl20 Extension @webgl_extension{WEBGL,draw_buffers} in * WebGL 1.0. */ - class MAGNUM_EXPORT BufferAttachment { + class MAGNUM_GL_EXPORT BufferAttachment { public: /** * @brief Depth buffer @@ -214,7 +214,7 @@ class MAGNUM_EXPORT Framebuffer: public AbstractFramebuffer, public AbstractObje * @requires_webgl20 Framebuffer invalidation is not available in WebGL * 1.0. */ - class MAGNUM_EXPORT InvalidationAttachment { + class MAGNUM_GL_EXPORT InvalidationAttachment { public: /** * @brief Invalidate depth buffer @@ -892,55 +892,55 @@ class MAGNUM_EXPORT Framebuffer: public AbstractFramebuffer, public AbstractObje private: explicit Framebuffer(GLuint id, const Range2Di& viewport, ObjectFlags flags) noexcept: AbstractFramebuffer{id, viewport, flags} {} - void MAGNUM_LOCAL createImplementationDefault(); + void MAGNUM_GL_LOCAL createImplementationDefault(); #ifndef MAGNUM_TARGET_GLES - void MAGNUM_LOCAL createImplementationDSA(); + void MAGNUM_GL_LOCAL createImplementationDSA(); #endif #ifndef MAGNUM_TARGET_WEBGL Framebuffer& setLabelInternal(Containers::ArrayView label); #endif - void MAGNUM_LOCAL renderbufferImplementationDefault(BufferAttachment attachment, GLuint renderbufferId); + void MAGNUM_GL_LOCAL renderbufferImplementationDefault(BufferAttachment attachment, GLuint renderbufferId); #ifndef MAGNUM_TARGET_GLES - void MAGNUM_LOCAL renderbufferImplementationDSA(BufferAttachment attachment, GLuint renderbufferId); - void MAGNUM_LOCAL renderbufferImplementationDSAEXT(BufferAttachment attachment, GLuint renderbufferId); + void MAGNUM_GL_LOCAL renderbufferImplementationDSA(BufferAttachment attachment, GLuint renderbufferId); + void MAGNUM_GL_LOCAL renderbufferImplementationDSAEXT(BufferAttachment attachment, GLuint renderbufferId); #endif #ifndef MAGNUM_TARGET_GLES - void MAGNUM_LOCAL texture1DImplementationDefault(BufferAttachment attachment, GLuint textureId, GLint level); - void MAGNUM_LOCAL texture1DImplementationDSAEXT(BufferAttachment attachment, GLuint textureId, GLint level); + void MAGNUM_GL_LOCAL texture1DImplementationDefault(BufferAttachment attachment, GLuint textureId, GLint level); + void MAGNUM_GL_LOCAL texture1DImplementationDSAEXT(BufferAttachment attachment, GLuint textureId, GLint level); #endif - void MAGNUM_LOCAL texture2DImplementationDefault(BufferAttachment attachment, GLenum textureTarget, GLuint textureId, GLint level); + void MAGNUM_GL_LOCAL texture2DImplementationDefault(BufferAttachment attachment, GLenum textureTarget, GLuint textureId, GLint level); #ifndef MAGNUM_TARGET_GLES - void MAGNUM_LOCAL texture2DImplementationDSA(BufferAttachment attachment, GLenum textureTarget, GLuint textureId, GLint level); - void MAGNUM_LOCAL texture2DImplementationDSAEXT(BufferAttachment attachment, GLenum textureTarget, GLuint textureId, GLint level); - void MAGNUM_LOCAL textureCubeMapImplementationDSA(BufferAttachment attachment, GLenum textureTarget, GLuint textureId, GLint level); + void MAGNUM_GL_LOCAL texture2DImplementationDSA(BufferAttachment attachment, GLenum textureTarget, GLuint textureId, GLint level); + void MAGNUM_GL_LOCAL texture2DImplementationDSAEXT(BufferAttachment attachment, GLenum textureTarget, GLuint textureId, GLint level); + void MAGNUM_GL_LOCAL textureCubeMapImplementationDSA(BufferAttachment attachment, GLenum textureTarget, GLuint textureId, GLint level); #endif #if !defined(MAGNUM_TARGET_WEBGL) && !defined(MAGNUM_TARGET_GLES2) - void MAGNUM_LOCAL textureImplementationDefault(BufferAttachment attachment, GLuint textureId, GLint level); + void MAGNUM_GL_LOCAL textureImplementationDefault(BufferAttachment attachment, GLuint textureId, GLint level); #ifdef MAGNUM_TARGET_GLES - void MAGNUM_LOCAL textureImplementationEXT(BufferAttachment attachment, GLuint textureId, GLint level); + void MAGNUM_GL_LOCAL textureImplementationEXT(BufferAttachment attachment, GLuint textureId, GLint level); #endif #endif #ifndef MAGNUM_TARGET_GLES - void MAGNUM_LOCAL textureImplementationDSA(BufferAttachment attachment, GLuint textureId, GLint level); - void MAGNUM_LOCAL textureImplementationDSAEXT(BufferAttachment attachment, GLuint textureId, GLint level); + void MAGNUM_GL_LOCAL textureImplementationDSA(BufferAttachment attachment, GLuint textureId, GLint level); + void MAGNUM_GL_LOCAL textureImplementationDSAEXT(BufferAttachment attachment, GLuint textureId, GLint level); #endif #if !(defined(MAGNUM_TARGET_WEBGL) && defined(MAGNUM_TARGET_GLES2)) - void MAGNUM_LOCAL textureLayerImplementationDefault(BufferAttachment attachment, GLuint textureId, GLint level, GLint layer); + void MAGNUM_GL_LOCAL textureLayerImplementationDefault(BufferAttachment attachment, GLuint textureId, GLint level, GLint layer); #endif #ifndef MAGNUM_TARGET_GLES - void MAGNUM_LOCAL textureLayerImplementationDSA(BufferAttachment attachment, GLuint textureId, GLint level, GLint layer); - void MAGNUM_LOCAL textureLayerImplementationDSAEXT(BufferAttachment attachment, GLuint textureId, GLint level, GLint layer); + void MAGNUM_GL_LOCAL textureLayerImplementationDSA(BufferAttachment attachment, GLuint textureId, GLint level, GLint layer); + void MAGNUM_GL_LOCAL textureLayerImplementationDSAEXT(BufferAttachment attachment, GLuint textureId, GLint level, GLint layer); #endif }; /** @debugoperatorclassenum{Magnum::Framebuffer,Magnum::Framebuffer::Status} */ -MAGNUM_EXPORT Debug& operator<<(Debug& debug, Framebuffer::Status value); +MAGNUM_GL_EXPORT Debug& operator<<(Debug& debug, Framebuffer::Status value); inline Framebuffer::Framebuffer(Framebuffer&& other) noexcept { _id = other._id; diff --git a/src/Magnum/GL/GL.h b/src/Magnum/GL/GL.h new file mode 100644 index 000000000..5d9aea44c --- /dev/null +++ b/src/Magnum/GL/GL.h @@ -0,0 +1,179 @@ +#ifndef Magnum_GL_h +#define Magnum_GL_h +/* + This file is part of Magnum. + + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018 + Vladimír Vondruš + + Permission is hereby granted, free of charge, to any person obtaining a + copy of this software and associated documentation files (the "Software"), + to deal in the Software without restriction, including without limitation + the rights to use, copy, modify, merge, publish, distribute, sublicense, + and/or sell copies of the Software, and to permit persons to whom the + Software is furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included + in all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + DEALINGS IN THE SOFTWARE. +*/ + +/** @file + * @brief Forward declarations for the @ref Magnum::GL namespace + */ + +#include "Magnum/Types.h" + +#ifndef DOXYGEN_GENERATING_OUTPUT +typedef unsigned int GLenum; /* Needed for *Format and *Type enums */ +#endif + +namespace Magnum { + +#ifndef DOXYGEN_GENERATING_OUTPUT +/* FramebufferClear[Mask], FramebufferBlit[Mask], FramebufferBlitFilter, + FramebufferTarget enums used only directly with framebuffer instance */ +class AbstractFramebuffer; + +#if !(defined(MAGNUM_TARGET_WEBGL) && defined(MAGNUM_TARGET_GLES2)) +class AbstractQuery; +#endif +class AbstractShaderProgram; +class AbstractTexture; + +template class Attribute; + +enum class BufferUsage: GLenum; +class Buffer; + +#ifndef MAGNUM_TARGET_GLES2 +template class BufferImage; +typedef BufferImage<1> BufferImage1D; +typedef BufferImage<2> BufferImage2D; +typedef BufferImage<3> BufferImage3D; + +template class CompressedBufferImage; +typedef CompressedBufferImage<1> CompressedBufferImage1D; +typedef CompressedBufferImage<2> CompressedBufferImage2D; +typedef CompressedBufferImage<3> CompressedBufferImage3D; +#endif + +#if !defined(MAGNUM_TARGET_GLES2) && !defined(MAGNUM_TARGET_WEBGL) +class BufferTexture; +enum class BufferTextureFormat: GLenum; +#endif + +class Context; + +class CubeMapTexture; +enum class CubeMapCoordinate: GLenum; +#if !defined(MAGNUM_TARGET_GLES2) && !defined(MAGNUM_TARGET_WEBGL) +class CubeMapTextureArray; +#endif + +/* DebugOutput, DebugMessage, DebugGroup used only statically */ +/* DefaultFramebuffer is available only through global instance */ +/* DimensionTraits forward declaration is not needed */ + +class Extension; +class Framebuffer; + +#if !defined(MAGNUM_TARGET_GLES2) && !defined(MAGNUM_TARGET_WEBGL) +enum class ImageFormat: GLenum; +enum class ImageAccess: GLenum; +#endif + +template class Image; +typedef Image<1> Image1D; +typedef Image<2> Image2D; +typedef Image<3> Image3D; + +template class CompressedImage; +typedef CompressedImage<1> CompressedImage1D; +typedef CompressedImage<2> CompressedImage2D; +typedef CompressedImage<3> CompressedImage3D; + +template class ImageView; +typedef ImageView<1> ImageView1D; +typedef ImageView<2> ImageView2D; +typedef ImageView<3> ImageView3D; + +template class CompressedImageView; +typedef CompressedImageView<1> CompressedImageView1D; +typedef CompressedImageView<2> CompressedImageView2D; +typedef CompressedImageView<3> CompressedImageView3D; + +enum class MeshPrimitive: GLenum; + +class Mesh; +class MeshView; + +#if !defined(MAGNUM_TARGET_GLES2) && !defined(MAGNUM_TARGET_WEBGL) +/* MultisampleTextureSampleLocations enum used only in the function */ +template class MultisampleTexture; +typedef MultisampleTexture<2> MultisampleTexture2D; +typedef MultisampleTexture<3> MultisampleTexture2DArray; +#endif + +enum class PixelFormat: GLenum; +enum class PixelType: GLenum; +enum class CompressedPixelFormat: GLenum; + +class PixelStorage; +#ifndef MAGNUM_TARGET_GLES +class CompressedPixelStorage; +#endif + +/* ObjectFlag, ObjectFlags are used only in conjunction with *::wrap() function */ + +class PrimitiveQuery; +class SampleQuery; +class TimeQuery; + +#ifndef MAGNUM_TARGET_GLES +class RectangleTexture; +#endif + +class Renderbuffer; +enum class RenderbufferFormat: GLenum; + +class Sampler; +class Shader; + +template class Texture; +#ifndef MAGNUM_TARGET_GLES +typedef Texture<1> Texture1D; +#endif +typedef Texture<2> Texture2D; +#if !(defined(MAGNUM_TARGET_WEBGL) && defined(MAGNUM_TARGET_GLES2)) +typedef Texture<3> Texture3D; +#endif + +#ifndef MAGNUM_TARGET_GLES2 +template class TextureArray; +#ifndef MAGNUM_TARGET_GLES +typedef TextureArray<1> Texture1DArray; +#endif +typedef TextureArray<2> Texture2DArray; +#endif + +enum class TextureFormat: GLenum; + +#ifndef MAGNUM_TARGET_GLES2 +class TransformFeedback; +#endif + +enum class Version: Int; +#endif + +} + +#endif + diff --git a/src/Magnum/ImageFormat.h b/src/Magnum/GL/ImageFormat.h similarity index 98% rename from src/Magnum/ImageFormat.h rename to src/Magnum/GL/ImageFormat.h index 46b98c837..e4ac1fa1f 100644 --- a/src/Magnum/ImageFormat.h +++ b/src/Magnum/GL/ImageFormat.h @@ -1,5 +1,5 @@ -#ifndef Magnum_ImageFormat_h -#define Magnum_ImageFormat_h +#ifndef Magnum_GL_ImageFormat_h +#define Magnum_GL_ImageFormat_h /* This file is part of Magnum. @@ -31,7 +31,7 @@ */ #endif -#include "Magnum/OpenGL.h" +#include "Magnum/GL/OpenGL.h" #if !defined(MAGNUM_TARGET_GLES2) && !defined(MAGNUM_TARGET_WEBGL) namespace Magnum { diff --git a/src/Magnum/Implementation/BufferState.cpp b/src/Magnum/GL/Implementation/BufferState.cpp similarity index 98% rename from src/Magnum/Implementation/BufferState.cpp rename to src/Magnum/GL/Implementation/BufferState.cpp index 59d6a0834..d9d047796 100644 --- a/src/Magnum/Implementation/BufferState.cpp +++ b/src/Magnum/GL/Implementation/BufferState.cpp @@ -27,10 +27,9 @@ #include -#include "Magnum/Context.h" -#include "Magnum/Extensions.h" - -#include "State.h" +#include "Magnum/GL/Context.h" +#include "Magnum/GL/Extensions.h" +#include "Magnum/GL/Implementation/State.h" namespace Magnum { namespace Implementation { diff --git a/src/Magnum/Implementation/BufferState.h b/src/Magnum/GL/Implementation/BufferState.h similarity index 96% rename from src/Magnum/Implementation/BufferState.h rename to src/Magnum/GL/Implementation/BufferState.h index 784bf07d6..a606c5214 100644 --- a/src/Magnum/Implementation/BufferState.h +++ b/src/Magnum/GL/Implementation/BufferState.h @@ -1,5 +1,5 @@ -#ifndef Magnum_Implementation_BufferState_h -#define Magnum_Implementation_BufferState_h +#ifndef Magnum_GL_Implementation_BufferState_h +#define Magnum_GL_Implementation_BufferState_h /* This file is part of Magnum. @@ -25,7 +25,7 @@ DEALINGS IN THE SOFTWARE. */ -#include "Magnum/Buffer.h" +#include "Magnum/GL/Buffer.h" namespace Magnum { namespace Implementation { diff --git a/src/Magnum/Implementation/ContextState.cpp b/src/Magnum/GL/Implementation/ContextState.cpp similarity index 98% rename from src/Magnum/Implementation/ContextState.cpp rename to src/Magnum/GL/Implementation/ContextState.cpp index 254a2eb6d..f65121077 100644 --- a/src/Magnum/Implementation/ContextState.cpp +++ b/src/Magnum/GL/Implementation/ContextState.cpp @@ -25,7 +25,7 @@ #include "ContextState.h" -#include "Magnum/Context.h" +#include "Magnum/GL/Context.h" namespace Magnum { namespace Implementation { diff --git a/src/Magnum/Implementation/ContextState.h b/src/Magnum/GL/Implementation/ContextState.h similarity index 92% rename from src/Magnum/Implementation/ContextState.h rename to src/Magnum/GL/Implementation/ContextState.h index 10de3d0de..15ab9bfe0 100644 --- a/src/Magnum/Implementation/ContextState.h +++ b/src/Magnum/GL/Implementation/ContextState.h @@ -1,5 +1,5 @@ -#ifndef Magnum_Implementation_ContextState_h -#define Magnum_Implementation_ContextState_h +#ifndef Magnum_GL_Implementation_ContextState_h +#define Magnum_GL_Implementation_ContextState_h /* This file is part of Magnum. @@ -28,13 +28,13 @@ #include #include -#include "Magnum/Magnum.h" +#include "Magnum/GL/GL.h" #ifdef _MSC_VER /* Otherwise the member function pointers will have different size based on whether the header was included or not. CAUSES SERIOUS MEMORY CORRUPTION AND IS NOT CAUGHT BY ANY WARNING WHATSOEVER! AARGH! */ -#include "Magnum/Context.h" +#include "Magnum/GL/Context.h" #endif namespace Magnum { namespace Implementation { diff --git a/src/Magnum/Implementation/DebugState.cpp b/src/Magnum/GL/Implementation/DebugState.cpp similarity index 97% rename from src/Magnum/Implementation/DebugState.cpp rename to src/Magnum/GL/Implementation/DebugState.cpp index d8721b29c..1cffc34b9 100644 --- a/src/Magnum/Implementation/DebugState.cpp +++ b/src/Magnum/GL/Implementation/DebugState.cpp @@ -25,9 +25,9 @@ #include "DebugState.h" -#include "Magnum/AbstractObject.h" -#include "Magnum/Context.h" -#include "Magnum/Extensions.h" +#include "Magnum/GL/AbstractObject.h" +#include "Magnum/GL/Context.h" +#include "Magnum/GL/Extensions.h" namespace Magnum { namespace Implementation { diff --git a/src/Magnum/Implementation/DebugState.h b/src/Magnum/GL/Implementation/DebugState.h similarity index 93% rename from src/Magnum/Implementation/DebugState.h rename to src/Magnum/GL/Implementation/DebugState.h index 420517aed..13480b620 100644 --- a/src/Magnum/Implementation/DebugState.h +++ b/src/Magnum/GL/Implementation/DebugState.h @@ -1,5 +1,5 @@ -#ifndef Magnum_Implementation_DebugState_h -#define Magnum_Implementation_DebugState_h +#ifndef Magnum_GL_Implementation_DebugState_h +#define Magnum_GL_Implementation_DebugState_h /* This file is part of Magnum. @@ -28,7 +28,8 @@ #include #include -#include "Magnum/DebugOutput.h" +#include "Magnum/GL/DebugOutput.h" +#include "Magnum/GL/GL.h" #ifdef MAGNUM_TARGET_WEBGL #error this header is not available in WebGL build diff --git a/src/Magnum/Implementation/FramebufferState.cpp b/src/Magnum/GL/Implementation/FramebufferState.cpp similarity index 99% rename from src/Magnum/Implementation/FramebufferState.cpp rename to src/Magnum/GL/Implementation/FramebufferState.cpp index c40ec8849..285233a00 100644 --- a/src/Magnum/Implementation/FramebufferState.cpp +++ b/src/Magnum/GL/Implementation/FramebufferState.cpp @@ -25,9 +25,9 @@ #include "FramebufferState.h" -#include "Magnum/Context.h" -#include "Magnum/Extensions.h" -#include "Magnum/Renderbuffer.h" +#include "Magnum/GL/Context.h" +#include "Magnum/GL/Extensions.h" +#include "Magnum/GL/Renderbuffer.h" #include "State.h" diff --git a/src/Magnum/Implementation/FramebufferState.h b/src/Magnum/GL/Implementation/FramebufferState.h similarity index 96% rename from src/Magnum/Implementation/FramebufferState.h rename to src/Magnum/GL/Implementation/FramebufferState.h index f1a9c3a49..1bd6d4c51 100644 --- a/src/Magnum/Implementation/FramebufferState.h +++ b/src/Magnum/GL/Implementation/FramebufferState.h @@ -1,5 +1,5 @@ -#ifndef Magnum_Implementation_FramebufferState_h -#define Magnum_Implementation_FramebufferState_h +#ifndef Magnum_GL_Implementation_FramebufferState_h +#define Magnum_GL_Implementation_FramebufferState_h /* This file is part of Magnum. @@ -28,13 +28,13 @@ #include #include -#include "Magnum/Framebuffer.h" +#include "Magnum/GL/Framebuffer.h" #ifdef _MSC_VER /* Otherwise the member function pointers will have different size based on whether the header was included or not. CAUSES SERIOUS MEMORY CORRUPTION AND IS NOT CAUGHT BY ANY WARNING WHATSOEVER! AARGH! */ -#include "Magnum/Renderbuffer.h" +#include "Magnum/GL/Renderbuffer.h" #endif namespace Magnum { namespace Implementation { diff --git a/src/Magnum/Implementation/MeshState.cpp b/src/Magnum/GL/Implementation/MeshState.cpp similarity index 98% rename from src/Magnum/Implementation/MeshState.cpp rename to src/Magnum/GL/Implementation/MeshState.cpp index 4b77c241c..1c98d1f15 100644 --- a/src/Magnum/Implementation/MeshState.cpp +++ b/src/Magnum/GL/Implementation/MeshState.cpp @@ -25,9 +25,9 @@ #include "MeshState.h" -#include "Magnum/Context.h" -#include "Magnum/Extensions.h" -#include "Magnum/MeshView.h" +#include "Magnum/GL/Context.h" +#include "Magnum/GL/Extensions.h" +#include "Magnum/GL/MeshView.h" #include "State.h" diff --git a/src/Magnum/Implementation/MeshState.h b/src/Magnum/GL/Implementation/MeshState.h similarity index 95% rename from src/Magnum/Implementation/MeshState.h rename to src/Magnum/GL/Implementation/MeshState.h index 7d9ff12fc..c01f56153 100644 --- a/src/Magnum/Implementation/MeshState.h +++ b/src/Magnum/GL/Implementation/MeshState.h @@ -1,5 +1,5 @@ -#ifndef Magnum_Implementation_MeshState_h -#define Magnum_Implementation_MeshState_h +#ifndef Magnum_GL_Implementation_MeshState_h +#define Magnum_GL_Implementation_MeshState_h /* This file is part of Magnum. @@ -28,7 +28,7 @@ #include #include -#include "Magnum/Mesh.h" +#include "Magnum/GL/Mesh.h" namespace Magnum { namespace Implementation { diff --git a/src/Magnum/Implementation/QueryState.cpp b/src/Magnum/GL/Implementation/QueryState.cpp similarity index 94% rename from src/Magnum/Implementation/QueryState.cpp rename to src/Magnum/GL/Implementation/QueryState.cpp index a0b17a195..8291d78e6 100644 --- a/src/Magnum/Implementation/QueryState.cpp +++ b/src/Magnum/GL/Implementation/QueryState.cpp @@ -25,9 +25,9 @@ #include "QueryState.h" -#include "Magnum/AbstractQuery.h" -#include "Magnum/Context.h" -#include "Magnum/Extensions.h" +#include "Magnum/GL/AbstractQuery.h" +#include "Magnum/GL/Context.h" +#include "Magnum/GL/Extensions.h" namespace Magnum { namespace Implementation { diff --git a/src/Magnum/Implementation/QueryState.h b/src/Magnum/GL/Implementation/QueryState.h similarity index 92% rename from src/Magnum/Implementation/QueryState.h rename to src/Magnum/GL/Implementation/QueryState.h index d7250837a..2f0abc786 100644 --- a/src/Magnum/Implementation/QueryState.h +++ b/src/Magnum/GL/Implementation/QueryState.h @@ -1,5 +1,5 @@ -#ifndef Magnum_Implementation_QueryState_h -#define Magnum_Implementation_QueryState_h +#ifndef Magnum_GL_Implementation_QueryState_h +#define Magnum_GL_Implementation_QueryState_h /* This file is part of Magnum. @@ -28,13 +28,13 @@ #include #include -#include "Magnum/Magnum.h" +#include "Magnum/GL/GL.h" #ifdef _MSC_VER /* Otherwise the member function pointers will have different size based on whether the header was included or not. CAUSES SERIOUS MEMORY CORRUPTION AND IS NOT CAUGHT BY ANY WARNING WHATSOEVER! AARGH! */ -#include "Magnum/AbstractQuery.h" +#include "Magnum/GL/AbstractQuery.h" #endif #if defined(MAGNUM_TARGET_WEBGL) && defined(MAGNUM_TARGET_GLES2) diff --git a/src/Magnum/Implementation/RendererState.cpp b/src/Magnum/GL/Implementation/RendererState.cpp similarity index 98% rename from src/Magnum/Implementation/RendererState.cpp rename to src/Magnum/GL/Implementation/RendererState.cpp index 03e67e132..e25db1d34 100644 --- a/src/Magnum/Implementation/RendererState.cpp +++ b/src/Magnum/GL/Implementation/RendererState.cpp @@ -25,8 +25,8 @@ #include "RendererState.h" -#include "Magnum/Context.h" -#include "Magnum/Extensions.h" +#include "Magnum/GL/Context.h" +#include "Magnum/GL/Extensions.h" namespace Magnum { namespace Implementation { diff --git a/src/Magnum/Implementation/RendererState.h b/src/Magnum/GL/Implementation/RendererState.h similarity index 94% rename from src/Magnum/Implementation/RendererState.h rename to src/Magnum/GL/Implementation/RendererState.h index 41397cc09..a636268e0 100644 --- a/src/Magnum/Implementation/RendererState.h +++ b/src/Magnum/GL/Implementation/RendererState.h @@ -1,5 +1,5 @@ -#ifndef Magnum_Implementation_RendererState_h -#define Magnum_Implementation_RendererState_h +#ifndef Magnum_GL_Implementation_RendererState_h +#define Magnum_GL_Implementation_RendererState_h /* This file is part of Magnum. @@ -28,7 +28,7 @@ #include #include -#include "Magnum/Renderer.h" +#include "Magnum/GL/Renderer.h" #include "Magnum/Math/Vector3.h" namespace Magnum { namespace Implementation { diff --git a/src/Magnum/Implementation/ShaderProgramState.cpp b/src/Magnum/GL/Implementation/ShaderProgramState.cpp similarity index 99% rename from src/Magnum/Implementation/ShaderProgramState.cpp rename to src/Magnum/GL/Implementation/ShaderProgramState.cpp index edc63f93a..6fd76b247 100644 --- a/src/Magnum/Implementation/ShaderProgramState.cpp +++ b/src/Magnum/GL/Implementation/ShaderProgramState.cpp @@ -25,9 +25,9 @@ #include "ShaderProgramState.h" -#include "Magnum/AbstractShaderProgram.h" -#include "Magnum/Context.h" -#include "Magnum/Extensions.h" +#include "Magnum/GL/AbstractShaderProgram.h" +#include "Magnum/GL/Context.h" +#include "Magnum/GL/Extensions.h" #include "State.h" diff --git a/src/Magnum/Implementation/ShaderProgramState.h b/src/Magnum/GL/Implementation/ShaderProgramState.h similarity index 96% rename from src/Magnum/Implementation/ShaderProgramState.h rename to src/Magnum/GL/Implementation/ShaderProgramState.h index c2af31222..b5126c708 100644 --- a/src/Magnum/Implementation/ShaderProgramState.h +++ b/src/Magnum/GL/Implementation/ShaderProgramState.h @@ -1,5 +1,5 @@ -#ifndef Magnum_Implementation_ShaderProgramState_h -#define Magnum_Implementation_ShaderProgramState_h +#ifndef Magnum_GL_Implementation_ShaderProgramState_h +#define Magnum_GL_Implementation_ShaderProgramState_h /* This file is part of Magnum. @@ -28,12 +28,12 @@ #include #include -#include "Magnum/Magnum.h" -#include "Magnum/OpenGL.h" +#include "Magnum/GL/GL.h" +#include "Magnum/GL/OpenGL.h" #include "Magnum/Math/Vector3.h" #ifndef MAGNUM_TARGET_GLES2 -#include "Magnum/AbstractShaderProgram.h" +#include "Magnum/GL/AbstractShaderProgram.h" #endif namespace Magnum { namespace Implementation { diff --git a/src/Magnum/Implementation/ShaderState.cpp b/src/Magnum/GL/Implementation/ShaderState.cpp similarity index 97% rename from src/Magnum/Implementation/ShaderState.cpp rename to src/Magnum/GL/Implementation/ShaderState.cpp index 65b46f546..10852439f 100644 --- a/src/Magnum/Implementation/ShaderState.cpp +++ b/src/Magnum/GL/Implementation/ShaderState.cpp @@ -25,10 +25,10 @@ #include "ShaderState.h" -#include "Magnum/Shader.h" +#include "Magnum/GL/Shader.h" #if defined(CORRADE_TARGET_EMSCRIPTEN) && defined(__EMSCRIPTEN_PTHREADS__) -#include "Magnum/Context.h" +#include "Magnum/GL/Context.h" #endif namespace Magnum { namespace Implementation { diff --git a/src/Magnum/Implementation/ShaderState.h b/src/Magnum/GL/Implementation/ShaderState.h similarity index 94% rename from src/Magnum/Implementation/ShaderState.h rename to src/Magnum/GL/Implementation/ShaderState.h index cabd08c73..d439f5551 100644 --- a/src/Magnum/Implementation/ShaderState.h +++ b/src/Magnum/GL/Implementation/ShaderState.h @@ -1,5 +1,5 @@ -#ifndef Magnum_Implementation_ShaderState_h -#define Magnum_Implementation_ShaderState_h +#ifndef Magnum_GL_Implementation_ShaderState_h +#define Magnum_GL_Implementation_ShaderState_h /* This file is part of Magnum. @@ -28,14 +28,14 @@ #include #include -#include "Magnum/Magnum.h" -#include "Magnum/OpenGL.h" +#include "Magnum/GL/GL.h" +#include "Magnum/GL/OpenGL.h" #ifdef _MSC_VER /* Otherwise the member function pointers will have different size based on whether the header was included or not. CAUSES SERIOUS MEMORY CORRUPTION AND IS NOT CAUGHT BY ANY WARNING WHATSOEVER! AARGH! */ -#include "Magnum/Shader.h" +#include "Magnum/GL/Shader.h" #endif namespace Magnum { namespace Implementation { diff --git a/src/Magnum/Implementation/State.cpp b/src/Magnum/GL/Implementation/State.cpp similarity index 82% rename from src/Magnum/Implementation/State.cpp rename to src/Magnum/GL/Implementation/State.cpp index 988087bfa..3f6ba33a6 100644 --- a/src/Magnum/Implementation/State.cpp +++ b/src/Magnum/GL/Implementation/State.cpp @@ -27,25 +27,24 @@ #include -#include "Magnum/Context.h" -#include "Magnum/Extensions.h" - -#include "BufferState.h" -#include "ContextState.h" +#include "Magnum/GL/Context.h" +#include "Magnum/GL/Extensions.h" +#include "Magnum/GL/Implementation/BufferState.h" +#include "Magnum/GL/Implementation/ContextState.h" #ifndef MAGNUM_TARGET_WEBGL -#include "DebugState.h" +#include "Magnum/GL/Implementation/DebugState.h" #endif -#include "FramebufferState.h" -#include "MeshState.h" +#include "Magnum/GL/Implementation/FramebufferState.h" +#include "Magnum/GL/Implementation/MeshState.h" #if !(defined(MAGNUM_TARGET_WEBGL) && defined(MAGNUM_TARGET_GLES2)) -#include "QueryState.h" +#include "Magnum/GL/Implementation/QueryState.h" #endif -#include "RendererState.h" -#include "ShaderState.h" -#include "ShaderProgramState.h" -#include "TextureState.h" +#include "Magnum/GL/Implementation/RendererState.h" +#include "Magnum/GL/Implementation/ShaderState.h" +#include "Magnum/GL/Implementation/ShaderProgramState.h" +#include "Magnum/GL/Implementation/TextureState.h" #ifndef MAGNUM_TARGET_GLES2 -#include "TransformFeedbackState.h" +#include "Magnum/GL/Implementation/TransformFeedbackState.h" #endif namespace Magnum { namespace Implementation { diff --git a/src/Magnum/Implementation/State.h b/src/Magnum/GL/Implementation/State.h similarity index 94% rename from src/Magnum/Implementation/State.h rename to src/Magnum/GL/Implementation/State.h index 871f8edae..294d68140 100644 --- a/src/Magnum/Implementation/State.h +++ b/src/Magnum/GL/Implementation/State.h @@ -1,5 +1,5 @@ -#ifndef Magnum_Implementation_State_h -#define Magnum_Implementation_State_h +#ifndef Magnum_GL_Implementation_State_h +#define Magnum_GL_Implementation_State_h /* This file is part of Magnum. @@ -27,8 +27,8 @@ #include -#include "Magnum/Magnum.h" -#include "Magnum/OpenGL.h" +#include "Magnum/GL/GL.h" +#include "Magnum/GL/OpenGL.h" namespace Magnum { namespace Implementation { diff --git a/src/Magnum/Implementation/TextureState.cpp b/src/Magnum/GL/Implementation/TextureState.cpp similarity index 99% rename from src/Magnum/Implementation/TextureState.cpp rename to src/Magnum/GL/Implementation/TextureState.cpp index 4d11e670a..4e2dc3c5f 100644 --- a/src/Magnum/Implementation/TextureState.cpp +++ b/src/Magnum/GL/Implementation/TextureState.cpp @@ -27,13 +27,13 @@ #include -#include "Magnum/AbstractTexture.h" -#include "Magnum/CubeMapTexture.h" +#include "Magnum/GL/AbstractTexture.h" +#include "Magnum/GL/CubeMapTexture.h" #if !defined(MAGNUM_TARGET_GLES2) && !defined(MAGNUM_TARGET_WEBGL) -#include "Magnum/BufferTexture.h" +#include "Magnum/GL/BufferTexture.h" #endif -#include "Magnum/Context.h" -#include "Magnum/Extensions.h" +#include "Magnum/GL/Context.h" +#include "Magnum/GL/Extensions.h" #include "State.h" diff --git a/src/Magnum/Implementation/TextureState.h b/src/Magnum/GL/Implementation/TextureState.h similarity index 96% rename from src/Magnum/Implementation/TextureState.h rename to src/Magnum/GL/Implementation/TextureState.h index 19a76299d..07a561c4d 100644 --- a/src/Magnum/Implementation/TextureState.h +++ b/src/Magnum/GL/Implementation/TextureState.h @@ -1,5 +1,5 @@ -#ifndef Magnum_Implementation_TextureState_h -#define Magnum_Implementation_TextureState_h +#ifndef Magnum_GL_Implementation_TextureState_h +#define Magnum_GL_Implementation_TextureState_h /* This file is part of Magnum. @@ -30,17 +30,18 @@ #include #include "Magnum/Magnum.h" -#include "Magnum/OpenGL.h" +#include "Magnum/GL/GL.h" +#include "Magnum/GL/OpenGL.h" #ifdef _MSC_VER -#include "Magnum/AbstractTexture.h" +#include "Magnum/GL/AbstractTexture.h" #ifndef MAGNUM_TARGET_GLES2 /* Otherwise the member function pointers will have different size based on whether the header was included or not. CAUSES SERIOUS MEMORY CORRUPTION AND IS NOT CAUGHT BY ANY WARNING WHATSOEVER! AARGH! */ -#include "Magnum/BufferTexture.h" -#include "Magnum/CubeMapTexture.h" +#include "Magnum/GL/BufferTexture.h" +#include "Magnum/GL/CubeMapTexture.h" #endif #endif diff --git a/src/Magnum/Implementation/TransformFeedbackState.cpp b/src/Magnum/GL/Implementation/TransformFeedbackState.cpp similarity index 91% rename from src/Magnum/Implementation/TransformFeedbackState.cpp rename to src/Magnum/GL/Implementation/TransformFeedbackState.cpp index 060566c54..3ef02741b 100644 --- a/src/Magnum/Implementation/TransformFeedbackState.cpp +++ b/src/Magnum/GL/Implementation/TransformFeedbackState.cpp @@ -1,10 +1,9 @@ #include "TransformFeedbackState.h" -#include "Magnum/Context.h" -#include "Magnum/Extensions.h" -#include "Magnum/TransformFeedback.h" - -#include "State.h" +#include "Magnum/GL/Context.h" +#include "Magnum/GL/Extensions.h" +#include "Magnum/GL/TransformFeedback.h" +#include "Magnum/GL/Implementation/State.h" namespace Magnum { namespace Implementation { diff --git a/src/Magnum/Implementation/TransformFeedbackState.h b/src/Magnum/GL/Implementation/TransformFeedbackState.h similarity index 92% rename from src/Magnum/Implementation/TransformFeedbackState.h rename to src/Magnum/GL/Implementation/TransformFeedbackState.h index a6f1f4266..f670e4990 100644 --- a/src/Magnum/Implementation/TransformFeedbackState.h +++ b/src/Magnum/GL/Implementation/TransformFeedbackState.h @@ -1,5 +1,5 @@ -#ifndef Magnum_Implementation_TransformFeedbackState_h -#define Magnum_Implementation_TransformFeedbackState_h +#ifndef Magnum_GL_Implementation_TransformFeedbackState_h +#define Magnum_GL_Implementation_TransformFeedbackState_h /* This file is part of Magnum. @@ -28,14 +28,14 @@ #include #include -#include "Magnum/Magnum.h" -#include "Magnum/OpenGL.h" +#include "Magnum/GL/GL.h" +#include "Magnum/GL/OpenGL.h" #ifdef _MSC_VER /* Otherwise the member function pointers will have different size based on whether the header was included or not. CAUSES SERIOUS MEMORY CORRUPTION AND IS NOT CAUGHT BY ANY WARNING WHATSOEVER! AARGH! */ -#include "Magnum/TransformFeedback.h" +#include "Magnum/GL/TransformFeedback.h" #endif #ifdef MAGNUM_TARGET_GLES2 diff --git a/src/Magnum/Implementation/driverSpecific.cpp b/src/Magnum/GL/Implementation/driverSpecific.cpp similarity index 99% rename from src/Magnum/Implementation/driverSpecific.cpp rename to src/Magnum/GL/Implementation/driverSpecific.cpp index edcc40be1..80ae3acd6 100644 --- a/src/Magnum/Implementation/driverSpecific.cpp +++ b/src/Magnum/GL/Implementation/driverSpecific.cpp @@ -23,11 +23,10 @@ DEALINGS IN THE SOFTWARE. */ -#include "Magnum/Context.h" - #include -#include "Magnum/Extensions.h" +#include "Magnum/GL/Context.h" +#include "Magnum/GL/Extensions.h" #include "Magnum/Math/Range.h" namespace Magnum { diff --git a/src/Magnum/Implementation/maxTextureSize.cpp b/src/Magnum/GL/Implementation/maxTextureSize.cpp similarity index 94% rename from src/Magnum/Implementation/maxTextureSize.cpp rename to src/Magnum/GL/Implementation/maxTextureSize.cpp index 72f647664..f176a72bb 100644 --- a/src/Magnum/Implementation/maxTextureSize.cpp +++ b/src/Magnum/GL/Implementation/maxTextureSize.cpp @@ -25,10 +25,9 @@ #include "maxTextureSize.h" -#include "Magnum/Context.h" - -#include "State.h" -#include "TextureState.h" +#include "Magnum/GL/Context.h" +#include "Magnum/GL/Implementation/State.h" +#include "Magnum/GL/Implementation/TextureState.h" namespace Magnum { namespace Implementation { diff --git a/src/Magnum/Implementation/maxTextureSize.h b/src/Magnum/GL/Implementation/maxTextureSize.h similarity index 92% rename from src/Magnum/Implementation/maxTextureSize.h rename to src/Magnum/GL/Implementation/maxTextureSize.h index 1f5642c5d..3ea93d31e 100644 --- a/src/Magnum/Implementation/maxTextureSize.h +++ b/src/Magnum/GL/Implementation/maxTextureSize.h @@ -1,5 +1,5 @@ -#ifndef Magnum_Implementation_maxTextureSize_h -#define Magnum_Implementation_maxTextureSize_h +#ifndef Magnum_GL_Implementation_maxTextureSize_h +#define Magnum_GL_Implementation_maxTextureSize_h /* This file is part of Magnum. @@ -25,7 +25,7 @@ DEALINGS IN THE SOFTWARE. */ -#include "Magnum/OpenGL.h" +#include "Magnum/GL/OpenGL.h" namespace Magnum { namespace Implementation { diff --git a/src/Magnum/Mesh.cpp b/src/Magnum/GL/Mesh.cpp similarity index 98% rename from src/Magnum/Mesh.cpp rename to src/Magnum/GL/Mesh.cpp index 2bbebb925..0987854a7 100644 --- a/src/Magnum/Mesh.cpp +++ b/src/Magnum/GL/Mesh.cpp @@ -27,20 +27,19 @@ #include -#include "Magnum/AbstractShaderProgram.h" -#include "Magnum/Buffer.h" -#include "Magnum/Context.h" -#include "Magnum/Extensions.h" +#include "Magnum/GL/AbstractShaderProgram.h" +#include "Magnum/GL/Buffer.h" +#include "Magnum/GL/Context.h" +#include "Magnum/GL/Extensions.h" #ifndef MAGNUM_TARGET_GLES -#include "Magnum/TransformFeedback.h" +#include "Magnum/GL/TransformFeedback.h" #endif - +#include "Magnum/GL/Implementation/BufferState.h" #ifndef MAGNUM_TARGET_WEBGL -#include "Implementation/DebugState.h" +#include "Magnum/GL/Implementation/DebugState.h" #endif -#include "Implementation/BufferState.h" -#include "Implementation/MeshState.h" -#include "Implementation/State.h" +#include "Magnum/GL/Implementation/MeshState.h" +#include "Magnum/GL/Implementation/State.h" namespace Magnum { diff --git a/src/Magnum/Mesh.h b/src/Magnum/GL/Mesh.h similarity index 92% rename from src/Magnum/Mesh.h rename to src/Magnum/GL/Mesh.h index c3e10e905..bd77db458 100644 --- a/src/Magnum/Mesh.h +++ b/src/Magnum/GL/Mesh.h @@ -1,5 +1,5 @@ -#ifndef Magnum_Mesh_h -#define Magnum_Mesh_h +#ifndef Magnum_GL_Mesh_h +#define Magnum_GL_Mesh_h /* This file is part of Magnum. @@ -33,9 +33,10 @@ #include #include -#include "Magnum/AbstractObject.h" -#include "Magnum/Attribute.h" #include "Magnum/Tags.h" +#include "Magnum/GL/AbstractObject.h" +#include "Magnum/GL/Attribute.h" +#include "Magnum/GL/GL.h" namespace Magnum { @@ -168,26 +169,26 @@ commands are issued when calling @ref draw(). @subsubsection Mesh-configuration-example-basic Basic non-indexed mesh -@snippet Magnum.cpp Mesh-nonindexed +@snippet MagnumGL.cpp Mesh-nonindexed @subsubsection Mesh-configuration-interleaved Interleaved vertex data -@snippet Magnum.cpp Mesh-interleaved +@snippet MagnumGL.cpp Mesh-interleaved @subsubsection Mesh-configuration-indexed Indexed mesh -@snippet Magnum.cpp Mesh-indexed +@snippet MagnumGL.cpp Mesh-indexed Or using @ref MeshTools::interleave() and @ref MeshTools::compressIndices(): -@snippet Magnum.cpp Mesh-indexed-tools +@snippet MagnumGL.cpp Mesh-indexed-tools Or, if you plan to use the mesh with stock shaders, you can just use @ref MeshTools::compile(). @subsubsection Mesh-configuration-formats Specific formats of vertex data -@snippet Magnum.cpp Mesh-formats +@snippet MagnumGL.cpp Mesh-formats @subsubsection Mesh-configuration-dynamic Dynamically specified attributes @@ -199,7 +200,7 @@ that case, there are overloads of @ref addVertexBuffer() and unsigned byte to float with one byte padding at the end could then look like this: -@snippet Magnum.cpp Mesh-dynamic +@snippet MagnumGL.cpp Mesh-dynamic @section Mesh-rendering Rendering meshes @@ -234,7 +235,7 @@ If index range is specified in @ref setIndexBuffer(), range-based version of drawing commands are used on desktop OpenGL and OpenGL ES 3.0. See also @ref draw() for more information. */ -class MAGNUM_EXPORT Mesh: public AbstractObject { +class MAGNUM_GL_EXPORT Mesh: public AbstractObject { friend MeshView; friend Implementation::MeshState; @@ -594,14 +595,14 @@ class MAGNUM_EXPORT Mesh: public AbstractObject { * position and normal, so you have to skip weight and texture * coordinate in each vertex: * - * @snippet Magnum.cpp Mesh-addVertexBuffer1 + * @snippet MagnumGL.cpp Mesh-addVertexBuffer1 * * You can also achieve the same effect by calling @ref addVertexBuffer() * more times with explicitly specified gaps before and after the * attributes. This can be used for e.g. runtime-dependent * configuration, as it isn't dependent on the variadic template: * - * @snippet Magnum.cpp Mesh-addVertexBuffer2 + * @snippet MagnumGL.cpp Mesh-addVertexBuffer2 * * If specifying more than one attribute, the function assumes that * the array is interleaved. Adding non-interleaved vertex buffer can @@ -609,7 +610,7 @@ class MAGNUM_EXPORT Mesh: public AbstractObject { * Above example with weight, position, texture coordinate and normal * arrays one after another (non-interleaved): * - * @snippet Magnum.cpp Mesh-addVertexBuffer3 + * @snippet MagnumGL.cpp Mesh-addVertexBuffer3 * * If @extension{ARB,vertex_array_object} (part of OpenGL 3.0), OpenGL * ES 3.0, WebGL 2.0, @extension{OES,vertex_array_object} in OpenGL @@ -825,11 +826,11 @@ class MAGNUM_EXPORT Mesh: public AbstractObject { #endif private: - struct MAGNUM_LOCAL AttributeLayout; + struct MAGNUM_GL_LOCAL AttributeLayout; explicit Mesh(GLuint id, MeshPrimitive primitive, ObjectFlags flags); - void MAGNUM_LOCAL createIfNotAlready(); + void MAGNUM_GL_LOCAL createIfNotAlready(); #ifndef MAGNUM_TARGET_WEBGL Mesh& setLabelInternal(Containers::ArrayView label); @@ -898,10 +899,10 @@ class MAGNUM_EXPORT Mesh: public AbstractObject { /* Unconditionally binds a specified VAO and updates the state tracker. Used also in Buffer::bindSomewhereInternal() and Context::resetState(). */ - static void MAGNUM_LOCAL bindVAOImplementationDefault(GLuint id); - static void MAGNUM_LOCAL bindVAOImplementationVAO(GLuint id); + static void MAGNUM_GL_LOCAL bindVAOImplementationDefault(GLuint id); + static void MAGNUM_GL_LOCAL bindVAOImplementationVAO(GLuint id); - void MAGNUM_LOCAL bindVAO(); + void MAGNUM_GL_LOCAL bindVAO(); #ifndef MAGNUM_TARGET_GLES void drawInternal(Int count, Int baseVertex, Int instanceCount, UnsignedInt baseInstance, GLintptr indexOffset, Int indexStart, Int indexEnd); @@ -915,55 +916,55 @@ class MAGNUM_EXPORT Mesh: public AbstractObject { void drawInternal(TransformFeedback& xfb, UnsignedInt stream, Int instanceCount); #endif - void MAGNUM_LOCAL createImplementationDefault(); - void MAGNUM_LOCAL createImplementationVAO(); + void MAGNUM_GL_LOCAL createImplementationDefault(); + void MAGNUM_GL_LOCAL createImplementationVAO(); #ifndef MAGNUM_TARGET_GLES - void MAGNUM_LOCAL createImplementationVAODSA(); + void MAGNUM_GL_LOCAL createImplementationVAODSA(); #endif - void MAGNUM_LOCAL destroyImplementationDefault(); - void MAGNUM_LOCAL destroyImplementationVAO(); + void MAGNUM_GL_LOCAL destroyImplementationDefault(); + void MAGNUM_GL_LOCAL destroyImplementationVAO(); void attributePointerInternal(const Buffer& buffer, GLuint location, GLint size, GLenum type, DynamicAttribute::Kind kind, GLintptr offset, GLsizei stride, GLuint divisor); - void MAGNUM_LOCAL attributePointerInternal(AttributeLayout& attribute); - void MAGNUM_LOCAL attributePointerImplementationDefault(AttributeLayout& attribute); - void MAGNUM_LOCAL attributePointerImplementationVAO(AttributeLayout& attribute); + void MAGNUM_GL_LOCAL attributePointerInternal(AttributeLayout& attribute); + void MAGNUM_GL_LOCAL attributePointerImplementationDefault(AttributeLayout& attribute); + void MAGNUM_GL_LOCAL attributePointerImplementationVAO(AttributeLayout& attribute); #ifndef MAGNUM_TARGET_GLES - void MAGNUM_LOCAL attributePointerImplementationDSAEXT(AttributeLayout& attribute); + void MAGNUM_GL_LOCAL attributePointerImplementationDSAEXT(AttributeLayout& attribute); #endif - void MAGNUM_LOCAL vertexAttribPointer(AttributeLayout& attribute); + void MAGNUM_GL_LOCAL vertexAttribPointer(AttributeLayout& attribute); #ifndef MAGNUM_TARGET_GLES - void MAGNUM_LOCAL vertexAttribDivisorImplementationVAO(GLuint index, GLuint divisor); - void MAGNUM_LOCAL vertexAttribDivisorImplementationDSAEXT(GLuint index, GLuint divisor); + void MAGNUM_GL_LOCAL vertexAttribDivisorImplementationVAO(GLuint index, GLuint divisor); + void MAGNUM_GL_LOCAL vertexAttribDivisorImplementationDSAEXT(GLuint index, GLuint divisor); #elif defined(MAGNUM_TARGET_GLES2) - void MAGNUM_LOCAL vertexAttribDivisorImplementationANGLE(GLuint index, GLuint divisor); + void MAGNUM_GL_LOCAL vertexAttribDivisorImplementationANGLE(GLuint index, GLuint divisor); #ifndef MAGNUM_TARGET_WEBGL - void MAGNUM_LOCAL vertexAttribDivisorImplementationEXT(GLuint index, GLuint divisor); - void MAGNUM_LOCAL vertexAttribDivisorImplementationNV(GLuint index, GLuint divisor); + void MAGNUM_GL_LOCAL vertexAttribDivisorImplementationEXT(GLuint index, GLuint divisor); + void MAGNUM_GL_LOCAL vertexAttribDivisorImplementationNV(GLuint index, GLuint divisor); #endif #endif - void MAGNUM_LOCAL bindIndexBufferImplementationDefault(Buffer&); - void MAGNUM_LOCAL bindIndexBufferImplementationVAO(Buffer& buffer); + void MAGNUM_GL_LOCAL bindIndexBufferImplementationDefault(Buffer&); + void MAGNUM_GL_LOCAL bindIndexBufferImplementationVAO(Buffer& buffer); - void MAGNUM_LOCAL bindImplementationDefault(); - void MAGNUM_LOCAL bindImplementationVAO(); + void MAGNUM_GL_LOCAL bindImplementationDefault(); + void MAGNUM_GL_LOCAL bindImplementationVAO(); - void MAGNUM_LOCAL unbindImplementationDefault(); - void MAGNUM_LOCAL unbindImplementationVAO(); + void MAGNUM_GL_LOCAL unbindImplementationDefault(); + void MAGNUM_GL_LOCAL unbindImplementationVAO(); #ifdef MAGNUM_TARGET_GLES2 - void MAGNUM_LOCAL drawArraysInstancedImplementationANGLE(GLint baseVertex, GLsizei count, GLsizei instanceCount); + void MAGNUM_GL_LOCAL drawArraysInstancedImplementationANGLE(GLint baseVertex, GLsizei count, GLsizei instanceCount); #ifndef MAGNUM_TARGET_WEBGL - void MAGNUM_LOCAL drawArraysInstancedImplementationEXT(GLint baseVertex, GLsizei count, GLsizei instanceCount); - void MAGNUM_LOCAL drawArraysInstancedImplementationNV(GLint baseVertex, GLsizei count, GLsizei instanceCount); + void MAGNUM_GL_LOCAL drawArraysInstancedImplementationEXT(GLint baseVertex, GLsizei count, GLsizei instanceCount); + void MAGNUM_GL_LOCAL drawArraysInstancedImplementationNV(GLint baseVertex, GLsizei count, GLsizei instanceCount); #endif - void MAGNUM_LOCAL drawElementsInstancedImplementationANGLE(GLsizei count, GLintptr indexOffset, GLsizei instanceCount); + void MAGNUM_GL_LOCAL drawElementsInstancedImplementationANGLE(GLsizei count, GLintptr indexOffset, GLsizei instanceCount); #ifndef MAGNUM_TARGET_WEBGL - void MAGNUM_LOCAL drawElementsInstancedImplementationEXT(GLsizei count, GLintptr indexOffset, GLsizei instanceCount); - void MAGNUM_LOCAL drawElementsInstancedImplementationNV(GLsizei count, GLintptr indexOffset, GLsizei instanceCount); + void MAGNUM_GL_LOCAL drawElementsInstancedImplementationEXT(GLsizei count, GLintptr indexOffset, GLsizei instanceCount); + void MAGNUM_GL_LOCAL drawElementsInstancedImplementationNV(GLsizei count, GLintptr indexOffset, GLsizei instanceCount); #endif #endif @@ -985,10 +986,10 @@ class MAGNUM_EXPORT Mesh: public AbstractObject { }; /** @debugoperatorenum{Magnum::MeshPrimitive} */ -MAGNUM_EXPORT Debug& operator<<(Debug& debug, MeshPrimitive value); +MAGNUM_GL_EXPORT Debug& operator<<(Debug& debug, MeshPrimitive value); /** @debugoperatorclassenum{Magnum::Mesh,Magnum::Mesh::IndexType} */ -MAGNUM_EXPORT Debug& operator<<(Debug& debug, Mesh::IndexType value); +MAGNUM_GL_EXPORT Debug& operator<<(Debug& debug, Mesh::IndexType value); inline GLuint Mesh::release() { const GLuint id = _id; @@ -1001,7 +1002,7 @@ inline GLuint Mesh::release() { namespace Corrade { namespace Utility { /** @configurationvalue{Magnum::MeshPrimitive} */ -template<> struct MAGNUM_EXPORT ConfigurationValue { +template<> struct MAGNUM_GL_EXPORT ConfigurationValue { ConfigurationValue() = delete; /** @@ -1020,7 +1021,7 @@ template<> struct MAGNUM_EXPORT ConfigurationValue { }; /** @configurationvalue{Magnum::Mesh::IndexType} */ -template<> struct MAGNUM_EXPORT ConfigurationValue { +template<> struct MAGNUM_GL_EXPORT ConfigurationValue { ConfigurationValue() = delete; /** diff --git a/src/Magnum/MeshView.cpp b/src/Magnum/GL/MeshView.cpp similarity index 96% rename from src/Magnum/MeshView.cpp rename to src/Magnum/GL/MeshView.cpp index 2408d0969..f413f20de 100644 --- a/src/Magnum/MeshView.cpp +++ b/src/Magnum/GL/MeshView.cpp @@ -28,12 +28,11 @@ #include #include -#include "Magnum/AbstractShaderProgram.h" -#include "Magnum/Context.h" -#include "Magnum/Mesh.h" - -#include "Implementation/State.h" -#include "Implementation/MeshState.h" +#include "Magnum/GL/AbstractShaderProgram.h" +#include "Magnum/GL/Context.h" +#include "Magnum/GL/Mesh.h" +#include "Magnum/GL/Implementation/State.h" +#include "Magnum/GL/Implementation/MeshState.h" namespace Magnum { diff --git a/src/Magnum/MeshView.h b/src/Magnum/GL/MeshView.h similarity index 96% rename from src/Magnum/MeshView.h rename to src/Magnum/GL/MeshView.h index 4ee06918c..07244ffab 100644 --- a/src/Magnum/MeshView.h +++ b/src/Magnum/GL/MeshView.h @@ -1,5 +1,5 @@ -#ifndef Magnum_MeshView_h -#define Magnum_MeshView_h +#ifndef Magnum_GL_MeshView_h +#define Magnum_GL_MeshView_h /* This file is part of Magnum. @@ -32,9 +32,9 @@ #include #include -#include "Magnum/Magnum.h" -#include "Magnum/OpenGL.h" -#include "Magnum/visibility.h" +#include "Magnum/GL/GL.h" +#include "Magnum/GL/OpenGL.h" +#include "Magnum/GL/visibility.h" namespace Magnum { @@ -56,7 +56,7 @@ no draw commands are issued when calling @ref draw(). You must ensure that the original mesh remains available for whole view lifetime. */ -class MAGNUM_EXPORT MeshView { +class MAGNUM_GL_EXPORT MeshView { friend Implementation::MeshState; public: @@ -268,9 +268,9 @@ class MAGNUM_EXPORT MeshView { private: #ifndef MAGNUM_TARGET_WEBGL - static MAGNUM_LOCAL void multiDrawImplementationDefault(std::initializer_list> meshes); + static MAGNUM_GL_LOCAL void multiDrawImplementationDefault(std::initializer_list> meshes); #endif - static MAGNUM_LOCAL void multiDrawImplementationFallback(std::initializer_list> meshes); + static MAGNUM_GL_LOCAL void multiDrawImplementationFallback(std::initializer_list> meshes); std::reference_wrapper _original; diff --git a/src/Magnum/MultisampleTexture.cpp b/src/Magnum/GL/MultisampleTexture.cpp similarity index 88% rename from src/Magnum/MultisampleTexture.cpp rename to src/Magnum/GL/MultisampleTexture.cpp index aed4e1d73..2fc2af327 100644 --- a/src/Magnum/MultisampleTexture.cpp +++ b/src/Magnum/GL/MultisampleTexture.cpp @@ -26,14 +26,14 @@ #include "MultisampleTexture.h" #ifndef MAGNUM_TARGET_GLES2 -#include "Magnum/Context.h" -#include "Magnum/Extensions.h" +#include "Magnum/GL/Context.h" +#include "Magnum/GL/Extensions.h" -#include "Implementation/maxTextureSize.h" +#include "Magnum/GL/Implementation/maxTextureSize.h" namespace Magnum { namespace Implementation { -template<> Vector2i MAGNUM_EXPORT maxMultisampleTextureSize<2>() { +template<> Vector2i MAGNUM_GL_EXPORT maxMultisampleTextureSize<2>() { #ifndef MAGNUM_TARGET_GLES if(!Context::current().isExtensionSupported()) #else @@ -44,7 +44,7 @@ template<> Vector2i MAGNUM_EXPORT maxMultisampleTextureSize<2>() { return Vector2i{Implementation::maxTextureSideSize()}; } -template<> Vector3i MAGNUM_EXPORT maxMultisampleTextureSize<3>() { +template<> Vector3i MAGNUM_GL_EXPORT maxMultisampleTextureSize<3>() { #ifndef MAGNUM_TARGET_GLES if(!Context::current().isExtensionSupported()) return Vector3i{0}; diff --git a/src/Magnum/MultisampleTexture.h b/src/Magnum/GL/MultisampleTexture.h similarity index 98% rename from src/Magnum/MultisampleTexture.h rename to src/Magnum/GL/MultisampleTexture.h index 6b0d5ad15..dde7a80c2 100644 --- a/src/Magnum/MultisampleTexture.h +++ b/src/Magnum/GL/MultisampleTexture.h @@ -1,5 +1,5 @@ -#ifndef Magnum_MultisampleTexture_h -#define Magnum_MultisampleTexture_h +#ifndef Magnum_GL_MultisampleTexture_h +#define Magnum_GL_MultisampleTexture_h /* This file is part of Magnum. @@ -31,8 +31,8 @@ */ #endif -#include "Magnum/AbstractTexture.h" #include "Magnum/DimensionTraits.h" +#include "Magnum/GL/AbstractTexture.h" #include "Magnum/Math/Vector3.h" #if !defined(MAGNUM_TARGET_GLES2) && !defined(MAGNUM_TARGET_WEBGL) @@ -50,8 +50,8 @@ namespace Implementation { } template VectorTypeFor maxMultisampleTextureSize(); - template<> MAGNUM_EXPORT Vector2i maxMultisampleTextureSize<2>(); - template<> MAGNUM_EXPORT Vector3i maxMultisampleTextureSize<3>(); + template<> MAGNUM_GL_EXPORT Vector2i maxMultisampleTextureSize<2>(); + template<> MAGNUM_GL_EXPORT Vector3i maxMultisampleTextureSize<3>(); } /** @@ -77,7 +77,7 @@ also @ref AbstractTexture documentation for more information. As multisample textures have no sampler state, the only thing you need is to set storage: -@snippet Magnum.cpp MultisampleTexture-usage +@snippet MagnumGL.cpp MultisampleTexture-usage In shader, the texture is used via @glsl sampler2DMS @ce / @glsl sampler2DMSArray @ce, @glsl isampler2DMS @ce / @glsl isampler2DMSArray @ce or @glsl usampler2DMS @ce diff --git a/src/Magnum/OpenGL.cpp b/src/Magnum/GL/OpenGL.cpp similarity index 98% rename from src/Magnum/OpenGL.cpp rename to src/Magnum/GL/OpenGL.cpp index 317f859d2..bfd03b735 100644 --- a/src/Magnum/OpenGL.cpp +++ b/src/Magnum/GL/OpenGL.cpp @@ -25,8 +25,8 @@ #include -#include "Magnum/OpenGL.h" #include "Magnum/Types.h" +#include "Magnum/GL/OpenGL.h" namespace Magnum { diff --git a/src/Magnum/OpenGL.h b/src/Magnum/GL/OpenGL.h similarity index 97% rename from src/Magnum/OpenGL.h rename to src/Magnum/GL/OpenGL.h index 3979f1678..59bf89bb5 100644 --- a/src/Magnum/OpenGL.h +++ b/src/Magnum/GL/OpenGL.h @@ -1,5 +1,5 @@ -#ifndef Magnum_OpenGL_h -#define Magnum_OpenGL_h +#ifndef Magnum_GL_OpenGL_h +#define Magnum_GL_OpenGL_h /* This file is part of Magnum. diff --git a/src/Magnum/OpenGLTester.cpp b/src/Magnum/GL/OpenGLTester.cpp similarity index 96% rename from src/Magnum/OpenGLTester.cpp rename to src/Magnum/GL/OpenGLTester.cpp index 896dfbb69..fe772abe0 100644 --- a/src/Magnum/OpenGLTester.cpp +++ b/src/Magnum/GL/OpenGLTester.cpp @@ -25,10 +25,10 @@ #include "OpenGLTester.h" -#include "Magnum/Context.h" -#include "Magnum/Extensions.h" +#include "Magnum/GL/Context.h" +#include "Magnum/GL/Extensions.h" #ifndef MAGNUM_TARGET_WEBGL -#include "Magnum/DebugOutput.h" +#include "Magnum/GL/DebugOutput.h" #endif namespace Magnum { diff --git a/src/Magnum/OpenGLTester.h b/src/Magnum/GL/OpenGLTester.h similarity index 98% rename from src/Magnum/OpenGLTester.h rename to src/Magnum/GL/OpenGLTester.h index 297b47414..e42b1b177 100644 --- a/src/Magnum/OpenGLTester.h +++ b/src/Magnum/GL/OpenGLTester.h @@ -1,5 +1,5 @@ -#ifndef Magnum_OpenGLTester_h -#define Magnum_OpenGLTester_h +#ifndef Magnum_GL_OpenGLTester_h +#define Magnum_GL_OpenGLTester_h /* This file is part of Magnum. @@ -31,7 +31,7 @@ #include -#include "Magnum/Renderer.h" +#include "Magnum/GL/Renderer.h" #if defined(MAGNUM_TARGET_HEADLESS) || defined(CORRADE_TARGET_EMSCRIPTEN) || defined(CORRADE_TARGET_ANDROID) #include "Magnum/Platform/WindowlessEglApplication.h" @@ -56,7 +56,7 @@ #endif #ifndef MAGNUM_TARGET_WEBGL -#include "Magnum/TimeQuery.h" +#include "Magnum/GL/TimeQuery.h" #endif namespace Magnum { @@ -271,7 +271,7 @@ class OpenGLTester: public TestSuite::Tester { Equivalent to -@snippet Magnum.cpp OpenGLTester-MAGNUM_VERIFY_NO_ERROR +@snippet MagnumGL.cpp OpenGLTester-MAGNUM_VERIFY_NO_ERROR */ #define MAGNUM_VERIFY_NO_ERROR() CORRADE_COMPARE(Magnum::Renderer::error(), Magnum::Renderer::Error::NoError) diff --git a/src/Magnum/PixelFormat.cpp b/src/Magnum/GL/PixelFormat.cpp similarity index 100% rename from src/Magnum/PixelFormat.cpp rename to src/Magnum/GL/PixelFormat.cpp diff --git a/src/Magnum/PixelFormat.h b/src/Magnum/GL/PixelFormat.h similarity index 99% rename from src/Magnum/PixelFormat.h rename to src/Magnum/GL/PixelFormat.h index f1abce9a1..b67cff20b 100644 --- a/src/Magnum/PixelFormat.h +++ b/src/Magnum/GL/PixelFormat.h @@ -1,5 +1,5 @@ -#ifndef Magnum_PixelFormat_h -#define Magnum_PixelFormat_h +#ifndef Magnum_GL_PixelFormat_h +#define Magnum_GL_PixelFormat_h /* This file is part of Magnum. @@ -30,8 +30,8 @@ */ #include "Magnum/Magnum.h" -#include "Magnum/OpenGL.h" -#include "Magnum/visibility.h" +#include "Magnum/GL/OpenGL.h" +#include "Magnum/GL/visibility.h" namespace Magnum { @@ -1235,13 +1235,13 @@ enum class CompressedPixelFormat: GLenum { }; /** @debugoperatorenum{Magnum::PixelFormat} */ -MAGNUM_EXPORT Debug& operator<<(Debug& debug, PixelFormat value); +MAGNUM_GL_EXPORT Debug& operator<<(Debug& debug, PixelFormat value); /** @debugoperatorenum{Magnum::PixelType} */ -MAGNUM_EXPORT Debug& operator<<(Debug& debug, PixelType value); +MAGNUM_GL_EXPORT Debug& operator<<(Debug& debug, PixelType value); /** @debugoperatorenum{Magnum::CompressedPixelFormat} */ -MAGNUM_EXPORT Debug& operator<<(Debug& debug, CompressedPixelFormat value); +MAGNUM_GL_EXPORT Debug& operator<<(Debug& debug, CompressedPixelFormat value); } diff --git a/src/Magnum/PrimitiveQuery.cpp b/src/Magnum/GL/PrimitiveQuery.cpp similarity index 100% rename from src/Magnum/PrimitiveQuery.cpp rename to src/Magnum/GL/PrimitiveQuery.cpp diff --git a/src/Magnum/PrimitiveQuery.h b/src/Magnum/GL/PrimitiveQuery.h similarity index 97% rename from src/Magnum/PrimitiveQuery.h rename to src/Magnum/GL/PrimitiveQuery.h index 917484521..e5c9b37ed 100644 --- a/src/Magnum/PrimitiveQuery.h +++ b/src/Magnum/GL/PrimitiveQuery.h @@ -1,5 +1,5 @@ -#ifndef Magnum_PrimitiveQuery_h -#define Magnum_PrimitiveQuery_h +#ifndef Magnum_GL_PrimitiveQuery_h +#define Magnum_GL_PrimitiveQuery_h /* This file is part of Magnum. @@ -31,7 +31,7 @@ */ #endif -#include "Magnum/AbstractQuery.h" +#include "Magnum/GL/AbstractQuery.h" #ifndef MAGNUM_TARGET_GLES2 namespace Magnum { @@ -42,14 +42,14 @@ namespace Magnum { Queries count of generated primitives from vertex shader, geometry shader or transform feedback. Example usage: -@snippet Magnum.cpp PrimitiveQuery-usage +@snippet MagnumGL.cpp PrimitiveQuery-usage @see @ref SampleQuery, @ref TimeQuery, @ref TransformFeedback @requires_gl30 Extension @extension{EXT,transform_feedback} @requires_gles30 Only sample queries are available in OpenGL ES 2.0. @requires_webgl20 Queries are not available in WebGL 1.0. */ -class MAGNUM_EXPORT PrimitiveQuery: public AbstractQuery { +class MAGNUM_GL_EXPORT PrimitiveQuery: public AbstractQuery { public: /** * @brief Query target diff --git a/src/Magnum/RectangleTexture.cpp b/src/Magnum/GL/RectangleTexture.cpp similarity index 93% rename from src/Magnum/RectangleTexture.cpp rename to src/Magnum/GL/RectangleTexture.cpp index b26d8b9ba..582721b55 100644 --- a/src/Magnum/RectangleTexture.cpp +++ b/src/Magnum/GL/RectangleTexture.cpp @@ -26,13 +26,13 @@ #include "RectangleTexture.h" #ifndef MAGNUM_TARGET_GLES -#include "Magnum/BufferImage.h" -#include "Magnum/Context.h" -#include "Magnum/Extensions.h" #include "Magnum/Image.h" +#include "Magnum/GL/BufferImage.h" +#include "Magnum/GL/Context.h" +#include "Magnum/GL/Extensions.h" -#include "Implementation/State.h" -#include "Implementation/TextureState.h" +#include "Magnum/GL/Implementation/State.h" +#include "Magnum/GL/Implementation/TextureState.h" namespace Magnum { diff --git a/src/Magnum/RectangleTexture.h b/src/Magnum/GL/RectangleTexture.h similarity index 96% rename from src/Magnum/RectangleTexture.h rename to src/Magnum/GL/RectangleTexture.h index b81581b0a..f35d8c935 100644 --- a/src/Magnum/RectangleTexture.h +++ b/src/Magnum/GL/RectangleTexture.h @@ -1,5 +1,5 @@ -#ifndef Magnum_RectangleTexture_h -#define Magnum_RectangleTexture_h +#ifndef Magnum_GL_RectangleTexture_h +#define Magnum_GL_RectangleTexture_h /* This file is part of Magnum. @@ -31,8 +31,8 @@ */ #endif -#include "Magnum/AbstractTexture.h" #include "Magnum/Array.h" +#include "Magnum/GL/AbstractTexture.h" #include "Magnum/Math/Vector2.h" #ifndef MAGNUM_TARGET_GLES @@ -48,7 +48,7 @@ See also @ref AbstractTexture documentation for more information. Common usage is to fully configure all texture parameters and then set the data from e.g. @ref Image2D. Example configuration: -@snippet Magnum.cpp RectangleTexture-usage +@snippet MagnumGL.cpp RectangleTexture-usage In a shader, the texture is used via @glsl sampler2DRect @ce, @glsl sampler2DRectShadow @ce, @glsl isampler2DRect @ce or @glsl usampler2DRect @ce. @@ -61,7 +61,7 @@ in shaders. @requires_gl31 Extension @extension{ARB,texture_rectangle} @requires_gl Rectangle textures are not available in OpenGL ES and WebGL. */ -class MAGNUM_EXPORT RectangleTexture: public AbstractTexture { +class MAGNUM_GL_EXPORT RectangleTexture: public AbstractTexture { public: /** * @brief Max supported rectangle texture size @@ -327,7 +327,7 @@ class MAGNUM_EXPORT RectangleTexture: public AbstractTexture { * * Convenience alternative to the above, example usage: * - * @snippet Magnum.cpp RectangleTexture-image1 + * @snippet MagnumGL.cpp RectangleTexture-image1 */ Image2D image(Image2D&& image); @@ -345,7 +345,7 @@ class MAGNUM_EXPORT RectangleTexture: public AbstractTexture { * * Convenience alternative to the above, example usage: * - * @snippet Magnum.cpp RectangleTexture-image2 + * @snippet MagnumGL.cpp RectangleTexture-image2 */ BufferImage2D image(BufferImage2D&& image, BufferUsage usage); @@ -363,7 +363,7 @@ class MAGNUM_EXPORT RectangleTexture: public AbstractTexture { * * Convenience alternative to the above, example usage: * - * @snippet Magnum.cpp RectangleTexture-compressedImage1 + * @snippet MagnumGL.cpp RectangleTexture-compressedImage1 */ CompressedImage2D compressedImage(CompressedImage2D&& image); @@ -381,7 +381,7 @@ class MAGNUM_EXPORT RectangleTexture: public AbstractTexture { * * Convenience alternative to the above, example usage: * - * @snippet Magnum.cpp RectangleTexture-compressedImage2 + * @snippet MagnumGL.cpp RectangleTexture-compressedImage2 */ CompressedBufferImage2D compressedImage(CompressedBufferImage2D&& image, BufferUsage usage); @@ -400,7 +400,7 @@ class MAGNUM_EXPORT RectangleTexture: public AbstractTexture { * * Convenience alternative to the above, example usage: * - * @snippet Magnum.cpp RectangleTexture-subImage1 + * @snippet MagnumGL.cpp RectangleTexture-subImage1 */ Image2D subImage(const Range2Di& range, Image2D&& image); @@ -419,7 +419,7 @@ class MAGNUM_EXPORT RectangleTexture: public AbstractTexture { * * Convenience alternative to the above, example usage: * - * @snippet Magnum.cpp RectangleTexture-subImage2 + * @snippet MagnumGL.cpp RectangleTexture-subImage2 */ BufferImage2D subImage(const Range2Di& range, BufferImage2D&& image, BufferUsage usage); @@ -442,7 +442,7 @@ class MAGNUM_EXPORT RectangleTexture: public AbstractTexture { * * Convenience alternative to the above, example usage: * - * @snippet Magnum.cpp RectangleTexture-compressedSubImage1 + * @snippet MagnumGL.cpp RectangleTexture-compressedSubImage1 */ CompressedImage2D compressedSubImage(const Range2Di& range, CompressedImage2D&& image); @@ -465,7 +465,7 @@ class MAGNUM_EXPORT RectangleTexture: public AbstractTexture { * * Convenience alternative to the above, example usage: * - * @snippet Magnum.cpp RectangleTexture-compressedSubImage2 + * @snippet MagnumGL.cpp RectangleTexture-compressedSubImage2 */ CompressedBufferImage2D compressedSubImage(const Range2Di& range, CompressedBufferImage2D&& image, BufferUsage usage); diff --git a/src/Magnum/Renderbuffer.cpp b/src/Magnum/GL/Renderbuffer.cpp similarity index 96% rename from src/Magnum/Renderbuffer.cpp rename to src/Magnum/GL/Renderbuffer.cpp index e9f1cf1c4..715e6f2fb 100644 --- a/src/Magnum/Renderbuffer.cpp +++ b/src/Magnum/GL/Renderbuffer.cpp @@ -25,14 +25,14 @@ #include "Renderbuffer.h" -#include "Magnum/Context.h" -#include "Magnum/Extensions.h" +#include "Magnum/GL/Context.h" +#include "Magnum/GL/Extensions.h" #ifndef MAGNUM_TARGET_WEBGL -#include "Implementation/DebugState.h" +#include "Magnum/GL/Implementation/DebugState.h" #endif -#include "Implementation/FramebufferState.h" -#include "Implementation/State.h" +#include "Magnum/GL/Implementation/FramebufferState.h" +#include "Magnum/GL/Implementation/State.h" namespace Magnum { diff --git a/src/Magnum/Renderbuffer.h b/src/Magnum/GL/Renderbuffer.h similarity index 90% rename from src/Magnum/Renderbuffer.h rename to src/Magnum/GL/Renderbuffer.h index 949b22ed5..ae904dc53 100644 --- a/src/Magnum/Renderbuffer.h +++ b/src/Magnum/GL/Renderbuffer.h @@ -1,5 +1,5 @@ -#ifndef Magnum_Renderbuffer_h -#define Magnum_Renderbuffer_h +#ifndef Magnum_GL_Renderbuffer_h +#define Magnum_GL_Renderbuffer_h /* This file is part of Magnum. @@ -31,9 +31,9 @@ #include -#include "Magnum/AbstractObject.h" -#include "Magnum/Magnum.h" #include "Magnum/Tags.h" +#include "Magnum/GL/AbstractObject.h" +#include "Magnum/GL/GL.h" namespace Magnum { @@ -60,7 +60,7 @@ information. @requires_gl30 Extension @extension{ARB,framebuffer_object} */ -class MAGNUM_EXPORT Renderbuffer: public AbstractObject { +class MAGNUM_GL_EXPORT Renderbuffer: public AbstractObject { friend Implementation::FramebufferState; public: @@ -251,35 +251,35 @@ class MAGNUM_EXPORT Renderbuffer: public AbstractObject { private: explicit Renderbuffer(GLuint id, ObjectFlags flags) noexcept: _id{id}, _flags{flags} {} - void MAGNUM_LOCAL createImplementationDefault(); + void MAGNUM_GL_LOCAL createImplementationDefault(); #ifndef MAGNUM_TARGET_GLES - void MAGNUM_LOCAL createImplementationDSA(); + void MAGNUM_GL_LOCAL createImplementationDSA(); #endif - void MAGNUM_LOCAL createIfNotAlready(); + void MAGNUM_GL_LOCAL createIfNotAlready(); #ifndef MAGNUM_TARGET_WEBGL Renderbuffer& setLabelInternal(Containers::ArrayView label); #endif - void MAGNUM_LOCAL storageImplementationDefault(RenderbufferFormat internalFormat, const Vector2i& size); + void MAGNUM_GL_LOCAL storageImplementationDefault(RenderbufferFormat internalFormat, const Vector2i& size); #ifndef MAGNUM_TARGET_GLES - void MAGNUM_LOCAL storageImplementationDSA(RenderbufferFormat internalFormat, const Vector2i& size); - void MAGNUM_LOCAL storageImplementationDSAEXT(RenderbufferFormat internalFormat, const Vector2i& size); + void MAGNUM_GL_LOCAL storageImplementationDSA(RenderbufferFormat internalFormat, const Vector2i& size); + void MAGNUM_GL_LOCAL storageImplementationDSAEXT(RenderbufferFormat internalFormat, const Vector2i& size); #endif #ifndef MAGNUM_TARGET_GLES2 - void MAGNUM_LOCAL storageMultisampleImplementationDefault(GLsizei samples, RenderbufferFormat internalFormat, const Vector2i& size); + void MAGNUM_GL_LOCAL storageMultisampleImplementationDefault(GLsizei samples, RenderbufferFormat internalFormat, const Vector2i& size); #ifndef MAGNUM_TARGET_GLES - void MAGNUM_LOCAL storageMultisampleImplementationDSA(GLsizei samples, RenderbufferFormat internalFormat, const Vector2i& size); - void MAGNUM_LOCAL storageMultisampleImplementationDSAEXT(GLsizei samples, RenderbufferFormat internalFormat, const Vector2i& size); + void MAGNUM_GL_LOCAL storageMultisampleImplementationDSA(GLsizei samples, RenderbufferFormat internalFormat, const Vector2i& size); + void MAGNUM_GL_LOCAL storageMultisampleImplementationDSAEXT(GLsizei samples, RenderbufferFormat internalFormat, const Vector2i& size); #endif #elif !defined(MAGNUM_TARGET_WEBGL) - void MAGNUM_LOCAL storageMultisampleImplementationANGLE(GLsizei samples, RenderbufferFormat internalFormat, const Vector2i& size); - void MAGNUM_LOCAL storageMultisampleImplementationNV(GLsizei samples, RenderbufferFormat internalFormat, const Vector2i& size); + void MAGNUM_GL_LOCAL storageMultisampleImplementationANGLE(GLsizei samples, RenderbufferFormat internalFormat, const Vector2i& size); + void MAGNUM_GL_LOCAL storageMultisampleImplementationNV(GLsizei samples, RenderbufferFormat internalFormat, const Vector2i& size); #endif - void MAGNUM_LOCAL bind(); + void MAGNUM_GL_LOCAL bind(); GLuint _id; ObjectFlags _flags; diff --git a/src/Magnum/RenderbufferFormat.h b/src/Magnum/GL/RenderbufferFormat.h similarity index 99% rename from src/Magnum/RenderbufferFormat.h rename to src/Magnum/GL/RenderbufferFormat.h index 53debbe8a..bff4e20dd 100644 --- a/src/Magnum/RenderbufferFormat.h +++ b/src/Magnum/GL/RenderbufferFormat.h @@ -1,5 +1,5 @@ -#ifndef Magnum_RenderbufferFormat_h -#define Magnum_RenderbufferFormat_h +#ifndef Magnum_GL_RenderbufferFormat_h +#define Magnum_GL_RenderbufferFormat_h /* This file is part of Magnum. @@ -29,7 +29,7 @@ * @brief Enum @ref Magnum::RenderbufferFormat */ -#include "Magnum/OpenGL.h" +#include "Magnum/GL/OpenGL.h" namespace Magnum { diff --git a/src/Magnum/Renderer.cpp b/src/Magnum/GL/Renderer.cpp similarity index 98% rename from src/Magnum/Renderer.cpp rename to src/Magnum/GL/Renderer.cpp index 2e039eab4..5d33f9dc9 100644 --- a/src/Magnum/Renderer.cpp +++ b/src/Magnum/GL/Renderer.cpp @@ -25,13 +25,13 @@ #include "Renderer.h" -#include "Magnum/Context.h" -#include "Magnum/Extensions.h" +#include "Magnum/GL/Context.h" +#include "Magnum/GL/Extensions.h" #include "Magnum/Math/Color.h" #include "Magnum/Math/Range.h" -#include "Implementation/State.h" -#include "Implementation/RendererState.h" +#include "Magnum/GL/Implementation/State.h" +#include "Magnum/GL/Implementation/RendererState.h" namespace Magnum { diff --git a/src/Magnum/Renderer.h b/src/Magnum/GL/Renderer.h similarity index 98% rename from src/Magnum/Renderer.h rename to src/Magnum/GL/Renderer.h index 154d5e917..2450223fb 100644 --- a/src/Magnum/Renderer.h +++ b/src/Magnum/GL/Renderer.h @@ -1,5 +1,5 @@ -#ifndef Magnum_Renderer_h -#define Magnum_Renderer_h +#ifndef Magnum_GL_Renderer_h +#define Magnum_GL_Renderer_h /* This file is part of Magnum. @@ -32,8 +32,9 @@ #include #include "Magnum/Magnum.h" -#include "Magnum/OpenGL.h" -#include "Magnum/visibility.h" +#include "Magnum/GL/GL.h" +#include "Magnum/GL/OpenGL.h" +#include "Magnum/GL/visibility.h" namespace Magnum { @@ -47,7 +48,7 @@ namespace Implementation { struct RendererState; } @todo `GL_STEREO`, `GL_DOUBLEBUFFER` (?) @todo `GL_MAX_CLIP_DISTANCES`... */ -class MAGNUM_EXPORT Renderer { +class MAGNUM_GL_EXPORT Renderer { friend Context; friend Implementation::RendererState; @@ -1617,16 +1618,16 @@ class MAGNUM_EXPORT Renderer { /*@}*/ private: - static void MAGNUM_LOCAL initializeContextBasedFunctionality(); + static void MAGNUM_GL_LOCAL initializeContextBasedFunctionality(); #ifndef MAGNUM_TARGET_GLES - static void MAGNUM_LOCAL clearDepthfImplementationDefault(GLfloat depth); + static void MAGNUM_GL_LOCAL clearDepthfImplementationDefault(GLfloat depth); #endif - static void MAGNUM_LOCAL clearDepthfImplementationES(GLfloat depth); + static void MAGNUM_GL_LOCAL clearDepthfImplementationES(GLfloat depth); #ifndef MAGNUM_TARGET_WEBGL - static GraphicsResetStatus MAGNUM_LOCAL graphicsResetStatusImplementationDefault(); - static GraphicsResetStatus MAGNUM_LOCAL graphicsResetStatusImplementationRobustness(); + static GraphicsResetStatus MAGNUM_GL_LOCAL graphicsResetStatusImplementationDefault(); + static GraphicsResetStatus MAGNUM_GL_LOCAL graphicsResetStatusImplementationRobustness(); #endif }; @@ -1635,14 +1636,14 @@ CORRADE_ENUMSET_OPERATORS(Renderer::MemoryBarriers) #endif /** @debugoperatorclassenum{Magnum::Renderer,Magnum::Renderer::Error} */ -MAGNUM_EXPORT Debug& operator<<(Debug& debug, Renderer::Error value); +MAGNUM_GL_EXPORT Debug& operator<<(Debug& debug, Renderer::Error value); #ifndef MAGNUM_TARGET_WEBGL /** @debugoperatorclassenum{Magnum::Renderer,Magnum::Renderer::ResetNotificationStrategy} */ -MAGNUM_EXPORT Debug& operator<<(Debug& debug, Renderer::ResetNotificationStrategy value); +MAGNUM_GL_EXPORT Debug& operator<<(Debug& debug, Renderer::ResetNotificationStrategy value); /** @debugoperatorclassenum{Magnum::Renderer,Magnum::Renderer::GraphicsResetStatus} */ -MAGNUM_EXPORT Debug& operator<<(Debug& debug, Renderer::GraphicsResetStatus value); +MAGNUM_GL_EXPORT Debug& operator<<(Debug& debug, Renderer::GraphicsResetStatus value); #endif } diff --git a/src/Magnum/SampleQuery.h b/src/Magnum/GL/SampleQuery.h similarity index 98% rename from src/Magnum/SampleQuery.h rename to src/Magnum/GL/SampleQuery.h index cb34ebf0c..9dd56d48f 100644 --- a/src/Magnum/SampleQuery.h +++ b/src/Magnum/GL/SampleQuery.h @@ -1,5 +1,5 @@ -#ifndef Magnum_SampleQuery_h -#define Magnum_SampleQuery_h +#ifndef Magnum_GL_SampleQuery_h +#define Magnum_GL_SampleQuery_h /* This file is part of Magnum. @@ -31,7 +31,7 @@ */ #endif -#include "Magnum/AbstractQuery.h" +#include "Magnum/GL/AbstractQuery.h" #if !(defined(MAGNUM_TARGET_WEBGL) && defined(MAGNUM_TARGET_GLES2)) namespace Magnum { @@ -43,7 +43,7 @@ Queries count of samples passed from fragment shader or boolean value indicating whether any samples passed. Can be used for example for conditional rendering: -@snippet Magnum.cpp SampleQuery-usage +@snippet MagnumGL.cpp SampleQuery-usage This approach has some drawbacks, as the rendering is blocked until result is available for the CPU to decide. This can be improved by using conditional @@ -51,7 +51,7 @@ rendering on GPU itself. The drawing commands will be sent to the GPU and processed or discarded later, so CPU can continue executing the code without waiting for the result. -@snippet Magnum.cpp SampleQuery-conditional-render +@snippet MagnumGL.cpp SampleQuery-conditional-render @see @ref PrimitiveQuery, @ref TimeQuery @requires_gles30 Extension @extension{EXT,occlusion_query_boolean} in diff --git a/src/Magnum/Sampler.cpp b/src/Magnum/GL/Sampler.cpp similarity index 97% rename from src/Magnum/Sampler.cpp rename to src/Magnum/GL/Sampler.cpp index 9b099360a..1ca3017ce 100644 --- a/src/Magnum/Sampler.cpp +++ b/src/Magnum/GL/Sampler.cpp @@ -27,10 +27,10 @@ #include -#include "Magnum/Context.h" -#include "Magnum/Implementation/State.h" -#include "Magnum/Implementation/TextureState.h" -#include "Magnum/Extensions.h" +#include "Magnum/GL/Context.h" +#include "Magnum/GL/Extensions.h" +#include "Magnum/GL/Implementation/State.h" +#include "Magnum/GL/Implementation/TextureState.h" namespace Magnum { diff --git a/src/Magnum/Sampler.h b/src/Magnum/GL/Sampler.h similarity index 94% rename from src/Magnum/Sampler.h rename to src/Magnum/GL/Sampler.h index 1927f13c8..be21f60dd 100644 --- a/src/Magnum/Sampler.h +++ b/src/Magnum/GL/Sampler.h @@ -1,5 +1,5 @@ -#ifndef Magnum_Sampler_h -#define Magnum_Sampler_h +#ifndef Magnum_GL_Sampler_h +#define Magnum_GL_Sampler_h /* This file is part of Magnum. @@ -30,8 +30,8 @@ */ #include "Magnum/Magnum.h" -#include "Magnum/OpenGL.h" -#include "Magnum/visibility.h" +#include "Magnum/GL/OpenGL.h" +#include "Magnum/GL/visibility.h" namespace Magnum { @@ -41,7 +41,7 @@ namespace Magnum { @see @ref Texture, @ref TextureArray, @ref CubeMapTexture, @ref CubeMapTextureArray, @ref RectangleTexture */ -class MAGNUM_EXPORT Sampler { +class MAGNUM_GL_EXPORT Sampler { public: /** * @brief Texture filtering @@ -276,25 +276,25 @@ class MAGNUM_EXPORT Sampler { }; /** @debugoperatorclassenum{Magnum::Sampler,Magnum::Sampler::Filter} */ -MAGNUM_EXPORT Debug& operator<<(Debug& debug, Sampler::Filter value); +MAGNUM_GL_EXPORT Debug& operator<<(Debug& debug, Sampler::Filter value); /** @debugoperatorclassenum{Magnum::Sampler,Magnum::Sampler::Mipmap} */ -MAGNUM_EXPORT Debug& operator<<(Debug& debug, Sampler::Mipmap value); +MAGNUM_GL_EXPORT Debug& operator<<(Debug& debug, Sampler::Mipmap value); /** @debugoperatorclassenum{Magnum::Sampler,Magnum::Sampler::Wrapping} */ -MAGNUM_EXPORT Debug& operator<<(Debug& debug, Sampler::Wrapping value); +MAGNUM_GL_EXPORT Debug& operator<<(Debug& debug, Sampler::Wrapping value); #if !(defined(MAGNUM_TARGET_WEBGL) && defined(MAGNUM_TARGET_GLES2)) /** @debugoperatorclassenum{Magnum::Sampler,Magnum::Sampler::CompareMode} */ -MAGNUM_EXPORT Debug& operator<<(Debug& debug, Sampler::CompareMode value); +MAGNUM_GL_EXPORT Debug& operator<<(Debug& debug, Sampler::CompareMode value); /** @debugoperatorclassenum{Magnum::Sampler,Magnum::Sampler::CompareFunction} */ -MAGNUM_EXPORT Debug& operator<<(Debug& debug, Sampler::CompareFunction value); +MAGNUM_GL_EXPORT Debug& operator<<(Debug& debug, Sampler::CompareFunction value); #endif #ifndef MAGNUM_TARGET_GLES /** @debugoperatorclassenum{Magnum::Sampler,Magnum::Sampler::DepthStencilMode} */ -MAGNUM_EXPORT Debug& operator<<(Debug& debug, Sampler::DepthStencilMode value); +MAGNUM_GL_EXPORT Debug& operator<<(Debug& debug, Sampler::DepthStencilMode value); #endif } diff --git a/src/Magnum/Shader.cpp b/src/Magnum/GL/Shader.cpp similarity index 99% rename from src/Magnum/Shader.cpp rename to src/Magnum/GL/Shader.cpp index 10eb7239c..516003328 100644 --- a/src/Magnum/Shader.cpp +++ b/src/Magnum/GL/Shader.cpp @@ -30,14 +30,13 @@ #include #include -#include "Magnum/Context.h" -#include "Magnum/Extensions.h" - +#include "Magnum/GL/Context.h" +#include "Magnum/GL/Extensions.h" #ifndef MAGNUM_TARGET_WEBGL -#include "Implementation/DebugState.h" +#include "Magnum/GL/Implementation/DebugState.h" #endif -#include "Implementation/State.h" -#include "Implementation/ShaderState.h" +#include "Magnum/GL/Implementation/State.h" +#include "Magnum/GL/Implementation/ShaderState.h" /* libgles-omap3-dev_4.03.00.02-r15.6 on BeagleBoard/Ångström linux 2011.3 doesn't have GLchar */ #ifdef MAGNUM_TARGET_GLES diff --git a/src/Magnum/Shader.h b/src/Magnum/GL/Shader.h similarity index 98% rename from src/Magnum/Shader.h rename to src/Magnum/GL/Shader.h index 1e9a6dd80..55055fb13 100644 --- a/src/Magnum/Shader.h +++ b/src/Magnum/GL/Shader.h @@ -1,5 +1,5 @@ -#ifndef Magnum_Shader_h -#define Magnum_Shader_h +#ifndef Magnum_GL_Shader_h +#define Magnum_GL_Shader_h /* This file is part of Magnum. @@ -34,8 +34,8 @@ #include #include -#include "Magnum/AbstractObject.h" -#include "Magnum/Magnum.h" +#include "Magnum/GL/AbstractObject.h" +#include "Magnum/GL/GL.h" namespace Magnum { @@ -51,7 +51,7 @@ See @ref AbstractShaderProgram for usage information. Shader limits and implementation-defined values (such as @ref maxUniformComponents()) are cached, so repeated queries don't result in repeated @fn_gl{Get} calls. */ -class MAGNUM_EXPORT Shader: public AbstractObject { +class MAGNUM_GL_EXPORT Shader: public AbstractObject { friend Implementation::ShaderState; public: @@ -619,9 +619,9 @@ class MAGNUM_EXPORT Shader: public AbstractObject { private: Shader& setLabelInternal(Containers::ArrayView label); - void MAGNUM_LOCAL addSourceImplementationDefault(std::string source); + void MAGNUM_GL_LOCAL addSourceImplementationDefault(std::string source); #if defined(CORRADE_TARGET_EMSCRIPTEN) && defined(__EMSCRIPTEN_PTHREADS__) - void MAGNUM_LOCAL addSourceImplementationEmscriptenPthread(std::string source); + void MAGNUM_GL_LOCAL addSourceImplementationEmscriptenPthread(std::string source); #endif Type _type; @@ -631,7 +631,7 @@ class MAGNUM_EXPORT Shader: public AbstractObject { }; /** @debugoperatorclassenum{Magnum::Shader,Magnum::Shader::Type} */ -MAGNUM_EXPORT Debug& operator<<(Debug& debug, Shader::Type value); +MAGNUM_GL_EXPORT Debug& operator<<(Debug& debug, Shader::Type value); inline Shader::Shader(Shader&& other) noexcept: _type(other._type), _id(other._id), _sources(std::move(other._sources)) { other._id = 0; diff --git a/src/Magnum/Test/AbstractObjectGLTest.cpp b/src/Magnum/GL/Test/AbstractObjectGLTest.cpp similarity index 100% rename from src/Magnum/Test/AbstractObjectGLTest.cpp rename to src/Magnum/GL/Test/AbstractObjectGLTest.cpp diff --git a/src/Magnum/Test/AbstractQueryGLTest.cpp b/src/Magnum/GL/Test/AbstractQueryGLTest.cpp similarity index 100% rename from src/Magnum/Test/AbstractQueryGLTest.cpp rename to src/Magnum/GL/Test/AbstractQueryGLTest.cpp diff --git a/src/Magnum/Test/AbstractShaderProgramGLTest.cpp b/src/Magnum/GL/Test/AbstractShaderProgramGLTest.cpp similarity index 100% rename from src/Magnum/Test/AbstractShaderProgramGLTest.cpp rename to src/Magnum/GL/Test/AbstractShaderProgramGLTest.cpp diff --git a/src/Magnum/Test/AbstractShaderProgramGLTestFiles/ComputeShader.comp b/src/Magnum/GL/Test/AbstractShaderProgramGLTestFiles/ComputeShader.comp similarity index 100% rename from src/Magnum/Test/AbstractShaderProgramGLTestFiles/ComputeShader.comp rename to src/Magnum/GL/Test/AbstractShaderProgramGLTestFiles/ComputeShader.comp diff --git a/src/Magnum/Test/AbstractShaderProgramGLTestFiles/MyShader.frag b/src/Magnum/GL/Test/AbstractShaderProgramGLTestFiles/MyShader.frag similarity index 100% rename from src/Magnum/Test/AbstractShaderProgramGLTestFiles/MyShader.frag rename to src/Magnum/GL/Test/AbstractShaderProgramGLTestFiles/MyShader.frag diff --git a/src/Magnum/Test/AbstractShaderProgramGLTestFiles/MyShader.vert b/src/Magnum/GL/Test/AbstractShaderProgramGLTestFiles/MyShader.vert similarity index 100% rename from src/Magnum/Test/AbstractShaderProgramGLTestFiles/MyShader.vert rename to src/Magnum/GL/Test/AbstractShaderProgramGLTestFiles/MyShader.vert diff --git a/src/Magnum/Test/AbstractShaderProgramGLTestFiles/MyShaderFragmentOutputs.frag b/src/Magnum/GL/Test/AbstractShaderProgramGLTestFiles/MyShaderFragmentOutputs.frag similarity index 100% rename from src/Magnum/Test/AbstractShaderProgramGLTestFiles/MyShaderFragmentOutputs.frag rename to src/Magnum/GL/Test/AbstractShaderProgramGLTestFiles/MyShaderFragmentOutputs.frag diff --git a/src/Magnum/Test/AbstractShaderProgramGLTestFiles/UniformBlockShader.frag b/src/Magnum/GL/Test/AbstractShaderProgramGLTestFiles/UniformBlockShader.frag similarity index 100% rename from src/Magnum/Test/AbstractShaderProgramGLTestFiles/UniformBlockShader.frag rename to src/Magnum/GL/Test/AbstractShaderProgramGLTestFiles/UniformBlockShader.frag diff --git a/src/Magnum/Test/AbstractShaderProgramGLTestFiles/UniformBlockShader.vert b/src/Magnum/GL/Test/AbstractShaderProgramGLTestFiles/UniformBlockShader.vert similarity index 100% rename from src/Magnum/Test/AbstractShaderProgramGLTestFiles/UniformBlockShader.vert rename to src/Magnum/GL/Test/AbstractShaderProgramGLTestFiles/UniformBlockShader.vert diff --git a/src/Magnum/Test/AbstractShaderProgramGLTestFiles/resources.conf b/src/Magnum/GL/Test/AbstractShaderProgramGLTestFiles/resources.conf similarity index 100% rename from src/Magnum/Test/AbstractShaderProgramGLTestFiles/resources.conf rename to src/Magnum/GL/Test/AbstractShaderProgramGLTestFiles/resources.conf diff --git a/src/Magnum/Test/AbstractShaderProgramTest.cpp b/src/Magnum/GL/Test/AbstractShaderProgramTest.cpp similarity index 100% rename from src/Magnum/Test/AbstractShaderProgramTest.cpp rename to src/Magnum/GL/Test/AbstractShaderProgramTest.cpp diff --git a/src/Magnum/Test/AbstractTextureGLTest.cpp b/src/Magnum/GL/Test/AbstractTextureGLTest.cpp similarity index 100% rename from src/Magnum/Test/AbstractTextureGLTest.cpp rename to src/Magnum/GL/Test/AbstractTextureGLTest.cpp diff --git a/src/Magnum/Test/AttributeTest.cpp b/src/Magnum/GL/Test/AttributeTest.cpp similarity index 100% rename from src/Magnum/Test/AttributeTest.cpp rename to src/Magnum/GL/Test/AttributeTest.cpp diff --git a/src/Magnum/Test/BufferGLTest.cpp b/src/Magnum/GL/Test/BufferGLTest.cpp similarity index 100% rename from src/Magnum/Test/BufferGLTest.cpp rename to src/Magnum/GL/Test/BufferGLTest.cpp diff --git a/src/Magnum/Test/BufferImageGLTest.cpp b/src/Magnum/GL/Test/BufferImageGLTest.cpp similarity index 100% rename from src/Magnum/Test/BufferImageGLTest.cpp rename to src/Magnum/GL/Test/BufferImageGLTest.cpp diff --git a/src/Magnum/Test/BufferImageTest.cpp b/src/Magnum/GL/Test/BufferImageTest.cpp similarity index 100% rename from src/Magnum/Test/BufferImageTest.cpp rename to src/Magnum/GL/Test/BufferImageTest.cpp diff --git a/src/Magnum/Test/BufferTest.cpp b/src/Magnum/GL/Test/BufferTest.cpp similarity index 100% rename from src/Magnum/Test/BufferTest.cpp rename to src/Magnum/GL/Test/BufferTest.cpp diff --git a/src/Magnum/Test/BufferTextureGLTest.cpp b/src/Magnum/GL/Test/BufferTextureGLTest.cpp similarity index 100% rename from src/Magnum/Test/BufferTextureGLTest.cpp rename to src/Magnum/GL/Test/BufferTextureGLTest.cpp diff --git a/src/Magnum/Test/BufferTextureTest.cpp b/src/Magnum/GL/Test/BufferTextureTest.cpp similarity index 100% rename from src/Magnum/Test/BufferTextureTest.cpp rename to src/Magnum/GL/Test/BufferTextureTest.cpp diff --git a/src/Magnum/GL/Test/CMakeLists.txt b/src/Magnum/GL/Test/CMakeLists.txt new file mode 100644 index 000000000..b32e23547 --- /dev/null +++ b/src/Magnum/GL/Test/CMakeLists.txt @@ -0,0 +1,205 @@ +# +# This file is part of Magnum. +# +# Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018 +# Vladimír Vondruš +# +# Permission is hereby granted, free of charge, to any person obtaining a +# copy of this software and associated documentation files (the "Software"), +# to deal in the Software without restriction, including without limitation +# the rights to use, copy, modify, merge, publish, distribute, sublicense, +# and/or sell copies of the Software, and to permit persons to whom the +# Software is furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included +# in all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +# DEALINGS IN THE SOFTWARE. +# + +corrade_add_test(GLAttributeTest AttributeTest.cpp LIBRARIES MagnumGL) +corrade_add_test(GLAbstractShaderProgramTest AbstractShaderProgramTest.cpp LIBRARIES MagnumGL) +corrade_add_test(GLBufferTest BufferTest.cpp LIBRARIES MagnumGL) +corrade_add_test(GLFormatTest FormatTest.cpp LIBRARIES MagnumGL) +corrade_add_test(GLContextTest ContextTest.cpp LIBRARIES MagnumGL) +corrade_add_test(GLCubeMapTextureTest CubeMapTextureTest.cpp LIBRARIES MagnumGL) +corrade_add_test(GLDefaultFramebufferTest DefaultFramebufferTest.cpp LIBRARIES MagnumGL) +corrade_add_test(GLFramebufferTest FramebufferTest.cpp LIBRARIES MagnumGL) +corrade_add_test(GLImageTest ../../Test/ImageTest.cpp LIBRARIES MagnumGL) # temporary +corrade_add_test(GLImageViewTest ../../Test/ImageViewTest.cpp LIBRARIES MagnumGL) # temporary +corrade_add_test(GLMeshTest MeshTest.cpp LIBRARIES MagnumGL) +corrade_add_test(GLPixelStorageTest ../../Test/PixelStorageTest.cpp LIBRARIES MagnumGL) # temporary +corrade_add_test(GLRendererTest RendererTest.cpp LIBRARIES MagnumGL) +corrade_add_test(GLRenderbufferTest RenderbufferTest.cpp LIBRARIES MagnumGL) +corrade_add_test(GLSamplerTest SamplerTest.cpp LIBRARIES MagnumGL) +corrade_add_test(GLShaderTest ShaderTest.cpp LIBRARIES MagnumGL) +corrade_add_test(GLTextureTest TextureTest.cpp LIBRARIES MagnumGL) +corrade_add_test(GLVersionTest VersionTest.cpp LIBRARIES MagnumGL) + +set_target_properties( + GLAttributeTest + GLAbstractShaderProgramTest + GLBufferTest + GLFormatTest + GLContextTest + GLCubeMapTextureTest + GLDefaultFramebufferTest + GLFramebufferTest + GLImageTest + GLImageViewTest + GLMeshTest + GLPixelStorageTest + GLRendererTest + GLRenderbufferTest + GLSamplerTest + GLShaderTest + GLTextureTest + GLVersionTest + PROPERTIES FOLDER "Magnum/GL/Test") + +if(NOT MAGNUM_TARGET_WEBGL) + corrade_add_test(GLDebugOutputTest DebugOutputTest.cpp LIBRARIES MagnumGL) + set_target_properties(GLDebugOutputTest PROPERTIES FOLDER "Magnum/GL/Test") +endif() + +if(NOT MAGNUM_TARGET_GLES2) + corrade_add_test(GLBufferImageTest BufferImageTest.cpp LIBRARIES MagnumGL) + corrade_add_test(GLPrimitiveQueryTest PrimitiveQueryTest.cpp LIBRARIES MagnumGL) + corrade_add_test(GLTextureArrayTest TextureArrayTest.cpp LIBRARIES MagnumGL) + corrade_add_test(GLTransformFeedbackTest TransformFeedbackTest.cpp LIBRARIES MagnumGL) + + set_target_properties( + GLBufferImageTest + GLPrimitiveQueryTest + GLTextureArrayTest + GLTransformFeedbackTest + PROPERTIES FOLDER "Magnum/GL/Test") +endif() + +if(NOT MAGNUM_TARGET_GLES2 AND NOT MAGNUM_TARGET_WEBGL) + corrade_add_test(GLBufferTextureTest BufferTextureTest.cpp LIBRARIES MagnumGL) + corrade_add_test(GLCubeMapTextureArrayTest CubeMapTextureArrayTest.cpp LIBRARIES MagnumGL) + corrade_add_test(GLMultisampleTextureTest MultisampleTextureTest.cpp LIBRARIES MagnumGL) + + set_target_properties( + GLBufferTextureTest + GLCubeMapTextureArrayTest + GLMultisampleTextureTest + PROPERTIES FOLDER "Magnum/GL/Test") +endif() + +if(NOT (MAGNUM_TARGET_WEBGL AND MAGNUM_TARGET_GLES2)) + corrade_add_test(GLSampleQueryTest SampleQueryTest.cpp LIBRARIES MagnumGL) + set_target_properties(GLSampleQueryTest PROPERTIES FOLDER "Magnum/GL/Test") +endif() + +if(NOT MAGNUM_TARGET_WEBGL) + corrade_add_test(GLTimeQueryTest TimeQueryTest.cpp LIBRARIES MagnumGL) + set_target_properties(GLTimeQueryTest PROPERTIES FOLDER "Magnum/GL/Test") +endif() + +if(NOT MAGNUM_TARGET_GLES) + corrade_add_test(GLRectangleTextureTest RectangleTextureTest.cpp LIBRARIES MagnumGL) + set_target_properties(GLRectangleTextureTest PROPERTIES FOLDER "Magnum/GL/Test") +endif() + +if(BUILD_GL_TESTS) + corrade_add_test(GLAbstractTextureGLTest AbstractTextureGLTest.cpp LIBRARIES MagnumOpenGLTester) + corrade_add_test(GLBufferGLTest BufferGLTest.cpp LIBRARIES MagnumOpenGLTester) + corrade_add_test(GLContextGLTest ContextGLTest.cpp LIBRARIES MagnumOpenGLTester) + corrade_add_test(GLCubeMapTextureGLTest CubeMapTextureGLTest.cpp LIBRARIES MagnumOpenGLTester) + corrade_add_test(GLFramebufferGLTest FramebufferGLTest.cpp LIBRARIES MagnumOpenGLTester) + corrade_add_test(GLMeshGLTest MeshGLTest.cpp LIBRARIES MagnumOpenGLTester) + corrade_add_test(GLRenderbufferGLTest RenderbufferGLTest.cpp LIBRARIES MagnumOpenGLTester) + corrade_add_test(GLTextureGLTest TextureGLTest.cpp LIBRARIES MagnumOpenGLTester) + + corrade_add_resource(GLAbstractShaderProgramGLTest_RES AbstractShaderProgramGLTestFiles/resources.conf) + corrade_add_test(GLAbstractShaderProgramGLTest + AbstractShaderProgramGLTest.cpp + ${GLAbstractShaderProgramGLTest_RES} + LIBRARIES MagnumOpenGLTester) + + if(CORRADE_TARGET_EMSCRIPTEN OR CORRADE_TARGET_ANDROID) + set(SHADERGLTEST_FILES_DIR "ShaderGLTestFiles") + else() + set(SHADERGLTEST_FILES_DIR ${CMAKE_CURRENT_SOURCE_DIR}/ShaderGLTestFiles) + endif() + + configure_file(${CMAKE_CURRENT_SOURCE_DIR}/configure.h.cmake + ${CMAKE_CURRENT_BINARY_DIR}/configure.h) + corrade_add_test(GLShaderGLTest ShaderGLTest.cpp + LIBRARIES MagnumOpenGLTester + FILES ShaderGLTestFiles/shader.glsl) + target_include_directories(GLShaderGLTest PRIVATE ${CMAKE_CURRENT_BINARY_DIR}) + + set_target_properties( + GLAbstractTextureGLTest + GLBufferGLTest + GLContextGLTest + GLCubeMapTextureGLTest + GLFramebufferGLTest + GLMeshGLTest + GLRenderbufferGLTest + GLTextureGLTest + + GLAbstractShaderProgramGLTest + GLAbstractShaderProgramGLTest_RES-dependencies + + GLShaderGLTest + PROPERTIES FOLDER "Magnum/GL/Test") + + if(NOT MAGNUM_TARGET_WEBGL) + corrade_add_test(GLAbstractObjectGLTest AbstractObjectGLTest.cpp LIBRARIES MagnumOpenGLTester) + corrade_add_test(GLDebugOutputGLTest DebugOutputGLTest.cpp LIBRARIES MagnumOpenGLTester) + + set_target_properties( + GLAbstractObjectGLTest + GLDebugOutputGLTest + PROPERTIES FOLDER "Magnum/GL/Test") + endif() + + if(NOT (MAGNUM_TARGET_WEBGL AND MAGNUM_TARGET_GLES2)) + corrade_add_test(GLAbstractQueryGLTest AbstractQueryGLTest.cpp LIBRARIES MagnumOpenGLTester) + corrade_add_test(GLPixelStorageGLTest PixelStorageGLTest.cpp LIBRARIES MagnumOpenGLTester) + corrade_add_test(GLSampleQueryGLTest SampleQueryGLTest.cpp LIBRARIES MagnumOpenGLTester) + corrade_add_test(GLTimeQueryGLTest TimeQueryGLTest.cpp LIBRARIES MagnumOpenGLTester) + + set_target_properties( + GLAbstractQueryGLTest + GLPixelStorageGLTest + GLSampleQueryGLTest + GLTimeQueryGLTest + PROPERTIES FOLDER "Magnum/GL/Test") + endif() + + if(NOT MAGNUM_TARGET_GLES2) + corrade_add_test(GLBufferImageGLTest BufferImageGLTest.cpp LIBRARIES MagnumOpenGLTester) + corrade_add_test(GLBufferTextureGLTest BufferTextureGLTest.cpp LIBRARIES MagnumOpenGLTester) + corrade_add_test(GLCubeMapTextureArrayGLTest CubeMapTextureArrayGLTest.cpp LIBRARIES MagnumOpenGLTester) + corrade_add_test(GLMultisampleTextureGLTest MultisampleTextureGLTest.cpp LIBRARIES MagnumOpenGLTester) + corrade_add_test(GLPrimitiveQueryGLTest PrimitiveQueryGLTest.cpp LIBRARIES MagnumOpenGLTester) + corrade_add_test(GLTextureArrayGLTest TextureArrayGLTest.cpp LIBRARIES MagnumOpenGLTester) + corrade_add_test(GLTransformFeedbackGLTest TransformFeedbackGLTest.cpp LIBRARIES MagnumOpenGLTester) + + set_target_properties( + GLBufferImageGLTest + GLBufferTextureGLTest + GLCubeMapTextureArrayGLTest + GLMultisampleTextureGLTest + GLPrimitiveQueryGLTest + GLTextureArrayGLTest + GLTransformFeedbackGLTest + PROPERTIES FOLDER "Magnum/GL/Test") + endif() + + if(NOT MAGNUM_TARGET_GLES) + corrade_add_test(GLRectangleTextureGLTest RectangleTextureGLTest.cpp LIBRARIES MagnumOpenGLTester) + set_target_properties(GLRectangleTextureGLTest PROPERTIES FOLDER "Magnum/GL/Test") + endif() +endif() diff --git a/src/Magnum/Test/ContextGLTest.cpp b/src/Magnum/GL/Test/ContextGLTest.cpp similarity index 100% rename from src/Magnum/Test/ContextGLTest.cpp rename to src/Magnum/GL/Test/ContextGLTest.cpp diff --git a/src/Magnum/Test/ContextTest.cpp b/src/Magnum/GL/Test/ContextTest.cpp similarity index 100% rename from src/Magnum/Test/ContextTest.cpp rename to src/Magnum/GL/Test/ContextTest.cpp diff --git a/src/Magnum/Test/CubeMapTextureArrayGLTest.cpp b/src/Magnum/GL/Test/CubeMapTextureArrayGLTest.cpp similarity index 100% rename from src/Magnum/Test/CubeMapTextureArrayGLTest.cpp rename to src/Magnum/GL/Test/CubeMapTextureArrayGLTest.cpp diff --git a/src/Magnum/Test/CubeMapTextureArrayTest.cpp b/src/Magnum/GL/Test/CubeMapTextureArrayTest.cpp similarity index 100% rename from src/Magnum/Test/CubeMapTextureArrayTest.cpp rename to src/Magnum/GL/Test/CubeMapTextureArrayTest.cpp diff --git a/src/Magnum/Test/CubeMapTextureGLTest.cpp b/src/Magnum/GL/Test/CubeMapTextureGLTest.cpp similarity index 100% rename from src/Magnum/Test/CubeMapTextureGLTest.cpp rename to src/Magnum/GL/Test/CubeMapTextureGLTest.cpp diff --git a/src/Magnum/Test/CubeMapTextureTest.cpp b/src/Magnum/GL/Test/CubeMapTextureTest.cpp similarity index 100% rename from src/Magnum/Test/CubeMapTextureTest.cpp rename to src/Magnum/GL/Test/CubeMapTextureTest.cpp diff --git a/src/Magnum/Test/DebugOutputGLTest.cpp b/src/Magnum/GL/Test/DebugOutputGLTest.cpp similarity index 100% rename from src/Magnum/Test/DebugOutputGLTest.cpp rename to src/Magnum/GL/Test/DebugOutputGLTest.cpp diff --git a/src/Magnum/Test/DebugOutputTest.cpp b/src/Magnum/GL/Test/DebugOutputTest.cpp similarity index 100% rename from src/Magnum/Test/DebugOutputTest.cpp rename to src/Magnum/GL/Test/DebugOutputTest.cpp diff --git a/src/Magnum/Test/DefaultFramebufferTest.cpp b/src/Magnum/GL/Test/DefaultFramebufferTest.cpp similarity index 100% rename from src/Magnum/Test/DefaultFramebufferTest.cpp rename to src/Magnum/GL/Test/DefaultFramebufferTest.cpp diff --git a/src/Magnum/Test/FormatTest.cpp b/src/Magnum/GL/Test/FormatTest.cpp similarity index 100% rename from src/Magnum/Test/FormatTest.cpp rename to src/Magnum/GL/Test/FormatTest.cpp diff --git a/src/Magnum/Test/FramebufferGLTest.cpp b/src/Magnum/GL/Test/FramebufferGLTest.cpp similarity index 100% rename from src/Magnum/Test/FramebufferGLTest.cpp rename to src/Magnum/GL/Test/FramebufferGLTest.cpp diff --git a/src/Magnum/Test/FramebufferTest.cpp b/src/Magnum/GL/Test/FramebufferTest.cpp similarity index 100% rename from src/Magnum/Test/FramebufferTest.cpp rename to src/Magnum/GL/Test/FramebufferTest.cpp diff --git a/src/Magnum/Test/MeshGLTest.cpp b/src/Magnum/GL/Test/MeshGLTest.cpp similarity index 100% rename from src/Magnum/Test/MeshGLTest.cpp rename to src/Magnum/GL/Test/MeshGLTest.cpp diff --git a/src/Magnum/Test/MeshTest.cpp b/src/Magnum/GL/Test/MeshTest.cpp similarity index 100% rename from src/Magnum/Test/MeshTest.cpp rename to src/Magnum/GL/Test/MeshTest.cpp diff --git a/src/Magnum/Test/MultisampleTextureGLTest.cpp b/src/Magnum/GL/Test/MultisampleTextureGLTest.cpp similarity index 100% rename from src/Magnum/Test/MultisampleTextureGLTest.cpp rename to src/Magnum/GL/Test/MultisampleTextureGLTest.cpp diff --git a/src/Magnum/Test/MultisampleTextureTest.cpp b/src/Magnum/GL/Test/MultisampleTextureTest.cpp similarity index 100% rename from src/Magnum/Test/MultisampleTextureTest.cpp rename to src/Magnum/GL/Test/MultisampleTextureTest.cpp diff --git a/src/Magnum/Test/PixelStorageGLTest.cpp b/src/Magnum/GL/Test/PixelStorageGLTest.cpp similarity index 100% rename from src/Magnum/Test/PixelStorageGLTest.cpp rename to src/Magnum/GL/Test/PixelStorageGLTest.cpp diff --git a/src/Magnum/Test/PrimitiveQueryGLTest.cpp b/src/Magnum/GL/Test/PrimitiveQueryGLTest.cpp similarity index 100% rename from src/Magnum/Test/PrimitiveQueryGLTest.cpp rename to src/Magnum/GL/Test/PrimitiveQueryGLTest.cpp diff --git a/src/Magnum/Test/PrimitiveQueryTest.cpp b/src/Magnum/GL/Test/PrimitiveQueryTest.cpp similarity index 100% rename from src/Magnum/Test/PrimitiveQueryTest.cpp rename to src/Magnum/GL/Test/PrimitiveQueryTest.cpp diff --git a/src/Magnum/Test/RectangleTextureGLTest.cpp b/src/Magnum/GL/Test/RectangleTextureGLTest.cpp similarity index 100% rename from src/Magnum/Test/RectangleTextureGLTest.cpp rename to src/Magnum/GL/Test/RectangleTextureGLTest.cpp diff --git a/src/Magnum/Test/RectangleTextureTest.cpp b/src/Magnum/GL/Test/RectangleTextureTest.cpp similarity index 100% rename from src/Magnum/Test/RectangleTextureTest.cpp rename to src/Magnum/GL/Test/RectangleTextureTest.cpp diff --git a/src/Magnum/Test/RenderbufferGLTest.cpp b/src/Magnum/GL/Test/RenderbufferGLTest.cpp similarity index 100% rename from src/Magnum/Test/RenderbufferGLTest.cpp rename to src/Magnum/GL/Test/RenderbufferGLTest.cpp diff --git a/src/Magnum/Test/RenderbufferTest.cpp b/src/Magnum/GL/Test/RenderbufferTest.cpp similarity index 100% rename from src/Magnum/Test/RenderbufferTest.cpp rename to src/Magnum/GL/Test/RenderbufferTest.cpp diff --git a/src/Magnum/Test/RendererTest.cpp b/src/Magnum/GL/Test/RendererTest.cpp similarity index 100% rename from src/Magnum/Test/RendererTest.cpp rename to src/Magnum/GL/Test/RendererTest.cpp diff --git a/src/Magnum/Test/SampleQueryGLTest.cpp b/src/Magnum/GL/Test/SampleQueryGLTest.cpp similarity index 100% rename from src/Magnum/Test/SampleQueryGLTest.cpp rename to src/Magnum/GL/Test/SampleQueryGLTest.cpp diff --git a/src/Magnum/Test/SampleQueryTest.cpp b/src/Magnum/GL/Test/SampleQueryTest.cpp similarity index 100% rename from src/Magnum/Test/SampleQueryTest.cpp rename to src/Magnum/GL/Test/SampleQueryTest.cpp diff --git a/src/Magnum/Test/SamplerTest.cpp b/src/Magnum/GL/Test/SamplerTest.cpp similarity index 100% rename from src/Magnum/Test/SamplerTest.cpp rename to src/Magnum/GL/Test/SamplerTest.cpp diff --git a/src/Magnum/Test/ShaderGLTest.cpp b/src/Magnum/GL/Test/ShaderGLTest.cpp similarity index 100% rename from src/Magnum/Test/ShaderGLTest.cpp rename to src/Magnum/GL/Test/ShaderGLTest.cpp diff --git a/src/Magnum/Test/ShaderGLTestFiles/.gitattributes b/src/Magnum/GL/Test/ShaderGLTestFiles/.gitattributes similarity index 100% rename from src/Magnum/Test/ShaderGLTestFiles/.gitattributes rename to src/Magnum/GL/Test/ShaderGLTestFiles/.gitattributes diff --git a/src/Magnum/Test/ShaderGLTestFiles/shader.glsl b/src/Magnum/GL/Test/ShaderGLTestFiles/shader.glsl similarity index 100% rename from src/Magnum/Test/ShaderGLTestFiles/shader.glsl rename to src/Magnum/GL/Test/ShaderGLTestFiles/shader.glsl diff --git a/src/Magnum/Test/ShaderTest.cpp b/src/Magnum/GL/Test/ShaderTest.cpp similarity index 100% rename from src/Magnum/Test/ShaderTest.cpp rename to src/Magnum/GL/Test/ShaderTest.cpp diff --git a/src/Magnum/Test/TextureArrayGLTest.cpp b/src/Magnum/GL/Test/TextureArrayGLTest.cpp similarity index 100% rename from src/Magnum/Test/TextureArrayGLTest.cpp rename to src/Magnum/GL/Test/TextureArrayGLTest.cpp diff --git a/src/Magnum/Test/TextureArrayTest.cpp b/src/Magnum/GL/Test/TextureArrayTest.cpp similarity index 100% rename from src/Magnum/Test/TextureArrayTest.cpp rename to src/Magnum/GL/Test/TextureArrayTest.cpp diff --git a/src/Magnum/Test/TextureGLTest.cpp b/src/Magnum/GL/Test/TextureGLTest.cpp similarity index 100% rename from src/Magnum/Test/TextureGLTest.cpp rename to src/Magnum/GL/Test/TextureGLTest.cpp diff --git a/src/Magnum/Test/TextureTest.cpp b/src/Magnum/GL/Test/TextureTest.cpp similarity index 100% rename from src/Magnum/Test/TextureTest.cpp rename to src/Magnum/GL/Test/TextureTest.cpp diff --git a/src/Magnum/Test/TimeQueryGLTest.cpp b/src/Magnum/GL/Test/TimeQueryGLTest.cpp similarity index 100% rename from src/Magnum/Test/TimeQueryGLTest.cpp rename to src/Magnum/GL/Test/TimeQueryGLTest.cpp diff --git a/src/Magnum/Test/TimeQueryTest.cpp b/src/Magnum/GL/Test/TimeQueryTest.cpp similarity index 100% rename from src/Magnum/Test/TimeQueryTest.cpp rename to src/Magnum/GL/Test/TimeQueryTest.cpp diff --git a/src/Magnum/Test/TransformFeedbackGLTest.cpp b/src/Magnum/GL/Test/TransformFeedbackGLTest.cpp similarity index 100% rename from src/Magnum/Test/TransformFeedbackGLTest.cpp rename to src/Magnum/GL/Test/TransformFeedbackGLTest.cpp diff --git a/src/Magnum/Test/TransformFeedbackTest.cpp b/src/Magnum/GL/Test/TransformFeedbackTest.cpp similarity index 100% rename from src/Magnum/Test/TransformFeedbackTest.cpp rename to src/Magnum/GL/Test/TransformFeedbackTest.cpp diff --git a/src/Magnum/Test/VersionTest.cpp b/src/Magnum/GL/Test/VersionTest.cpp similarity index 100% rename from src/Magnum/Test/VersionTest.cpp rename to src/Magnum/GL/Test/VersionTest.cpp diff --git a/src/Magnum/Test/configure.h.cmake b/src/Magnum/GL/Test/configure.h.cmake similarity index 100% rename from src/Magnum/Test/configure.h.cmake rename to src/Magnum/GL/Test/configure.h.cmake diff --git a/src/Magnum/Texture.cpp b/src/Magnum/GL/Texture.cpp similarity index 87% rename from src/Magnum/Texture.cpp rename to src/Magnum/GL/Texture.cpp index db27aa7d6..cc0043662 100644 --- a/src/Magnum/Texture.cpp +++ b/src/Magnum/GL/Texture.cpp @@ -25,18 +25,17 @@ #include "Texture.h" -#include "Magnum/Context.h" -#include "Magnum/Extensions.h" +#include "Magnum/GL/Context.h" +#include "Magnum/GL/Extensions.h" +#include "Magnum/GL/Implementation/maxTextureSize.h" +#include "Magnum/GL/Implementation/State.h" +#include "Magnum/GL/Implementation/TextureState.h" #ifndef MAGNUM_TARGET_GLES -#include "Magnum/BufferImage.h" #include "Magnum/Image.h" +#include "Magnum/GL/BufferImage.h" #endif -#include "Implementation/maxTextureSize.h" -#include "Implementation/State.h" -#include "Implementation/TextureState.h" - namespace Magnum { namespace Implementation { @@ -46,12 +45,12 @@ template VectorTypeFor maxTextureSize() } #ifndef MAGNUM_TARGET_GLES -template MAGNUM_EXPORT Math::Vector<1, Int> maxTextureSize<1>(); +template MAGNUM_GL_EXPORT Math::Vector<1, Int> maxTextureSize<1>(); #endif -template MAGNUM_EXPORT Vector2i maxTextureSize<2>(); +template MAGNUM_GL_EXPORT Vector2i maxTextureSize<2>(); #if !(defined(MAGNUM_TARGET_WEBGL) && defined(MAGNUM_TARGET_GLES2)) -template<> MAGNUM_EXPORT Vector3i maxTextureSize<3>() { +template<> MAGNUM_GL_EXPORT Vector3i maxTextureSize<3>() { #ifdef MAGNUM_TARGET_GLES2 if(!Context::current().isExtensionSupported()) return {}; @@ -103,9 +102,9 @@ template CompressedBufferImage Texture; -template class MAGNUM_EXPORT Texture<2>; -template class MAGNUM_EXPORT Texture<3>; +template class MAGNUM_GL_EXPORT Texture<1>; +template class MAGNUM_GL_EXPORT Texture<2>; +template class MAGNUM_GL_EXPORT Texture<3>; #endif } diff --git a/src/Magnum/Texture.h b/src/Magnum/GL/Texture.h similarity index 98% rename from src/Magnum/Texture.h rename to src/Magnum/GL/Texture.h index 07311e0c6..19cd18281 100644 --- a/src/Magnum/Texture.h +++ b/src/Magnum/GL/Texture.h @@ -1,5 +1,5 @@ -#ifndef Magnum_Texture_h -#define Magnum_Texture_h +#ifndef Magnum_GL_Texture_h +#define Magnum_GL_Texture_h /* This file is part of Magnum. @@ -29,9 +29,9 @@ * @brief Class @ref Magnum::Texture, typedef @ref Magnum::Texture1D, @ref Magnum::Texture2D, @ref Magnum::Texture3D */ -#include "Magnum/AbstractTexture.h" #include "Magnum/Array.h" #include "Magnum/DimensionTraits.h" +#include "Magnum/GL/AbstractTexture.h" #include "Magnum/Math/Vector3.h" namespace Magnum { @@ -53,7 +53,7 @@ namespace Implementation { #endif template VectorTypeFor maxTextureSize(); - template<> MAGNUM_EXPORT Vector3i maxTextureSize<3>(); + template<> MAGNUM_GL_EXPORT Vector3i maxTextureSize<3>(); } /** @@ -68,7 +68,7 @@ Common usage is to fully configure all texture parameters and then set the data from e.g. @ref Image. Example configuration of high quality texture with trilinear anisotropic filtering, i.e. the best you can ask for: -@snippet Magnum.cpp Texture-usage +@snippet MagnumGL.cpp Texture-usage @attention Note that default configuration is to use mipmaps. Be sure to either reduce mip level count using @ref setBaseLevel() and @ref setMaxLevel(), @@ -585,7 +585,7 @@ template class Texture: public AbstractTexture { * @cpp '1' @ce for zero and one, similarly as in the * @ref Math::swizzle() function. Example usage: * - * @snippet Magnum.cpp Texture-setSwizzle + * @snippet MagnumGL.cpp Texture-setSwizzle * * If neither @extension{ARB,direct_state_access} (part of OpenGL 4.5) * nor @extension{EXT,direct_state_access} desktop extension is @@ -783,7 +783,7 @@ template class Texture: public AbstractTexture { * * Convenience alternative to the above, example usage: * - * @snippet Magnum.cpp Texture-image1 + * @snippet MagnumGL.cpp Texture-image1 */ Image image(Int level, Image&& image); @@ -810,7 +810,7 @@ template class Texture: public AbstractTexture { * * Convenience alternative to the above, example usage: * - * @snippet Magnum.cpp Texture-image2 + * @snippet MagnumGL.cpp Texture-image2 */ BufferImage image(Int level, BufferImage&& image, BufferUsage usage); @@ -854,7 +854,7 @@ template class Texture: public AbstractTexture { * * Convenience alternative to the above, example usage: * - * @snippet Magnum.cpp Texture-compressedImage1 + * @snippet MagnumGL.cpp Texture-compressedImage1 */ CompressedImage compressedImage(Int level, CompressedImage&& image); @@ -881,7 +881,7 @@ template class Texture: public AbstractTexture { * * Convenience alternative to the above, example usage: * - * @snippet Magnum.cpp Texture-compressedImage2 + * @snippet MagnumGL.cpp Texture-compressedImage2 */ CompressedBufferImage compressedImage(Int level, CompressedBufferImage&& image, BufferUsage usage); @@ -909,7 +909,7 @@ template class Texture: public AbstractTexture { * * Convenience alternative to the above, example usage: * - * @snippet Magnum.cpp Texture-subImage1 + * @snippet MagnumGL.cpp Texture-subImage1 */ Image subImage(Int level, const RangeTypeFor& range, Image&& image); @@ -936,7 +936,7 @@ template class Texture: public AbstractTexture { * * Convenience alternative to the above, example usage: * - * @snippet Magnum.cpp Texture-subImage2 + * @snippet MagnumGL.cpp Texture-subImage2 */ BufferImage subImage(Int level, const RangeTypeFor& range, BufferImage&& image, BufferUsage usage); @@ -972,7 +972,7 @@ template class Texture: public AbstractTexture { * * Convenience alternative to the above, example usage: * - * @snippet Magnum.cpp Texture-compressedSubImage1 + * @snippet MagnumGL.cpp Texture-compressedSubImage1 */ CompressedImage compressedSubImage(Int level, const RangeTypeFor& range, CompressedImage&& image); @@ -1002,7 +1002,7 @@ template class Texture: public AbstractTexture { * * Convenience alternative to the above, example usage: * - * @snippet Magnum.cpp Texture-compressedSubImage2 + * @snippet MagnumGL.cpp Texture-compressedSubImage2 */ CompressedBufferImage compressedSubImage(Int level, const RangeTypeFor& range, CompressedBufferImage&& image, BufferUsage usage); #endif diff --git a/src/Magnum/TextureArray.cpp b/src/Magnum/GL/TextureArray.cpp similarity index 94% rename from src/Magnum/TextureArray.cpp rename to src/Magnum/GL/TextureArray.cpp index bbdc5a597..49807531a 100644 --- a/src/Magnum/TextureArray.cpp +++ b/src/Magnum/GL/TextureArray.cpp @@ -26,16 +26,15 @@ #include "TextureArray.h" #ifndef MAGNUM_TARGET_GLES2 -#include "Magnum/Context.h" -#include "Magnum/Extensions.h" +#include "Magnum/GL/Context.h" +#include "Magnum/GL/Extensions.h" +#include "Magnum/GL/Implementation/maxTextureSize.h" #ifndef MAGNUM_TARGET_GLES -#include "Magnum/BufferImage.h" #include "Magnum/Image.h" +#include "Magnum/GL/BufferImage.h" #endif -#include "Implementation/maxTextureSize.h" - namespace Magnum { namespace { @@ -97,9 +96,9 @@ template CompressedBufferImage TextureArra #endif #ifndef MAGNUM_TARGET_GLES -template class MAGNUM_EXPORT TextureArray<1>; +template class MAGNUM_GL_EXPORT TextureArray<1>; #endif -template class MAGNUM_EXPORT TextureArray<2>; +template class MAGNUM_GL_EXPORT TextureArray<2>; } #endif diff --git a/src/Magnum/TextureArray.h b/src/Magnum/GL/TextureArray.h similarity index 98% rename from src/Magnum/TextureArray.h rename to src/Magnum/GL/TextureArray.h index 1824f4096..264d8df1f 100644 --- a/src/Magnum/TextureArray.h +++ b/src/Magnum/GL/TextureArray.h @@ -1,5 +1,5 @@ -#ifndef Magnum_TextureArray_h -#define Magnum_TextureArray_h +#ifndef Magnum_GL_TextureArray_h +#define Magnum_GL_TextureArray_h /* This file is part of Magnum. @@ -31,9 +31,9 @@ */ #endif -#include "Magnum/AbstractTexture.h" #include "Magnum/Array.h" #include "Magnum/DimensionTraits.h" +#include "Magnum/GL/AbstractTexture.h" #include "Magnum/Math/Vector3.h" #ifndef MAGNUM_TARGET_GLES2 @@ -60,13 +60,13 @@ See @ref Texture documentation for introduction. Common usage is to fully configure all texture parameters and then set the data. Example configuration: -@snippet Magnum.cpp TextureArray-usage1 +@snippet MagnumGL.cpp TextureArray-usage1 It is often more convenient to first allocate the memory for all layers by calling @ref setStorage() and then specify each layer separately using @ref setSubImage(): -@snippet Magnum.cpp TextureArray-usage2 +@snippet MagnumGL.cpp TextureArray-usage2 In shader, the texture is used via @glsl sampler1DArray @ce / @glsl sampler2DArray @ce, @glsl sampler1DArrayShadow @ce / @glsl sampler1DArrayShadow @ce, @glsl isampler1DArray @ce @@ -480,7 +480,7 @@ template class TextureArray: public AbstractTexture { * * Convenience alternative to the above, example usage: * - * @snippet Magnum.cpp TextureArray-image1 + * @snippet MagnumGL.cpp TextureArray-image1 */ Image image(Int level, Image&& image); @@ -501,7 +501,7 @@ template class TextureArray: public AbstractTexture { * * Convenience alternative to the above, example usage: * - * @snippet Magnum.cpp TextureArray-image2 + * @snippet MagnumGL.cpp TextureArray-image2 */ BufferImage image(Int level, BufferImage&& image, BufferUsage usage); @@ -522,7 +522,7 @@ template class TextureArray: public AbstractTexture { * * Convenience alternative to the above, example usage: * - * @snippet Magnum.cpp TextureArray-compressedImage1 + * @snippet MagnumGL.cpp TextureArray-compressedImage1 */ CompressedImage compressedImage(Int level, CompressedImage&& image); @@ -543,7 +543,7 @@ template class TextureArray: public AbstractTexture { * * Convenience alternative to the above, example usage: * - * @snippet Magnum.cpp TextureArray-compressedImage2 + * @snippet MagnumGL.cpp TextureArray-compressedImage2 */ CompressedBufferImage compressedImage(Int level, CompressedBufferImage&& image, BufferUsage usage); @@ -565,7 +565,7 @@ template class TextureArray: public AbstractTexture { * * Convenience alternative to the above, example usage: * - * @snippet Magnum.cpp TextureArray-subImage1 + * @snippet MagnumGL.cpp TextureArray-subImage1 */ Image subImage(Int level, const RangeTypeFor& range, Image&& image); @@ -587,7 +587,7 @@ template class TextureArray: public AbstractTexture { * * Convenience alternative to the above, example usage: * - * @snippet Magnum.cpp TextureArray-subImage2 + * @snippet MagnumGL.cpp TextureArray-subImage2 */ BufferImage subImage(Int level, const RangeTypeFor& range, BufferImage&& image, BufferUsage usage); @@ -613,7 +613,7 @@ template class TextureArray: public AbstractTexture { * * Convenience alternative to the above, example usage: * - * @snippet Magnum.cpp TextureArray-compressedSubImage1 + * @snippet MagnumGL.cpp TextureArray-compressedSubImage1 */ CompressedImage compressedSubImage(Int level, const RangeTypeFor& range, CompressedImage&& image); @@ -639,7 +639,7 @@ template class TextureArray: public AbstractTexture { * * Convenience alternative to the above, example usage: * - * @snippet Magnum.cpp TextureArray-compressedSubImage2 + * @snippet MagnumGL.cpp TextureArray-compressedSubImage2 */ CompressedBufferImage compressedSubImage(Int level, const RangeTypeFor& range, CompressedBufferImage&& image, BufferUsage usage); #endif diff --git a/src/Magnum/TextureFormat.h b/src/Magnum/GL/TextureFormat.h similarity index 99% rename from src/Magnum/TextureFormat.h rename to src/Magnum/GL/TextureFormat.h index 79e6604a8..d2e3e293f 100644 --- a/src/Magnum/TextureFormat.h +++ b/src/Magnum/GL/TextureFormat.h @@ -1,5 +1,5 @@ -#ifndef Magnum_TextureFormat_h -#define Magnum_TextureFormat_h +#ifndef Magnum_GL_TextureFormat_h +#define Magnum_GL_TextureFormat_h /* This file is part of Magnum. @@ -29,7 +29,7 @@ * @brief Enum @ref Magnum::TextureFormat */ -#include "Magnum/OpenGL.h" +#include "Magnum/GL/OpenGL.h" namespace Magnum { diff --git a/src/Magnum/TimeQuery.h b/src/Magnum/GL/TimeQuery.h similarity index 97% rename from src/Magnum/TimeQuery.h rename to src/Magnum/GL/TimeQuery.h index d214aa272..32c1b7c47 100644 --- a/src/Magnum/TimeQuery.h +++ b/src/Magnum/GL/TimeQuery.h @@ -1,5 +1,5 @@ -#ifndef Magnum_TimeQuery_h -#define Magnum_TimeQuery_h +#ifndef Magnum_GL_TimeQuery_h +#define Magnum_GL_TimeQuery_h /* This file is part of Magnum. @@ -31,7 +31,7 @@ */ #endif -#include "Magnum/AbstractQuery.h" +#include "Magnum/GL/AbstractQuery.h" #ifndef MAGNUM_TARGET_WEBGL namespace Magnum { @@ -43,9 +43,9 @@ Queries timestamp after all previous OpenGL calls have been processed. It can query either duration of sequence of commands or absolute timestamp. Example usage of both methods: -@snippet Magnum.cpp TimeQuery-usage1 +@snippet MagnumGL.cpp TimeQuery-usage1 -@snippet Magnum.cpp TimeQuery-usage2 +@snippet MagnumGL.cpp TimeQuery-usage2 Using the latter results in fewer OpenGL calls when doing more measures. diff --git a/src/Magnum/TransformFeedback.cpp b/src/Magnum/GL/TransformFeedback.cpp similarity index 97% rename from src/Magnum/TransformFeedback.cpp rename to src/Magnum/GL/TransformFeedback.cpp index 141c49e97..f8bc92c6b 100644 --- a/src/Magnum/TransformFeedback.cpp +++ b/src/Magnum/GL/TransformFeedback.cpp @@ -28,15 +28,15 @@ #ifndef MAGNUM_TARGET_GLES2 #include -#include "Magnum/AbstractShaderProgram.h" -#include "Magnum/Buffer.h" -#include "Magnum/Context.h" -#include "Magnum/Extensions.h" +#include "Magnum/GL/AbstractShaderProgram.h" +#include "Magnum/GL/Buffer.h" +#include "Magnum/GL/Context.h" +#include "Magnum/GL/Extensions.h" #ifndef MAGNUM_TARGET_WEBGL -#include "Magnum/Implementation/DebugState.h" +#include "Magnum/GL/Implementation/DebugState.h" #endif -#include "Magnum/Implementation/State.h" -#include "Magnum/Implementation/TransformFeedbackState.h" +#include "Magnum/GL/Implementation/State.h" +#include "Magnum/GL/Implementation/TransformFeedbackState.h" namespace Magnum { diff --git a/src/Magnum/TransformFeedback.h b/src/Magnum/GL/TransformFeedback.h similarity index 93% rename from src/Magnum/TransformFeedback.h rename to src/Magnum/GL/TransformFeedback.h index 4f75151d2..1894bc434 100644 --- a/src/Magnum/TransformFeedback.h +++ b/src/Magnum/GL/TransformFeedback.h @@ -1,5 +1,5 @@ -#ifndef Magnum_TransformFeedback_h -#define Magnum_TransformFeedback_h +#ifndef Magnum_GL_TransformFeedback_h +#define Magnum_GL_TransformFeedback_h /* This file is part of Magnum. @@ -27,8 +27,9 @@ #include -#include "Magnum/AbstractObject.h" #include "Magnum/Tags.h" +#include "Magnum/GL/AbstractObject.h" +#include "Magnum/GL/GL.h" #ifndef MAGNUM_TARGET_GLES2 /** @file @@ -63,7 +64,7 @@ documentation for more information. @requires_webgl20 Transform feedback is not available in WebGL 1.0. @todo @extension{AMD,transform_feedback3_lines_triangles}? */ -class MAGNUM_EXPORT TransformFeedback: public AbstractObject { +class MAGNUM_GL_EXPORT TransformFeedback: public AbstractObject { friend Implementation::TransformFeedbackState; public: @@ -412,25 +413,25 @@ class MAGNUM_EXPORT TransformFeedback: public AbstractObject { void bindInternal(); - void MAGNUM_LOCAL createIfNotAlready(); + void MAGNUM_GL_LOCAL createIfNotAlready(); - void MAGNUM_LOCAL createImplementationDefault(); + void MAGNUM_GL_LOCAL createImplementationDefault(); #ifndef MAGNUM_TARGET_GLES - void MAGNUM_LOCAL createImplementationDSA(); + void MAGNUM_GL_LOCAL createImplementationDSA(); #endif - void MAGNUM_LOCAL attachImplementationFallback(GLuint index, Buffer& buffer, GLintptr offset, GLsizeiptr size); - void MAGNUM_LOCAL attachImplementationFallback(GLuint index, Buffer& buffer); + void MAGNUM_GL_LOCAL attachImplementationFallback(GLuint index, Buffer& buffer, GLintptr offset, GLsizeiptr size); + void MAGNUM_GL_LOCAL attachImplementationFallback(GLuint index, Buffer& buffer); #ifndef MAGNUM_TARGET_GLES - void MAGNUM_LOCAL attachImplementationDSA(GLuint index, Buffer& buffer, GLintptr offset, GLsizeiptr size); - void MAGNUM_LOCAL attachImplementationDSA(GLuint index, Buffer& buffer); + void MAGNUM_GL_LOCAL attachImplementationDSA(GLuint index, Buffer& buffer, GLintptr offset, GLsizeiptr size); + void MAGNUM_GL_LOCAL attachImplementationDSA(GLuint index, Buffer& buffer); #endif - void MAGNUM_LOCAL attachImplementationFallback(GLuint firstIndex, std::initializer_list> buffers); - void MAGNUM_LOCAL attachImplementationFallback(GLuint firstIndex, std::initializer_list buffers); + void MAGNUM_GL_LOCAL attachImplementationFallback(GLuint firstIndex, std::initializer_list> buffers); + void MAGNUM_GL_LOCAL attachImplementationFallback(GLuint firstIndex, std::initializer_list buffers); #ifndef MAGNUM_TARGET_GLES - void MAGNUM_LOCAL attachImplementationDSA(GLuint firstIndex, std::initializer_list> buffers); - void MAGNUM_LOCAL attachImplementationDSA(GLuint firstIndex, std::initializer_list buffers); + void MAGNUM_GL_LOCAL attachImplementationDSA(GLuint firstIndex, std::initializer_list> buffers); + void MAGNUM_GL_LOCAL attachImplementationDSA(GLuint firstIndex, std::initializer_list buffers); #endif #ifndef MAGNUM_TARGET_WEBGL diff --git a/src/Magnum/Version.cpp b/src/Magnum/GL/Version.cpp similarity index 100% rename from src/Magnum/Version.cpp rename to src/Magnum/GL/Version.cpp diff --git a/src/Magnum/Version.h b/src/Magnum/GL/Version.h similarity index 97% rename from src/Magnum/Version.h rename to src/Magnum/GL/Version.h index ba0bd48d0..e357c3c57 100644 --- a/src/Magnum/Version.h +++ b/src/Magnum/GL/Version.h @@ -1,5 +1,5 @@ -#ifndef Magnum_Version_h -#define Magnum_Version_h +#ifndef Magnum_GL_Version_h +#define Magnum_GL_Version_h /* This file is part of Magnum. @@ -32,7 +32,7 @@ #include #include "Magnum/Magnum.h" -#include "Magnum/visibility.h" +#include "Magnum/GL/visibility.h" namespace Magnum { @@ -158,7 +158,7 @@ constexpr bool isVersionES(Version) { return true; } #endif /** @debugoperatorenum{Magnum::Version} */ -MAGNUM_EXPORT Debug& operator<<(Debug& debug, Version value); +MAGNUM_GL_EXPORT Debug& operator<<(Debug& debug, Version value); } diff --git a/src/Magnum/GL/visibility.h b/src/Magnum/GL/visibility.h new file mode 100644 index 000000000..7fe402a8e --- /dev/null +++ b/src/Magnum/GL/visibility.h @@ -0,0 +1,48 @@ +#ifndef Magnum_GL_visibility_h +#define Magnum_GL_visibility_h +/* + This file is part of Magnum. + + Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018 + Vladimír Vondruš + + Permission is hereby granted, free of charge, to any person obtaining a + copy of this software and associated documentation files (the "Software"), + to deal in the Software without restriction, including without limitation + the rights to use, copy, modify, merge, publish, distribute, sublicense, + and/or sell copies of the Software, and to permit persons to whom the + Software is furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included + in all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + DEALINGS IN THE SOFTWARE. +*/ + +#include + +#include "Magnum/configure.h" + +#ifndef DOXYGEN_GENERATING_OUTPUT +#ifndef MAGNUM_BUILD_STATIC + #ifdef MagnumGL_EXPORTS + #define MAGNUM_GL_EXPORT CORRADE_VISIBILITY_EXPORT + #else + #define MAGNUM_GL_EXPORT CORRADE_VISIBILITY_IMPORT + #endif +#else + #define MAGNUM_GL_EXPORT CORRADE_VISIBILITY_STATIC +#endif +#define MAGNUM_GL_LOCAL CORRADE_VISIBILITY_LOCAL +#else +#define MAGNUM_GL_EXPORT +#define MAGNUM_GL_LOCAL +#endif + +#endif diff --git a/src/Magnum/Image.cpp b/src/Magnum/Image.cpp index 92fb1a589..da8f003f6 100644 --- a/src/Magnum/Image.cpp +++ b/src/Magnum/Image.cpp @@ -32,13 +32,13 @@ template Image::Image(PixelStorage storage, } #ifndef DOXYGEN_GENERATING_OUTPUT -template class MAGNUM_EXPORT Image<1>; -template class MAGNUM_EXPORT Image<2>; -template class MAGNUM_EXPORT Image<3>; +template class MAGNUM_GL_EXPORT Image<1>; +template class MAGNUM_GL_EXPORT Image<2>; +template class MAGNUM_GL_EXPORT Image<3>; -template class MAGNUM_EXPORT CompressedImage<1>; -template class MAGNUM_EXPORT CompressedImage<2>; -template class MAGNUM_EXPORT CompressedImage<3>; +template class MAGNUM_GL_EXPORT CompressedImage<1>; +template class MAGNUM_GL_EXPORT CompressedImage<2>; +template class MAGNUM_GL_EXPORT CompressedImage<3>; #endif } diff --git a/src/Magnum/Magnum.h b/src/Magnum/Magnum.h index 28ad91fbd..33e392a19 100644 --- a/src/Magnum/Magnum.h +++ b/src/Magnum/Magnum.h @@ -655,66 +655,12 @@ using Math::Literals::operator "" _degf; using Math::Literals::operator "" _radf; #endif -/* Forward declarations for all types in root namespace */ - #ifndef DOXYGEN_GENERATING_OUTPUT -/* FramebufferClear[Mask], FramebufferBlit[Mask], FramebufferBlitFilter, - FramebufferTarget enums used only directly with framebuffer instance */ -class AbstractFramebuffer; - -#if !(defined(MAGNUM_TARGET_WEBGL) && defined(MAGNUM_TARGET_GLES2)) -class AbstractQuery; -#endif -class AbstractShaderProgram; -class AbstractTexture; - template class Array; template class Array1D; template class Array2D; template class Array3D; -template class Attribute; - -enum class BufferUsage: GLenum; -class Buffer; - -#ifndef MAGNUM_TARGET_GLES2 -template class BufferImage; -typedef BufferImage<1> BufferImage1D; -typedef BufferImage<2> BufferImage2D; -typedef BufferImage<3> BufferImage3D; - -template class CompressedBufferImage; -typedef CompressedBufferImage<1> CompressedBufferImage1D; -typedef CompressedBufferImage<2> CompressedBufferImage2D; -typedef CompressedBufferImage<3> CompressedBufferImage3D; -#endif - -#if !defined(MAGNUM_TARGET_GLES2) && !defined(MAGNUM_TARGET_WEBGL) -class BufferTexture; -enum class BufferTextureFormat: GLenum; -#endif - -class Context; - -class CubeMapTexture; -enum class CubeMapCoordinate: GLenum; -#if !defined(MAGNUM_TARGET_GLES2) && !defined(MAGNUM_TARGET_WEBGL) -class CubeMapTextureArray; -#endif - -/* DebugOutput, DebugMessage, DebugGroup used only statically */ -/* DefaultFramebuffer is available only through global instance */ -/* DimensionTraits forward declaration is not needed */ - -class Extension; -class Framebuffer; - -#if !defined(MAGNUM_TARGET_GLES2) && !defined(MAGNUM_TARGET_WEBGL) -enum class ImageFormat: GLenum; -enum class ImageAccess: GLenum; -#endif - template class Image; typedef Image<1> Image1D; typedef Image<2> Image2D; @@ -735,40 +681,11 @@ typedef CompressedImageView<1> CompressedImageView1D; typedef CompressedImageView<2> CompressedImageView2D; typedef CompressedImageView<3> CompressedImageView3D; -enum class MeshPrimitive: GLenum; - -class Mesh; -class MeshView; - -#if !defined(MAGNUM_TARGET_GLES2) && !defined(MAGNUM_TARGET_WEBGL) -/* MultisampleTextureSampleLocations enum used only in the function */ -template class MultisampleTexture; -typedef MultisampleTexture<2> MultisampleTexture2D; -typedef MultisampleTexture<3> MultisampleTexture2DArray; -#endif - -enum class PixelFormat: GLenum; -enum class PixelType: GLenum; -enum class CompressedPixelFormat: GLenum; - class PixelStorage; #ifndef MAGNUM_TARGET_GLES class CompressedPixelStorage; #endif -/* ObjectFlag, ObjectFlags are used only in conjunction with *::wrap() function */ - -class PrimitiveQuery; -class SampleQuery; -class TimeQuery; - -#ifndef MAGNUM_TARGET_GLES -class RectangleTexture; -#endif - -class Renderbuffer; -enum class RenderbufferFormat: GLenum; - enum class ResourceState: UnsignedByte; enum class ResourceDataState: UnsignedByte; enum class ResourcePolicy: UnsignedByte; @@ -776,34 +693,7 @@ template class Resource; class ResourceKey; template class ResourceManager; -class Sampler; -class Shader; - -template class Texture; -#ifndef MAGNUM_TARGET_GLES -typedef Texture<1> Texture1D; -#endif -typedef Texture<2> Texture2D; -#if !(defined(MAGNUM_TARGET_WEBGL) && defined(MAGNUM_TARGET_GLES2)) -typedef Texture<3> Texture3D; -#endif - -#ifndef MAGNUM_TARGET_GLES2 -template class TextureArray; -#ifndef MAGNUM_TARGET_GLES -typedef TextureArray<1> Texture1DArray; -#endif -typedef TextureArray<2> Texture2DArray; -#endif - -enum class TextureFormat: GLenum; - -#ifndef MAGNUM_TARGET_GLES2 -class TransformFeedback; -#endif class Timeline; - -enum class Version: Int; #endif } diff --git a/src/Magnum/PixelStorage.cpp b/src/Magnum/PixelStorage.cpp index d575e5aa4..9dfdba877 100644 --- a/src/Magnum/PixelStorage.cpp +++ b/src/Magnum/PixelStorage.cpp @@ -27,13 +27,13 @@ #include -#include "Magnum/Context.h" -#include "Magnum/Extensions.h" -#include "Magnum/PixelFormat.h" +#include "Magnum/GL/Context.h" +#include "Magnum/GL/Extensions.h" +#include "Magnum/GL/PixelFormat.h" #include "Magnum/Math/Vector4.h" -#include "Implementation/RendererState.h" -#include "Implementation/State.h" +#include "Magnum/GL/Implementation/RendererState.h" +#include "Magnum/GL/Implementation/State.h" namespace Magnum { diff --git a/src/Magnum/PixelStorage.h b/src/Magnum/PixelStorage.h index 3a11f8926..379e76e8d 100644 --- a/src/Magnum/PixelStorage.h +++ b/src/Magnum/PixelStorage.h @@ -33,7 +33,8 @@ #include #include "Magnum/Magnum.h" -#include "Magnum/visibility.h" +#include "Magnum/GL/GL.h" +#include "Magnum/GL/visibility.h" #include "Magnum/Math/Vector3.h" namespace Magnum { @@ -58,7 +59,7 @@ to @fn_gl{PixelStore}. See also @ref Context::resetState() and @see @ref CompressedPixelStorage */ -class MAGNUM_EXPORT PixelStorage { +class MAGNUM_GL_EXPORT PixelStorage { friend AbstractFramebuffer; friend AbstractTexture; friend CubeMapTexture; @@ -205,7 +206,7 @@ class MAGNUM_EXPORT PixelStorage { #endif /* Bool parameter is ugly, but this is implementation detail of internal API so who cares */ - void MAGNUM_LOCAL applyInternal(bool isUnpack); + void MAGNUM_GL_LOCAL applyInternal(bool isUnpack); #if !(defined(MAGNUM_TARGET_GLES2) && defined(MAGNUM_TARGET_WEBGL)) Int _rowLength; @@ -219,8 +220,8 @@ class MAGNUM_EXPORT PixelStorage { /* Used internally in *Texture::image(), *Texture::subImage(), *Texture::setImage(), *Texture::setSubImage() and *Framebuffer::read() */ - void MAGNUM_LOCAL applyUnpack(); - void MAGNUM_LOCAL applyPack() { applyInternal(false); } + void MAGNUM_GL_LOCAL applyUnpack(); + void MAGNUM_GL_LOCAL applyPack() { applyInternal(false); } Int _alignment; }; @@ -242,7 +243,7 @@ which is ignored for compressed images. @requires_gl42 Extension @extension{ARB,compressed_texture_pixel_storage} @requires_gl Compressed pixel storage is hardcoded in OpenGL ES and WebGL. */ -class MAGNUM_EXPORT CompressedPixelStorage: public PixelStorage { +class MAGNUM_GL_EXPORT CompressedPixelStorage: public PixelStorage { friend AbstractTexture; friend CubeMapTexture; @@ -331,12 +332,12 @@ class MAGNUM_EXPORT CompressedPixelStorage: public PixelStorage { /* Bool parameter is ugly, but this is implementation detail of internal API so who cares */ - void MAGNUM_LOCAL applyInternal(bool isUnpack); + void MAGNUM_GL_LOCAL applyInternal(bool isUnpack); /* Used internally in *Texture::compressedImage(), *Texture::compressedSubImage(), *Texture::setCompressedImage() and *Texture::setCompressedSubImage() */ - void MAGNUM_LOCAL applyUnpack() { applyInternal(true); } - void MAGNUM_LOCAL applyPack() { applyInternal(false); } + void MAGNUM_GL_LOCAL applyUnpack() { applyInternal(true); } + void MAGNUM_GL_LOCAL applyPack() { applyInternal(false); } Vector3i _blockSize; Int _blockDataSize; diff --git a/src/Magnum/Tags.h b/src/Magnum/Tags.h index 236c56379..f44146729 100644 --- a/src/Magnum/Tags.h +++ b/src/Magnum/Tags.h @@ -55,3 +55,4 @@ constexpr NoCreateT NoCreate{NoCreateT::Init{}}; } #endif + diff --git a/src/Magnum/Test/CMakeLists.txt b/src/Magnum/Test/CMakeLists.txt index 1ab0cfad8..85d796327 100644 --- a/src/Magnum/Test/CMakeLists.txt +++ b/src/Magnum/Test/CMakeLists.txt @@ -24,97 +24,8 @@ # corrade_add_test(ArrayTest ArrayTest.cpp LIBRARIES Magnum) -corrade_add_test(AttributeTest AttributeTest.cpp LIBRARIES Magnum) -corrade_add_test(AbstractShaderProgramTest AbstractShaderProgramTest.cpp LIBRARIES Magnum) -corrade_add_test(BufferTest BufferTest.cpp LIBRARIES Magnum) -corrade_add_test(FormatTest FormatTest.cpp LIBRARIES Magnum) -corrade_add_test(ContextTest ContextTest.cpp LIBRARIES Magnum) -corrade_add_test(CubeMapTextureTest CubeMapTextureTest.cpp LIBRARIES Magnum) -corrade_add_test(DefaultFramebufferTest DefaultFramebufferTest.cpp LIBRARIES Magnum) -corrade_add_test(FramebufferTest FramebufferTest.cpp LIBRARIES Magnum) -corrade_add_test(ImageTest ImageTest.cpp LIBRARIES Magnum) -corrade_add_test(ImageViewTest ImageViewTest.cpp LIBRARIES Magnum) -corrade_add_test(MeshTest MeshTest.cpp LIBRARIES Magnum) -corrade_add_test(PixelStorageTest PixelStorageTest.cpp LIBRARIES Magnum) -corrade_add_test(RendererTest RendererTest.cpp LIBRARIES Magnum) -corrade_add_test(RenderbufferTest RenderbufferTest.cpp LIBRARIES Magnum) corrade_add_test(ResourceManagerTest ResourceManagerTest.cpp LIBRARIES Magnum) target_compile_definitions(ResourceManagerTest PRIVATE "CORRADE_GRACEFUL_ASSERT") -corrade_add_test(SamplerTest SamplerTest.cpp LIBRARIES Magnum) -corrade_add_test(ShaderTest ShaderTest.cpp LIBRARIES Magnum) -corrade_add_test(TagsTest TagsTest.cpp LIBRARIES Magnum) -corrade_add_test(TextureTest TextureTest.cpp LIBRARIES Magnum) -corrade_add_test(VersionTest VersionTest.cpp LIBRARIES Magnum) - -set_target_properties( - ArrayTest - AttributeTest - AbstractShaderProgramTest - BufferTest - FormatTest - ContextTest - CubeMapTextureTest - DefaultFramebufferTest - FramebufferTest - ImageTest - ImageViewTest - MeshTest - PixelStorageTest - RendererTest - RenderbufferTest - ResourceManagerTest - SamplerTest - ShaderTest - TagsTest - TextureTest - VersionTest - PROPERTIES FOLDER "Magnum/Test") - -if(NOT MAGNUM_TARGET_WEBGL) - corrade_add_test(DebugOutputTest DebugOutputTest.cpp LIBRARIES Magnum) - set_target_properties(DebugOutputTest PROPERTIES FOLDER "Magnum/Test") -endif() - -if(NOT MAGNUM_TARGET_GLES2) - corrade_add_test(BufferImageTest BufferImageTest.cpp LIBRARIES Magnum) - corrade_add_test(PrimitiveQueryTest PrimitiveQueryTest.cpp LIBRARIES Magnum) - corrade_add_test(TextureArrayTest TextureArrayTest.cpp LIBRARIES Magnum) - corrade_add_test(TransformFeedbackTest TransformFeedbackTest.cpp LIBRARIES Magnum) - - set_target_properties( - BufferImageTest - PrimitiveQueryTest - TextureArrayTest - TransformFeedbackTest - PROPERTIES FOLDER "Magnum/Test") -endif() - -if(NOT MAGNUM_TARGET_GLES2 AND NOT MAGNUM_TARGET_WEBGL) - corrade_add_test(BufferTextureTest BufferTextureTest.cpp LIBRARIES Magnum) - corrade_add_test(CubeMapTextureArrayTest CubeMapTextureArrayTest.cpp LIBRARIES Magnum) - corrade_add_test(MultisampleTextureTest MultisampleTextureTest.cpp LIBRARIES Magnum) - - set_target_properties( - BufferTextureTest - CubeMapTextureArrayTest - MultisampleTextureTest - PROPERTIES FOLDER "Magnum/Test") -endif() - -if(NOT (MAGNUM_TARGET_WEBGL AND MAGNUM_TARGET_GLES2)) - corrade_add_test(SampleQueryTest SampleQueryTest.cpp LIBRARIES Magnum) - set_target_properties(SampleQueryTest PROPERTIES FOLDER "Magnum/Test") -endif() - -if(NOT MAGNUM_TARGET_WEBGL) - corrade_add_test(TimeQueryTest TimeQueryTest.cpp LIBRARIES Magnum) - set_target_properties(TimeQueryTest PROPERTIES FOLDER "Magnum/Test") -endif() - -if(NOT MAGNUM_TARGET_GLES) - corrade_add_test(RectangleTextureTest RectangleTextureTest.cpp LIBRARIES Magnum) - set_target_properties(RectangleTextureTest PROPERTIES FOLDER "Magnum/Test") -endif() add_library(ResourceManagerLocalInstanceTestLib ${SHARED_OR_STATIC} ResourceManagerLocalInstanceTestLib.cpp) target_link_libraries(ResourceManagerLocalInstanceTestLib Magnum) @@ -122,102 +33,13 @@ if(NOT BUILD_STATIC) target_compile_definitions(ResourceManagerLocalInstanceTestLib PRIVATE "ResourceManagerLocalInstanceTestLib_EXPORTS") endif() corrade_add_test(ResourceManagerLocalInstanceTest ResourceManagerLocalInstanceTest.cpp LIBRARIES Magnum ResourceManagerLocalInstanceTestLib) + +corrade_add_test(TagsTest TagsTest.cpp LIBRARIES Magnum) + set_target_properties( + ArrayTest + ResourceManagerTest ResourceManagerLocalInstanceTestLib ResourceManagerLocalInstanceTest + TagsTest PROPERTIES FOLDER "Magnum/Test") - -if(BUILD_GL_TESTS) - corrade_add_test(AbstractTextureGLTest AbstractTextureGLTest.cpp LIBRARIES MagnumOpenGLTester) - corrade_add_test(BufferGLTest BufferGLTest.cpp LIBRARIES MagnumOpenGLTester) - corrade_add_test(ContextGLTest ContextGLTest.cpp LIBRARIES MagnumOpenGLTester) - corrade_add_test(CubeMapTextureGLTest CubeMapTextureGLTest.cpp LIBRARIES MagnumOpenGLTester) - corrade_add_test(FramebufferGLTest FramebufferGLTest.cpp LIBRARIES MagnumOpenGLTester) - corrade_add_test(MeshGLTest MeshGLTest.cpp LIBRARIES MagnumOpenGLTester) - corrade_add_test(RenderbufferGLTest RenderbufferGLTest.cpp LIBRARIES MagnumOpenGLTester) - corrade_add_test(TextureGLTest TextureGLTest.cpp LIBRARIES MagnumOpenGLTester) - - corrade_add_resource(AbstractShaderProgramGLTest_RES AbstractShaderProgramGLTestFiles/resources.conf) - corrade_add_test(AbstractShaderProgramGLTest - AbstractShaderProgramGLTest.cpp - ${AbstractShaderProgramGLTest_RES} - LIBRARIES MagnumOpenGLTester) - - if(CORRADE_TARGET_EMSCRIPTEN OR CORRADE_TARGET_ANDROID) - set(SHADERGLTEST_FILES_DIR "ShaderGLTestFiles") - else() - set(SHADERGLTEST_FILES_DIR ${CMAKE_CURRENT_SOURCE_DIR}/ShaderGLTestFiles) - endif() - - configure_file(${CMAKE_CURRENT_SOURCE_DIR}/configure.h.cmake - ${CMAKE_CURRENT_BINARY_DIR}/configure.h) - corrade_add_test(ShaderGLTest ShaderGLTest.cpp - LIBRARIES MagnumOpenGLTester - FILES ShaderGLTestFiles/shader.glsl) - target_include_directories(ShaderGLTest PRIVATE ${CMAKE_CURRENT_BINARY_DIR}) - - set_target_properties( - AbstractTextureGLTest - BufferGLTest - ContextGLTest - CubeMapTextureGLTest - FramebufferGLTest - MeshGLTest - RenderbufferGLTest - TextureGLTest - - AbstractShaderProgramGLTest - AbstractShaderProgramGLTest_RES-dependencies - - ShaderGLTest - PROPERTIES FOLDER "Magnum/Test") - - if(NOT MAGNUM_TARGET_WEBGL) - corrade_add_test(AbstractObjectGLTest AbstractObjectGLTest.cpp LIBRARIES MagnumOpenGLTester) - corrade_add_test(DebugOutputGLTest DebugOutputGLTest.cpp LIBRARIES MagnumOpenGLTester) - - set_target_properties( - AbstractObjectGLTest - DebugOutputGLTest - PROPERTIES FOLDER "Magnum/Test") - endif() - - if(NOT (MAGNUM_TARGET_WEBGL AND MAGNUM_TARGET_GLES2)) - corrade_add_test(AbstractQueryGLTest AbstractQueryGLTest.cpp LIBRARIES MagnumOpenGLTester) - corrade_add_test(PixelStorageGLTest PixelStorageGLTest.cpp LIBRARIES MagnumOpenGLTester) - corrade_add_test(SampleQueryGLTest SampleQueryGLTest.cpp LIBRARIES MagnumOpenGLTester) - corrade_add_test(TimeQueryGLTest TimeQueryGLTest.cpp LIBRARIES MagnumOpenGLTester) - - set_target_properties( - AbstractQueryGLTest - PixelStorageGLTest - SampleQueryGLTest - TimeQueryGLTest - PROPERTIES FOLDER "Magnum/Test") - endif() - - if(NOT MAGNUM_TARGET_GLES2) - corrade_add_test(BufferImageGLTest BufferImageGLTest.cpp LIBRARIES MagnumOpenGLTester) - corrade_add_test(BufferTextureGLTest BufferTextureGLTest.cpp LIBRARIES MagnumOpenGLTester) - corrade_add_test(CubeMapTextureArrayGLTest CubeMapTextureArrayGLTest.cpp LIBRARIES MagnumOpenGLTester) - corrade_add_test(MultisampleTextureGLTest MultisampleTextureGLTest.cpp LIBRARIES MagnumOpenGLTester) - corrade_add_test(PrimitiveQueryGLTest PrimitiveQueryGLTest.cpp LIBRARIES MagnumOpenGLTester) - corrade_add_test(TextureArrayGLTest TextureArrayGLTest.cpp LIBRARIES MagnumOpenGLTester) - corrade_add_test(TransformFeedbackGLTest TransformFeedbackGLTest.cpp LIBRARIES MagnumOpenGLTester) - - set_target_properties( - BufferImageGLTest - BufferTextureGLTest - CubeMapTextureArrayGLTest - MultisampleTextureGLTest - PrimitiveQueryGLTest - TextureArrayGLTest - TransformFeedbackGLTest - PROPERTIES FOLDER "Magnum/Test") - endif() - - if(NOT MAGNUM_TARGET_GLES) - corrade_add_test(RectangleTextureGLTest RectangleTextureGLTest.cpp LIBRARIES MagnumOpenGLTester) - set_target_properties(RectangleTextureGLTest PROPERTIES FOLDER "Magnum/Test") - endif() -endif() diff --git a/src/MagnumExternal/CMakeLists.txt b/src/MagnumExternal/CMakeLists.txt index f95db5bd3..29c5d2a84 100644 --- a/src/MagnumExternal/CMakeLists.txt +++ b/src/MagnumExternal/CMakeLists.txt @@ -26,7 +26,9 @@ if(WITH_AUDIO) add_subdirectory(OpenAL) endif() -add_subdirectory(OpenGL) +if(WITH_GL) + add_subdirectory(OpenGL) +endif() if(MAGNUM_BUILD_DEPRECATED) add_subdirectory(Optional) diff --git a/src/MagnumExternal/OpenGL/GL/CMakeLists.txt b/src/MagnumExternal/OpenGL/GL/CMakeLists.txt index 97467947b..6bc5c6edc 100644 --- a/src/MagnumExternal/OpenGL/GL/CMakeLists.txt +++ b/src/MagnumExternal/OpenGL/GL/CMakeLists.txt @@ -25,7 +25,7 @@ # flextGLPlatform.cpp is compiled as part of Magnum*Context libraries in Platform add_library(MagnumFlextGLObjects OBJECT flextGL.cpp) -target_include_directories(MagnumFlextGLObjects PUBLIC $) +target_include_directories(MagnumFlextGLObjects PUBLIC $) if(NOT BUILD_STATIC) target_compile_definitions(MagnumFlextGLObjects PRIVATE "FlextGL_EXPORTS") endif() diff --git a/src/MagnumExternal/OpenGL/GLES2/CMakeLists.txt b/src/MagnumExternal/OpenGL/GLES2/CMakeLists.txt index 25d08fd78..08c896586 100644 --- a/src/MagnumExternal/OpenGL/GLES2/CMakeLists.txt +++ b/src/MagnumExternal/OpenGL/GLES2/CMakeLists.txt @@ -44,7 +44,7 @@ endif() if(NOT CORRADE_TARGET_EMSCRIPTEN) # flextGLPlatform*.cpp is compiled as part of Magnum*Context libraries in Platform add_library(MagnumFlextGLObjects OBJECT ${MagnumOpenGL_SRCS}) - target_include_directories(MagnumFlextGLObjects PUBLIC $) + target_include_directories(MagnumFlextGLObjects PUBLIC $) if(NOT BUILD_STATIC) target_compile_definitions(MagnumFlextGLObjects PRIVATE "FlextGL_EXPORTS") endif() diff --git a/src/MagnumExternal/OpenGL/GLES3/CMakeLists.txt b/src/MagnumExternal/OpenGL/GLES3/CMakeLists.txt index a9e6df131..88486b216 100644 --- a/src/MagnumExternal/OpenGL/GLES3/CMakeLists.txt +++ b/src/MagnumExternal/OpenGL/GLES3/CMakeLists.txt @@ -44,7 +44,7 @@ endif() if(NOT CORRADE_TARGET_EMSCRIPTEN) # flextGLPlatform*.cpp is compiled as part of Magnum*Context libraries in Platform add_library(MagnumFlextGLObjects OBJECT ${MagnumOpenGL_SRCS}) - target_include_directories(MagnumFlextGLObjects PUBLIC $) + target_include_directories(MagnumFlextGLObjects PUBLIC $) if(NOT BUILD_STATIC) target_compile_definitions(MagnumFlextGLObjects PRIVATE "FlextGL_EXPORTS") endif()