Browse Source

Split the OpenGL layer out, pt 1: moving files to a new location.

Minimal updates (just the include guards) so Git is hopefully able to
detect the rename and track the history properly.

Everything except Magnum::GL doesn't compile now.
pull/233/head
Vladimír Vondruš 8 years ago
parent
commit
fc1b167bff
  1. 6
      CMakeLists.txt
  2. 73
      doc/building.dox
  3. 17
      doc/changelog.dox
  4. 1
      doc/compilation-speedup.dox
  5. 4
      doc/method-chaining.dox
  6. 2
      doc/opengl-workarounds.dox
  7. 10
      doc/opengl-wrapping.dox
  8. 4
      doc/platforms-html5.dox
  9. 10
      doc/portability.dox
  10. 24
      doc/snippets/CMakeLists.txt
  11. 0
      doc/snippets/MagnumGL-framebuffer.cpp
  12. 0
      doc/snippets/MagnumGL.cpp
  13. 207
      src/Magnum/CMakeLists.txt
  14. 23
      src/Magnum/GL/AbstractFramebuffer.cpp
  15. 119
      src/Magnum/GL/AbstractFramebuffer.h
  16. 9
      src/Magnum/GL/AbstractObject.cpp
  17. 30
      src/Magnum/GL/AbstractObject.h
  18. 8
      src/Magnum/GL/AbstractQuery.cpp
  19. 23
      src/Magnum/GL/AbstractQuery.h
  20. 15
      src/Magnum/GL/AbstractShaderProgram.cpp
  21. 243
      src/Magnum/GL/AbstractShaderProgram.h
  22. 73
      src/Magnum/GL/AbstractTexture.cpp
  23. 227
      src/Magnum/GL/AbstractTexture.h
  24. 0
      src/Magnum/GL/Attribute.cpp
  25. 44
      src/Magnum/GL/Attribute.h
  26. 13
      src/Magnum/GL/Buffer.cpp
  27. 106
      src/Magnum/GL/Buffer.h
  28. 14
      src/Magnum/GL/BufferImage.cpp
  29. 6
      src/Magnum/GL/BufferImage.h
  30. 11
      src/Magnum/GL/BufferTexture.cpp
  31. 26
      src/Magnum/GL/BufferTexture.h
  32. 6
      src/Magnum/GL/BufferTextureFormat.h
  33. 257
      src/Magnum/GL/CMakeLists.txt
  34. 41
      src/Magnum/GL/Context.cpp
  35. 40
      src/Magnum/GL/Context.h
  36. 13
      src/Magnum/GL/CubeMapTexture.cpp
  37. 92
      src/Magnum/GL/CubeMapTexture.h
  38. 9
      src/Magnum/GL/CubeMapTextureArray.cpp
  39. 26
      src/Magnum/GL/CubeMapTextureArray.h
  40. 8
      src/Magnum/GL/DebugOutput.cpp
  41. 74
      src/Magnum/GL/DebugOutput.h
  42. 8
      src/Magnum/GL/DefaultFramebuffer.cpp
  43. 22
      src/Magnum/GL/DefaultFramebuffer.h
  44. 17
      src/Magnum/GL/Extensions.h
  45. 36
      src/Magnum/GL/Framebuffer.cpp
  46. 58
      src/Magnum/GL/Framebuffer.h
  47. 179
      src/Magnum/GL/GL.h
  48. 6
      src/Magnum/GL/ImageFormat.h
  49. 7
      src/Magnum/GL/Implementation/BufferState.cpp
  50. 6
      src/Magnum/GL/Implementation/BufferState.h
  51. 2
      src/Magnum/GL/Implementation/ContextState.cpp
  52. 8
      src/Magnum/GL/Implementation/ContextState.h
  53. 6
      src/Magnum/GL/Implementation/DebugState.cpp
  54. 7
      src/Magnum/GL/Implementation/DebugState.h
  55. 6
      src/Magnum/GL/Implementation/FramebufferState.cpp
  56. 8
      src/Magnum/GL/Implementation/FramebufferState.h
  57. 6
      src/Magnum/GL/Implementation/MeshState.cpp
  58. 6
      src/Magnum/GL/Implementation/MeshState.h
  59. 6
      src/Magnum/GL/Implementation/QueryState.cpp
  60. 8
      src/Magnum/GL/Implementation/QueryState.h
  61. 4
      src/Magnum/GL/Implementation/RendererState.cpp
  62. 6
      src/Magnum/GL/Implementation/RendererState.h
  63. 6
      src/Magnum/GL/Implementation/ShaderProgramState.cpp
  64. 10
      src/Magnum/GL/Implementation/ShaderProgramState.h
  65. 4
      src/Magnum/GL/Implementation/ShaderState.cpp
  66. 10
      src/Magnum/GL/Implementation/ShaderState.h
  67. 27
      src/Magnum/GL/Implementation/State.cpp
  68. 8
      src/Magnum/GL/Implementation/State.h
  69. 10
      src/Magnum/GL/Implementation/TextureState.cpp
  70. 13
      src/Magnum/GL/Implementation/TextureState.h
  71. 9
      src/Magnum/GL/Implementation/TransformFeedbackState.cpp
  72. 10
      src/Magnum/GL/Implementation/TransformFeedbackState.h
  73. 5
      src/Magnum/GL/Implementation/driverSpecific.cpp
  74. 7
      src/Magnum/GL/Implementation/maxTextureSize.cpp
  75. 6
      src/Magnum/GL/Implementation/maxTextureSize.h
  76. 19
      src/Magnum/GL/Mesh.cpp
  77. 101
      src/Magnum/GL/Mesh.h
  78. 11
      src/Magnum/GL/MeshView.cpp
  79. 16
      src/Magnum/GL/MeshView.h
  80. 10
      src/Magnum/GL/MultisampleTexture.cpp
  81. 12
      src/Magnum/GL/MultisampleTexture.h
  82. 2
      src/Magnum/GL/OpenGL.cpp
  83. 4
      src/Magnum/GL/OpenGL.h
  84. 6
      src/Magnum/GL/OpenGLTester.cpp
  85. 10
      src/Magnum/GL/OpenGLTester.h
  86. 0
      src/Magnum/GL/PixelFormat.cpp
  87. 14
      src/Magnum/GL/PixelFormat.h
  88. 0
      src/Magnum/GL/PrimitiveQuery.cpp
  89. 10
      src/Magnum/GL/PrimitiveQuery.h
  90. 10
      src/Magnum/GL/RectangleTexture.cpp
  91. 26
      src/Magnum/GL/RectangleTexture.h
  92. 10
      src/Magnum/GL/Renderbuffer.cpp
  93. 34
      src/Magnum/GL/Renderbuffer.h
  94. 6
      src/Magnum/GL/RenderbufferFormat.h
  95. 8
      src/Magnum/GL/Renderer.cpp
  96. 27
      src/Magnum/GL/Renderer.h
  97. 10
      src/Magnum/GL/SampleQuery.h
  98. 8
      src/Magnum/GL/Sampler.cpp
  99. 22
      src/Magnum/GL/Sampler.h
  100. 11
      src/Magnum/GL/Shader.cpp
  101. Some files were not shown because too many files have changed in this diff Show More

6
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)

73
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,

17
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.

1
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

4
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

2
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
*/
}

10
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
*/
}

4
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()",

10
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:
<p>
@snippet Magnum.cpp portability-shaders
@snippet MagnumGL.cpp portability-shaders
</p>
@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

24
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(

0
doc/snippets/Magnum-framebuffer.cpp → doc/snippets/MagnumGL-framebuffer.cpp

0
doc/snippets/Magnum.cpp → doc/snippets/MagnumGL.cpp

207
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 $<TARGET_OBJECTS:MagnumFlextGLObjects>)
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}
$<TARGET_OBJECTS:MagnumMathObjects>)
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()

23
src/Magnum/AbstractFramebuffer.cpp → 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 {

119
src/Magnum/AbstractFramebuffer.h → 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 <Corrade/Containers/EnumSet.h>
#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
};

9
src/Magnum/AbstractObject.cpp → src/Magnum/GL/AbstractObject.cpp

@ -28,12 +28,11 @@
#include <Corrade/Utility/Assert.h>
#include <Corrade/Containers/ArrayView.h>
#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 {

30
src/Magnum/AbstractObject.h → 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 <Corrade/Containers/EnumSet.h>
#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<ObjectFlag> 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<const char> label);
static MAGNUM_LOCAL void labelImplementationExt(GLenum identifier, GLuint name, Containers::ArrayView<const char> label);
static MAGNUM_GL_LOCAL void labelImplementationNoOp(GLenum, GLuint, Containers::ArrayView<const char> label);
static MAGNUM_GL_LOCAL void labelImplementationExt(GLenum identifier, GLuint name, Containers::ArrayView<const char> label);
#ifndef MAGNUM_TARGET_GLES2
static MAGNUM_LOCAL void labelImplementationKhrDesktopES32(GLenum identifier, GLuint name, Containers::ArrayView<const char> label);
static MAGNUM_GL_LOCAL void labelImplementationKhrDesktopES32(GLenum identifier, GLuint name, Containers::ArrayView<const char> label);
#endif
#ifdef MAGNUM_TARGET_GLES
static MAGNUM_LOCAL void labelImplementationKhrES(GLenum identifier, GLuint name, Containers::ArrayView<const char> label);
static MAGNUM_GL_LOCAL void labelImplementationKhrES(GLenum identifier, GLuint name, Containers::ArrayView<const char> 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
};

8
src/Magnum/AbstractQuery.cpp → src/Magnum/GL/AbstractQuery.cpp

@ -27,12 +27,12 @@
#include <Corrade/Utility/Assert.h>
#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 {

23
src/Magnum/AbstractQuery.h → 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 <Corrade/Containers/ArrayView.h>
#include <Corrade/Utility/Assert.h>
#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<const char> 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<bool>();
template<> UnsignedInt MAGNUM_EXPORT AbstractQuery::result<UnsignedInt>();
template<> Int MAGNUM_EXPORT AbstractQuery::result<Int>();
template<> bool MAGNUM_GL_EXPORT AbstractQuery::result<bool>();
template<> UnsignedInt MAGNUM_GL_EXPORT AbstractQuery::result<UnsignedInt>();
template<> Int MAGNUM_GL_EXPORT AbstractQuery::result<Int>();
#ifndef MAGNUM_TARGET_WEBGL
template<> UnsignedLong MAGNUM_EXPORT AbstractQuery::result<UnsignedLong>();
template<> Long MAGNUM_EXPORT AbstractQuery::result<Long>();
template<> UnsignedLong MAGNUM_GL_EXPORT AbstractQuery::result<UnsignedLong>();
template<> Long MAGNUM_GL_EXPORT AbstractQuery::result<Long>();
#endif
#endif

15
src/Magnum/AbstractShaderProgram.cpp → src/Magnum/GL/AbstractShaderProgram.cpp

@ -27,16 +27,15 @@
#include <Corrade/Containers/Array.h>
#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 {

243
src/Magnum/AbstractShaderProgram.h → 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 <string>
#include <Corrade/Containers/ArrayView.h>
#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 <vector>
@ -57,35 +58,35 @@ functions and properties:
<li> **Attribute definitions** with location and type for
configuring meshes, for example:
@snippet Magnum.cpp AbstractShaderProgram-input-attributes
@snippet MagnumGL.cpp AbstractShaderProgram-input-attributes
</li>
<li> **Output attribute locations**, if desired, for example:
@snippet Magnum.cpp AbstractShaderProgram-output-attributes
@snippet MagnumGL.cpp AbstractShaderProgram-output-attributes
</li>
<li> **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
</li>
<li> **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
</li>
<li> **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
</li>
<li> **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
</li></ul>
@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<const char> name);
#ifndef MAGNUM_TARGET_GLES2
void MAGNUM_LOCAL transformFeedbackVaryingsImplementationDefault(Containers::ArrayView<const std::string> outputs, TransformFeedbackBufferMode bufferMode);
void MAGNUM_GL_LOCAL transformFeedbackVaryingsImplementationDefault(Containers::ArrayView<const std::string> outputs, TransformFeedbackBufferMode bufferMode);
#ifdef CORRADE_TARGET_WINDOWS
void MAGNUM_LOCAL transformFeedbackVaryingsImplementationDanglingWorkaround(Containers::ArrayView<const std::string> outputs, TransformFeedbackBufferMode bufferMode);
void MAGNUM_GL_LOCAL transformFeedbackVaryingsImplementationDanglingWorkaround(Containers::ArrayView<const std::string> 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;

73
src/Magnum/AbstractTexture.cpp → src/Magnum/GL/AbstractTexture.cpp

@ -27,23 +27,22 @@
#include <Corrade/Containers/Array.h>
#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<UnsignedInt dimensions> void AbstractTexture::image(GLint level, Image<
image = Image<dimensions>{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<UnsignedInt dimensions> void AbstractTexture::image(GLint level, BufferImage<dimensions>& image, BufferUsage usage) {
const Math::Vector<dimensions, Int> size = DataHelper<dimensions>::imageSize(*this, level);
@ -1724,9 +1723,9 @@ template<UnsignedInt dimensions> 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<UnsignedInt dimensions> void AbstractTexture::compressedImage(const GLint level, CompressedImage<dimensions>& image) {
const Math::Vector<dimensions, Int> size = DataHelper<dimensions>::imageSize(*this, level);
@ -1755,9 +1754,9 @@ template<UnsignedInt dimensions> void AbstractTexture::compressedImage(const GLi
image = CompressedImage<dimensions>{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<UnsignedInt dimensions> void AbstractTexture::compressedImage(const GLint level, CompressedBufferImage<dimensions>& image, BufferUsage usage) {
const Math::Vector<dimensions, Int> size = DataHelper<dimensions>::imageSize(*this, level);
@ -1786,9 +1785,9 @@ template<UnsignedInt dimensions> 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<UnsignedInt dimensions> void AbstractTexture::subImage(const GLint level, const RangeTypeFor<dimensions, Int>& range, Image<dimensions>& image) {
createIfNotAlready();
@ -1809,9 +1808,9 @@ template<UnsignedInt dimensions> void AbstractTexture::subImage(const GLint leve
image = Image<dimensions>{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<UnsignedInt dimensions> void AbstractTexture::subImage(const GLint level, const RangeTypeFor<dimensions, Int>& range, BufferImage<dimensions>& image, const BufferUsage usage) {
createIfNotAlready();
@ -1832,9 +1831,9 @@ template<UnsignedInt dimensions> 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<UnsignedInt dimensions> std::size_t AbstractTexture::compressedSubImageSize(TextureFormat format, const Math::Vector<dimensions, Int>& size) {
/* Amount of blocks in given range (rounded up) multiplied by block
@ -1874,9 +1873,9 @@ template<UnsignedInt dimensions> void AbstractTexture::compressedSubImage(const
image = CompressedImage<dimensions>{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<UnsignedInt dimensions> void AbstractTexture::compressedSubImage(const GLint level, const RangeTypeFor<dimensions, Int>& range, CompressedBufferImage<dimensions>& image, const BufferUsage usage) {
createIfNotAlready();
@ -1908,9 +1907,9 @@ template<UnsignedInt dimensions> 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

227
src/Magnum/AbstractTexture.h → 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 <Corrade/Containers/ArrayView.h>
#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<const char> 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<AbstractTexture* const> textures);
static void MAGNUM_GL_LOCAL bindImplementationFallback(GLint firstTextureUnit, Containers::ArrayView<AbstractTexture* const> textures);
#ifndef MAGNUM_TARGET_GLES
static void MAGNUM_LOCAL bindImplementationMulti(GLint firstTextureUnit, Containers::ArrayView<AbstractTexture* const> textures);
static void MAGNUM_GL_LOCAL bindImplementationMulti(GLint firstTextureUnit, Containers::ArrayView<AbstractTexture* const> 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<UnsignedInt dimensions> std::size_t MAGNUM_LOCAL compressedSubImageSize(TextureFormat format, const Math::Vector<dimensions, Int>& size);
template<UnsignedInt dimensions> std::size_t MAGNUM_GL_LOCAL compressedSubImageSize(TextureFormat format, const Math::Vector<dimensions, Int>& 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(AbstractTexture::*original)(GLint, const Vector2i&, const Vector2i&, PixelFormat, PixelType, const GLvoid*, const PixelStorage&)> void MAGNUM_LOCAL subImageImplementationSvga3DSliceBySlice(GLint level, const Vector2i& offset, const Vector2i& size, PixelFormat format, PixelType type, const GLvoid* data, const PixelStorage& storage);
template<void(AbstractTexture::*original)(GLint, const Vector2i&, const Vector2i&, PixelFormat, PixelType, const GLvoid*, const PixelStorage&)> 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(AbstractTexture::*original)(GLint, const Vector3i&, const Vector3i&, PixelFormat, PixelType, const GLvoid*, const PixelStorage&)> void MAGNUM_LOCAL subImageImplementationSvga3DSliceBySlice(GLint level, const Vector3i& offset, const Vector3i& size, PixelFormat format, PixelType type, const GLvoid* data, const PixelStorage& storage);
template<void(AbstractTexture::*original)(GLint, const Vector3i&, const Vector3i&, PixelFormat, PixelType, const GLvoid*, const PixelStorage&)> 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);

0
src/Magnum/Attribute.cpp → src/Magnum/GL/Attribute.cpp

44
src/Magnum/Attribute.h → 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 <Corrade/Containers/EnumSet.h>
#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<std::size_t rows> 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<DataOption> 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<DataOption> 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<Math::Vector<3, Float>>: 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<Math::Vector<3, Float>>::DataType value);
MAGNUM_GL_EXPORT Debug& operator<<(Debug& debug, Attribute<Math::Vector<3, Float>>::DataType value);
/* Floating-point four-component vector is absolutely special case */
template<> struct Attribute<Math::Vector<4, Float>> {
@ -748,11 +748,11 @@ template<> struct Attribute<Math::Vector<4, Float>> {
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<Math::Vector<4, Float>>::Components value);
MAGNUM_EXPORT Debug& operator<<(Debug& debug, Attribute<Math::Vector<4, Float>>::DataType value);
MAGNUM_GL_EXPORT Debug& operator<<(Debug& debug, Attribute<Math::Vector<4, Float>>::Components value);
MAGNUM_GL_EXPORT Debug& operator<<(Debug& debug, Attribute<Math::Vector<4, Float>>::DataType value);
/* Common float, int, unsigned int and double scalar attributes */
template<> struct Attribute<Float>: FloatAttribute, SizedAttribute<1, 1> {};

13
src/Magnum/Buffer.cpp → src/Magnum/GL/Buffer.cpp

@ -28,15 +28,14 @@
#include <Corrade/Containers/Array.h>
#include <Corrade/Utility/Debug.h>
#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 {

106
src/Magnum/Buffer.h → 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 <Corrade/Containers/EnumSet.h>
#include <Corrade/Utility/Assert.h>
#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 <Corrade/Containers/Array.h>
@ -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<Buffer* const> buffers);
static void MAGNUM_GL_LOCAL bindImplementationFallback(Target target, GLuint firstIndex, Containers::ArrayView<Buffer* const> buffers);
#ifndef MAGNUM_TARGET_GLES
static void MAGNUM_LOCAL bindImplementationMulti(Target target, GLuint firstIndex, Containers::ArrayView<Buffer* const> buffers);
static void MAGNUM_GL_LOCAL bindImplementationMulti(Target target, GLuint firstIndex, Containers::ArrayView<Buffer* const> buffers);
#endif
static void MAGNUM_LOCAL bindImplementationFallback(Target target, GLuint firstIndex, Containers::ArrayView<const std::tuple<Buffer*, GLintptr, GLsizeiptr>> buffers);
static void MAGNUM_GL_LOCAL bindImplementationFallback(Target target, GLuint firstIndex, Containers::ArrayView<const std::tuple<Buffer*, GLintptr, GLsizeiptr>> buffers);
#ifndef MAGNUM_TARGET_GLES
static void MAGNUM_LOCAL bindImplementationMulti(Target target, GLuint firstIndex, Containers::ArrayView<const std::tuple<Buffer*, GLintptr, GLsizeiptr>> buffers);
static void MAGNUM_GL_LOCAL bindImplementationMulti(Target target, GLuint firstIndex, Containers::ArrayView<const std::tuple<Buffer*, GLintptr, GLsizeiptr>> 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<const char> label);
@ -1263,63 +1263,63 @@ class MAGNUM_EXPORT Buffer: public AbstractObject {
CORRADE_DEPRECATED("used only by deprecated subData<T>()") 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} {}

14
src/Magnum/BufferImage.cpp → 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<UnsignedInt dimensions> Buffer CompressedBufferImage<dimensions>::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

6
src/Magnum/BufferImage.h → 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 {

11
src/Magnum/BufferTexture.cpp → 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 {

26
src/Magnum/BufferTexture.h → 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
};

6
src/Magnum/BufferTextureFormat.h → 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 {

257
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š <mosra@centrum.cz>
#
# 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 $<TARGET_OBJECTS:MagnumFlextGLObjects>)
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)

41
src/Magnum/Context.cpp → src/Magnum/GL/Context.cpp

@ -36,30 +36,29 @@
#include <Corrade/Utility/Debug.h>
#include <Corrade/Utility/String.h>
#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 {

40
src/Magnum/Context.h → 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 <Corrade/Containers/Optional.h>
#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<Extension>& 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<class T> 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(),

13
src/Magnum/CubeMapTexture.cpp → 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 {

92
src/Magnum/CubeMapTexture.h → 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
};

9
src/Magnum/CubeMapTextureArray.cpp → 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 {

26
src/Magnum/CubeMapTextureArray.h → 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

8
src/Magnum/DebugOutput.cpp → src/Magnum/GL/DebugOutput.cpp

@ -29,10 +29,10 @@
#include <Corrade/Utility/Assert.h>
#include <Corrade/Utility/Debug.h>
#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 {

74
src/Magnum/DebugOutput.h → 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 <string>
#include <Corrade/Containers/ArrayView.h>
#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<UnsignedInt> ids, bool enabled);
static MAGNUM_LOCAL void controlImplementationNoOp(GLenum, GLenum, GLenum, std::initializer_list<UnsignedInt>, bool);
static MAGNUM_GL_LOCAL void controlImplementationNoOp(GLenum, GLenum, GLenum, std::initializer_list<UnsignedInt>, bool);
#ifndef MAGNUM_TARGET_GLES2
static MAGNUM_LOCAL void controlImplementationKhrDesktopES32(GLenum source, GLenum type, GLenum severity, std::initializer_list<UnsignedInt> ids, bool enabled);
static MAGNUM_GL_LOCAL void controlImplementationKhrDesktopES32(GLenum source, GLenum type, GLenum severity, std::initializer_list<UnsignedInt> ids, bool enabled);
#endif
#ifdef MAGNUM_TARGET_GLES
static MAGNUM_LOCAL void controlImplementationKhrES(GLenum source, GLenum type, GLenum severity, std::initializer_list<UnsignedInt> ids, bool enabled);
static MAGNUM_GL_LOCAL void controlImplementationKhrES(GLenum source, GLenum type, GLenum severity, std::initializer_list<UnsignedInt> 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
<p>
@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<const char> string);
static MAGNUM_LOCAL void insertImplementationNoOp(Source, Type, UnsignedInt, DebugOutput::Severity, Containers::ArrayView<const char>);
static MAGNUM_GL_LOCAL void insertImplementationNoOp(Source, Type, UnsignedInt, DebugOutput::Severity, Containers::ArrayView<const char>);
#ifndef MAGNUM_TARGET_GLES2
static MAGNUM_LOCAL void insertImplementationKhrDesktopES32(Source source, Type type, UnsignedInt id, DebugOutput::Severity severity, Containers::ArrayView<const char> string);
static MAGNUM_GL_LOCAL void insertImplementationKhrDesktopES32(Source source, Type type, UnsignedInt id, DebugOutput::Severity severity, Containers::ArrayView<const char> string);
#endif
#ifdef MAGNUM_TARGET_GLES
static MAGNUM_LOCAL void insertImplementationKhrES(Source source, Type type, UnsignedInt id, DebugOutput::Severity severity, Containers::ArrayView<const char> string);
static MAGNUM_GL_LOCAL void insertImplementationKhrES(Source source, Type type, UnsignedInt id, DebugOutput::Severity severity, Containers::ArrayView<const char> string);
#endif
static MAGNUM_LOCAL void insertImplementationExt(Source, Type, UnsignedInt, DebugOutput::Severity, Containers::ArrayView<const char> string);
static MAGNUM_GL_LOCAL void insertImplementationExt(Source, Type, UnsignedInt, DebugOutput::Severity, Containers::ArrayView<const char> string);
#ifndef MAGNUM_TARGET_GLES
static MAGNUM_LOCAL void insertImplementationGremedy(Source, Type, UnsignedInt, DebugOutput::Severity, Containers::ArrayView<const char> string);
static MAGNUM_GL_LOCAL void insertImplementationGremedy(Source, Type, UnsignedInt, DebugOutput::Severity, Containers::ArrayView<const char> 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<const char> message);
static MAGNUM_LOCAL void pushImplementationNoOp(Source source, UnsignedInt id, Containers::ArrayView<const char> message);
static MAGNUM_GL_LOCAL void pushImplementationNoOp(Source source, UnsignedInt id, Containers::ArrayView<const char> message);
#ifndef MAGNUM_TARGET_GLES2
static MAGNUM_LOCAL void pushImplementationKhrDesktopES32(Source source, UnsignedInt id, Containers::ArrayView<const char> message);
static MAGNUM_GL_LOCAL void pushImplementationKhrDesktopES32(Source source, UnsignedInt id, Containers::ArrayView<const char> message);
#endif
#ifdef MAGNUM_TARGET_GLES
static MAGNUM_LOCAL void pushImplementationKhrES(Source source, UnsignedInt id, Containers::ArrayView<const char> message);
static MAGNUM_GL_LOCAL void pushImplementationKhrES(Source source, UnsignedInt id, Containers::ArrayView<const char> message);
#endif
static MAGNUM_LOCAL void pushImplementationExt(Source source, UnsignedInt id, Containers::ArrayView<const char> message);
static MAGNUM_GL_LOCAL void pushImplementationExt(Source source, UnsignedInt id, Containers::ArrayView<const char> 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

8
src/Magnum/DefaultFramebuffer.cpp → src/Magnum/GL/DefaultFramebuffer.cpp

@ -27,10 +27,10 @@
#include <Corrade/Containers/Array.h>
#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

22
src/Magnum/DefaultFramebuffer.h → 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);
}

17
src/Magnum/Extensions.h → 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 {

36
src/Magnum/Framebuffer.cpp → src/Magnum/GL/Framebuffer.cpp

@ -27,36 +27,34 @@
#include <Corrade/Containers/Array.h>
#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 {

58
src/Magnum/Framebuffer.h → 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 <Corrade/Containers/ArrayView.h>
#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<const char> 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;

179
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š <mosra@centrum.cz>
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<UnsignedInt, class> class Attribute;
enum class BufferUsage: GLenum;
class Buffer;
#ifndef MAGNUM_TARGET_GLES2
template<UnsignedInt> class BufferImage;
typedef BufferImage<1> BufferImage1D;
typedef BufferImage<2> BufferImage2D;
typedef BufferImage<3> BufferImage3D;
template<UnsignedInt> 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<UnsignedInt> class Image;
typedef Image<1> Image1D;
typedef Image<2> Image2D;
typedef Image<3> Image3D;
template<UnsignedInt> class CompressedImage;
typedef CompressedImage<1> CompressedImage1D;
typedef CompressedImage<2> CompressedImage2D;
typedef CompressedImage<3> CompressedImage3D;
template<UnsignedInt> class ImageView;
typedef ImageView<1> ImageView1D;
typedef ImageView<2> ImageView2D;
typedef ImageView<3> ImageView3D;
template<UnsignedInt> 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<UnsignedInt> 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<UnsignedInt> 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<UnsignedInt> 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

6
src/Magnum/ImageFormat.h → 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 {

7
src/Magnum/Implementation/BufferState.cpp → src/Magnum/GL/Implementation/BufferState.cpp

@ -27,10 +27,9 @@
#include <Corrade/Utility/Assert.h>
#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 {

6
src/Magnum/Implementation/BufferState.h → 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 {

2
src/Magnum/Implementation/ContextState.cpp → 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 {

8
src/Magnum/Implementation/ContextState.h → 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 <string>
#include <vector>
#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 {

6
src/Magnum/Implementation/DebugState.cpp → 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 {

7
src/Magnum/Implementation/DebugState.h → 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 <string>
#include <vector>
#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

6
src/Magnum/Implementation/FramebufferState.cpp → 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"

8
src/Magnum/Implementation/FramebufferState.h → 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 <string>
#include <vector>
#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 {

6
src/Magnum/Implementation/MeshState.cpp → 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"

6
src/Magnum/Implementation/MeshState.h → 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 <vector>
#include <string>
#include "Magnum/Mesh.h"
#include "Magnum/GL/Mesh.h"
namespace Magnum { namespace Implementation {

6
src/Magnum/Implementation/QueryState.cpp → 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 {

8
src/Magnum/Implementation/QueryState.h → 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 <string>
#include <vector>
#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)

4
src/Magnum/Implementation/RendererState.cpp → 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 {

6
src/Magnum/Implementation/RendererState.h → 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 <string>
#include <vector>
#include "Magnum/Renderer.h"
#include "Magnum/GL/Renderer.h"
#include "Magnum/Math/Vector3.h"
namespace Magnum { namespace Implementation {

6
src/Magnum/Implementation/ShaderProgramState.cpp → 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"

10
src/Magnum/Implementation/ShaderProgramState.h → 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 <string>
#include <vector>
#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 {

4
src/Magnum/Implementation/ShaderState.cpp → 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 {

10
src/Magnum/Implementation/ShaderState.h → 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 <string>
#include <vector>
#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 {

27
src/Magnum/Implementation/State.cpp → src/Magnum/GL/Implementation/State.cpp

@ -27,25 +27,24 @@
#include <algorithm>
#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 {

8
src/Magnum/Implementation/State.h → 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 <memory>
#include "Magnum/Magnum.h"
#include "Magnum/OpenGL.h"
#include "Magnum/GL/GL.h"
#include "Magnum/GL/OpenGL.h"
namespace Magnum { namespace Implementation {

10
src/Magnum/Implementation/TextureState.cpp → src/Magnum/GL/Implementation/TextureState.cpp

@ -27,13 +27,13 @@
#include <Corrade/Utility/Assert.h>
#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"

13
src/Magnum/Implementation/TextureState.h → 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 <Corrade/Containers/Array.h>
#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

9
src/Magnum/Implementation/TransformFeedbackState.cpp → 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 {

10
src/Magnum/Implementation/TransformFeedbackState.h → 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 <string>
#include <vector>
#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

5
src/Magnum/Implementation/driverSpecific.cpp → src/Magnum/GL/Implementation/driverSpecific.cpp

@ -23,11 +23,10 @@
DEALINGS IN THE SOFTWARE.
*/
#include "Magnum/Context.h"
#include <algorithm>
#include "Magnum/Extensions.h"
#include "Magnum/GL/Context.h"
#include "Magnum/GL/Extensions.h"
#include "Magnum/Math/Range.h"
namespace Magnum {

7
src/Magnum/Implementation/maxTextureSize.cpp → 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 {

6
src/Magnum/Implementation/maxTextureSize.h → 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 {

19
src/Magnum/Mesh.cpp → src/Magnum/GL/Mesh.cpp

@ -27,20 +27,19 @@
#include <Corrade/Utility/Debug.h>
#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 {

101
src/Magnum/Mesh.h → 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 <Corrade/Containers/ArrayView.h>
#include <Corrade/Utility/ConfigurationValue.h>
#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<const char> 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<Magnum::MeshPrimitive> {
template<> struct MAGNUM_GL_EXPORT ConfigurationValue<Magnum::MeshPrimitive> {
ConfigurationValue() = delete;
/**
@ -1020,7 +1021,7 @@ template<> struct MAGNUM_EXPORT ConfigurationValue<Magnum::MeshPrimitive> {
};
/** @configurationvalue{Magnum::Mesh::IndexType} */
template<> struct MAGNUM_EXPORT ConfigurationValue<Magnum::Mesh::IndexType> {
template<> struct MAGNUM_GL_EXPORT ConfigurationValue<Magnum::Mesh::IndexType> {
ConfigurationValue() = delete;
/**

11
src/Magnum/MeshView.cpp → src/Magnum/GL/MeshView.cpp

@ -28,12 +28,11 @@
#include <Corrade/Containers/Array.h>
#include <Corrade/Utility/Assert.h>
#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 {

16
src/Magnum/MeshView.h → 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 <functional>
#include <initializer_list>
#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<std::reference_wrapper<MeshView>> meshes);
static MAGNUM_GL_LOCAL void multiDrawImplementationDefault(std::initializer_list<std::reference_wrapper<MeshView>> meshes);
#endif
static MAGNUM_LOCAL void multiDrawImplementationFallback(std::initializer_list<std::reference_wrapper<MeshView>> meshes);
static MAGNUM_GL_LOCAL void multiDrawImplementationFallback(std::initializer_list<std::reference_wrapper<MeshView>> meshes);
std::reference_wrapper<Mesh> _original;

10
src/Magnum/MultisampleTexture.cpp → 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<Extensions::GL::ARB::texture_multisample>())
#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<Extensions::GL::ARB::texture_multisample>())
return Vector3i{0};

12
src/Magnum/MultisampleTexture.h → 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<UnsignedInt dimensions> VectorTypeFor<dimensions, Int> 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

2
src/Magnum/OpenGL.cpp → src/Magnum/GL/OpenGL.cpp

@ -25,8 +25,8 @@
#include <type_traits>
#include "Magnum/OpenGL.h"
#include "Magnum/Types.h"
#include "Magnum/GL/OpenGL.h"
namespace Magnum {

4
src/Magnum/OpenGL.h → 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.

6
src/Magnum/OpenGLTester.cpp → 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 {

10
src/Magnum/OpenGLTester.h → 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 <Corrade/TestSuite/Tester.h>
#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)

0
src/Magnum/PixelFormat.cpp → src/Magnum/GL/PixelFormat.cpp

14
src/Magnum/PixelFormat.h → 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);
}

0
src/Magnum/PrimitiveQuery.cpp → src/Magnum/GL/PrimitiveQuery.cpp

10
src/Magnum/PrimitiveQuery.h → 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

10
src/Magnum/RectangleTexture.cpp → 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 {

26
src/Magnum/RectangleTexture.h → 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);

10
src/Magnum/Renderbuffer.cpp → 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 {

34
src/Magnum/Renderbuffer.h → 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 <Corrade/Containers/ArrayView.h>
#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<const char> 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;

6
src/Magnum/RenderbufferFormat.h → 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 {

8
src/Magnum/Renderer.cpp → 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 {

27
src/Magnum/Renderer.h → 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 <Corrade/Containers/EnumSet.h>
#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
}

10
src/Magnum/SampleQuery.h → 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

8
src/Magnum/Sampler.cpp → src/Magnum/GL/Sampler.cpp

@ -27,10 +27,10 @@
#include <Corrade/Utility/Debug.h>
#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 {

22
src/Magnum/Sampler.h → 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
}

11
src/Magnum/Shader.cpp → src/Magnum/GL/Shader.cpp

@ -30,14 +30,13 @@
#include <Corrade/Utility/Debug.h>
#include <Corrade/Utility/Directory.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/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

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save