Browse Source

Merge branch 'master' into compatibility

Conflicts:
	package/ci/jenkins.xml
	src/Magnum/AbstractShaderProgram.cpp
	src/Magnum/Math/RectangularMatrix.h
	src/Magnum/MeshTools/CompressIndices.h
	src/Magnum/Platform/Sdl2Application.h
	src/Magnum/Resource.h
	src/Magnum/Shader.cpp
	src/Magnum/Test/AbstractImageTest.cpp
	src/Magnum/Test/AbstractShaderProgramTest.cpp
	src/Magnum/Test/MeshTest.cpp
	src/Magnum/Text/Text.h
	src/Magnum/Timeline.h
	src/Test/AbstractShaderProgramGLTest.cpp
	src/Test/FramebufferGLTest.cpp
	src/Test/MeshGLTest.cpp
Vladimír Vondruš 12 years ago
parent
commit
9ea4f85968
  1. 4
      CMakeLists.txt
  2. 19
      Doxyfile
  3. 194
      DoxygenLayout.xml
  4. 6
      doc/building.dox
  5. 6
      doc/cmake.dox
  6. 2
      doc/coding-style.dox
  7. 10
      doc/getting-started.dox
  8. 43
      doc/namespaces.dox
  9. 390
      doc/opengl-mapping.dox
  10. 342
      doc/opengl-support.dox
  11. 37
      doc/opengl.dox
  12. 6
      doc/portability.dox
  13. 2
      doc/tips.dox
  14. 93
      doc/troubleshooting.dox
  15. 62
      doc/unsupported.dox
  16. 14
      modules/FindCorrade.cmake
  17. 31
      modules/FindMagnum.cmake
  18. 1
      package/archlinux/PKGBUILD
  19. 1
      package/archlinux/PKGBUILD-clang
  20. 1
      package/archlinux/PKGBUILD-clang-libc++
  21. 1
      package/archlinux/PKGBUILD-gcc46
  22. 1
      package/archlinux/PKGBUILD-gcc47
  23. 1
      package/archlinux/PKGBUILD-gcc49
  24. 1
      package/archlinux/PKGBUILD-release
  25. 4
      package/ci/jenkins-emscripten.xml
  26. 2
      package/ci/jenkins-mingw32.xml
  27. 120
      package/ci/jenkins-nacl.xml
  28. 4
      package/ci/jenkins.xml
  29. 242
      src/CMakeLists.txt
  30. 15
      src/Magnum/AbstractFramebuffer.cpp
  31. 49
      src/Magnum/AbstractFramebuffer.h
  32. 25
      src/Magnum/AbstractImage.cpp
  33. 6
      src/Magnum/AbstractImage.h
  34. 7
      src/Magnum/AbstractObject.cpp
  35. 6
      src/Magnum/AbstractObject.h
  36. 2
      src/Magnum/AbstractResourceLoader.h
  37. 9
      src/Magnum/AbstractShaderProgram.cpp
  38. 171
      src/Magnum/AbstractShaderProgram.h
  39. 17
      src/Magnum/AbstractTexture.cpp
  40. 11
      src/Magnum/AbstractTexture.h
  41. 6
      src/Magnum/Array.h
  42. 6
      src/Magnum/Audio/AbstractImporter.cpp
  43. 6
      src/Magnum/Audio/AbstractImporter.h
  44. 2
      src/Magnum/Audio/Audio.cpp
  45. 0
      src/Magnum/Audio/Audio.h
  46. 2
      src/Magnum/Audio/Buffer.cpp
  47. 6
      src/Magnum/Audio/Buffer.h
  48. 2
      src/Magnum/Audio/CMakeLists.txt
  49. 6
      src/Magnum/Audio/Context.cpp
  50. 4
      src/Magnum/Audio/Context.h
  51. 2
      src/Magnum/Audio/Renderer.cpp
  52. 6
      src/Magnum/Audio/Renderer.h
  53. 4
      src/Magnum/Audio/Source.cpp
  54. 8
      src/Magnum/Audio/Source.h
  55. 10
      src/Magnum/Audio/Test/AbstractImporterTest.cpp
  56. 4
      src/Magnum/Audio/Test/BufferTest.cpp
  57. 6
      src/Magnum/Audio/Test/CMakeLists.txt
  58. 4
      src/Magnum/Audio/Test/RendererTest.cpp
  59. 4
      src/Magnum/Audio/Test/SourceTest.cpp
  60. 0
      src/Magnum/Audio/Test/configure.h.cmake
  61. 0
      src/Magnum/Audio/Test/file.bin
  62. 8
      src/Magnum/Audio/visibility.h
  63. 10
      src/Magnum/Buffer.cpp
  64. 23
      src/Magnum/Buffer.h
  65. 0
      src/Magnum/BufferImage.cpp
  66. 15
      src/Magnum/BufferImage.h
  67. 6
      src/Magnum/BufferTexture.cpp
  68. 4
      src/Magnum/BufferTexture.h
  69. 244
      src/Magnum/CMakeLists.txt
  70. 34
      src/Magnum/Color.h
  71. 2
      src/Magnum/ColorFormat.cpp
  72. 6
      src/Magnum/ColorFormat.h
  73. 39
      src/Magnum/Context.cpp
  74. 16
      src/Magnum/Context.h
  75. 2
      src/Magnum/CubeMapTexture.h
  76. 4
      src/Magnum/CubeMapTextureArray.h
  77. 2
      src/Magnum/DebugMarker.h
  78. 10
      src/Magnum/DebugMessage.cpp
  79. 13
      src/Magnum/DebugMessage.h
  80. 2
      src/Magnum/DebugTools/CMakeLists.txt
  81. 2
      src/Magnum/DebugTools/DebugTools.h
  82. 12
      src/Magnum/DebugTools/ForceRenderer.cpp
  83. 11
      src/Magnum/DebugTools/ForceRenderer.h
  84. 10
      src/Magnum/DebugTools/Implementation/AbstractBoxRenderer.cpp
  85. 6
      src/Magnum/DebugTools/Implementation/AbstractBoxRenderer.h
  86. 16
      src/Magnum/DebugTools/Implementation/AbstractShapeRenderer.cpp
  87. 12
      src/Magnum/DebugTools/Implementation/AbstractShapeRenderer.h
  88. 8
      src/Magnum/DebugTools/Implementation/AxisAlignedBoxRenderer.cpp
  89. 6
      src/Magnum/DebugTools/Implementation/AxisAlignedBoxRenderer.h
  90. 8
      src/Magnum/DebugTools/Implementation/BoxRenderer.cpp
  91. 6
      src/Magnum/DebugTools/Implementation/BoxRenderer.h
  92. 22
      src/Magnum/DebugTools/Implementation/CapsuleRenderer.cpp
  93. 6
      src/Magnum/DebugTools/Implementation/CapsuleRenderer.h
  94. 10
      src/Magnum/DebugTools/Implementation/CapsuleRendererTransformation.h
  95. 20
      src/Magnum/DebugTools/Implementation/CylinderRenderer.cpp
  96. 6
      src/Magnum/DebugTools/Implementation/CylinderRenderer.h
  97. 10
      src/Magnum/DebugTools/Implementation/CylinderRendererTransformation.h
  98. 10
      src/Magnum/DebugTools/Implementation/ForceRendererTransformation.h
  99. 16
      src/Magnum/DebugTools/Implementation/LineSegmentRenderer.cpp
  100. 6
      src/Magnum/DebugTools/Implementation/LineSegmentRenderer.h
  101. Some files were not shown because too many files have changed in this diff Show More

4
CMakeLists.txt

@ -164,8 +164,8 @@ set(MAGNUM_PLUGINS_AUDIOIMPORTER_INSTALL_DIR ${MAGNUM_PLUGINS_INSTALL_DIR}/audio
set(MAGNUM_DATA_INSTALL_DIR ${CMAKE_INSTALL_PREFIX}/share/magnum)
set(MAGNUM_CMAKE_FIND_MODULE_INSTALL_DIR ${CMAKE_ROOT}/Modules)
set(MAGNUM_INCLUDE_INSTALL_DIR ${CMAKE_INSTALL_PREFIX}/include/Magnum)
set(MAGNUM_PLUGINS_INCLUDE_INSTALL_DIR ${CMAKE_INSTALL_PREFIX}/include/Magnum/Plugins)
set(MAGNUM_EXTERNAL_INCLUDE_INSTALL_DIR ${CMAKE_INSTALL_PREFIX}/include/MagnumExternal)
set(MAGNUM_PLUGINS_INCLUDE_INSTALL_DIR ${CMAKE_INSTALL_PREFIX}/include/MagnumPlugins)
add_subdirectory(external)
add_subdirectory(modules)
add_subdirectory(src)

19
Doxyfile

@ -132,7 +132,9 @@ FULL_PATH_NAMES = YES
# relative paths, which will be relative from the directory where doxygen is
# started.
STRIP_FROM_PATH = ../
STRIP_FROM_PATH = ../magnum/src \
../magnum-plugins/src \
../magnum-integration/src
# The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of
# the path mentioned in the documentation of a class, which tells
@ -207,11 +209,13 @@ ALIASES = \
"collisionoperator{2}=@relates \1\n@brief %Collision of %\1 and %\2\n@see \2::operator/(const \1&) const" \
"todoc=@xrefitem todoc \"Documentation todo\" \"Documentation-related todo list\"" \
"fn_gl{1}=<a href=\"http://www.opengl.org/sdk/docs/man4/xhtml/gl\1.xml\">gl\1()</a>" \
"fn_gl2{2}=<a href=\"http://www.opengl.org/sdk/docs/man4/xhtml/gl\2.xml\">gl\1()</a>" \
"fn_gl_extension{3}=<a href=\"http://www.opengl.org/registry/specs/\2/\3.txt\">gl\1<b></b>\2()</a>" \
"fn_gl_extension2{3}=<a href=\"http://www.opengl.org/registry/specs/\2/\2_\3.txt\">gl\1<b></b>\2()</a>" \
"fn_gles_extension{3}=<a href=\"http://www.khronos.org/registry/gles/extensions/\2/\2_\3.txt\">gl\1<b></b>\2()</a>" \
"def_gl{1}=`GL_\1`" \
"deprecated_gl=@xrefitem deprecated-gl \"Deprecated OpenGL API\" \"Deprecated OpenGL API list\"" \
"def_gl_extension{3}=<a href=\"http://www.opengl.org/registry/specs/\2/\3.txt\">GL_\1_\2</a>" \
"deprecated_gl=@xrefitem opengl-deprecated \"Deprecated OpenGL API\" \"Deprecated OpenGL API list\"" \
"requires_gl30=@xrefitem requires-gl30 \"Requires OpenGL 3.0\" \"Functionality requiring OpenGL 3.0\"" \
"requires_gl31=@xrefitem requires-gl31 \"Requires OpenGL 3.1\" \"Functionality requiring OpenGL 3.1\"" \
"requires_gl32=@xrefitem requires-gl32 \"Requires OpenGL 3.2\" \"Functionality requiring OpenGL 3.2\"" \
@ -478,7 +482,7 @@ HIDE_SCOPE_NAMES = NO
# will put a list of the files that are included by a file in the documentation
# of that file.
SHOW_INCLUDE_FILES = NO
SHOW_INCLUDE_FILES = YES
# If the FORCE_LOCAL_INCLUDES tag is set to YES then Doxygen
# will list include files with double quotes in the documentation
@ -584,7 +588,7 @@ MAX_INITIALIZER_LINES = 30
# at the bottom of the documentation of classes and structs. If set to YES the
# list will mention the files that were used to generate the documentation.
SHOW_USED_FILES = YES
SHOW_USED_FILES = NO
# Set the SHOW_FILES tag to NO to disable the generation of the Files page.
# This will remove the Files entry from the Quick Index and from the
@ -689,11 +693,12 @@ WARN_LOGFILE =
# directories like "/usr/src/myproject". Separate the files or directories
# with spaces.
INPUT = src/ \
INPUT = src/Magnum \
src/MagnumPlugins \
doc/ \
../magnum-plugins/src/ \
../magnum-plugins/src/MagnumPlugins \
../magnum-plugins/doc/ \
../magnum-integration/src/ \
../magnum-integration/src/Magnum \
../magnum-integration/doc/ \
../magnum-examples/doc/

194
DoxygenLayout.xml

@ -0,0 +1,194 @@
<doxygenlayout version="1.0">
<!-- Generated by doxygen 1.8.5 -->
<!-- Navigation index tabs for HTML output -->
<navindex>
<tab type="mainpage" visible="yes" title=""/>
<tab type="pages" visible="yes" title="" intro=""/>
<tab type="modules" visible="yes" title="" intro=""/>
<tab type="namespaces" visible="yes" title="">
<tab type="namespacelist" visible="yes" title="" intro=""/>
<tab type="namespacemembers" visible="yes" title="" intro=""/>
</tab>
<tab type="classes" visible="yes" title="">
<tab type="classlist" visible="yes" title="" intro=""/>
<tab type="classindex" visible="$ALPHABETICAL_INDEX" title=""/>
<tab type="hierarchy" visible="yes" title="" intro=""/>
<tab type="classmembers" visible="yes" title="" intro=""/>
</tab>
<tab type="files" visible="yes" title="">
<tab type="filelist" visible="yes" title="" intro=""/>
<tab type="globals" visible="yes" title="" intro=""/>
</tab>
<tab type="examples" visible="yes" title="" intro=""/>
</navindex>
<!-- Layout definition for a class page -->
<class>
<briefdescription visible="yes"/>
<includes visible="$SHOW_INCLUDE_FILES"/>
<inheritancegraph visible="$CLASS_GRAPH"/>
<collaborationgraph visible="$COLLABORATION_GRAPH"/>
<memberdecl>
<nestedclasses visible="yes" title=""/>
<publictypes title=""/>
<services title=""/>
<interfaces title=""/>
<publicslots title=""/>
<signals title=""/>
<publicmethods title=""/>
<publicstaticmethods title=""/>
<publicattributes title=""/>
<publicstaticattributes title=""/>
<protectedtypes title=""/>
<protectedslots title=""/>
<protectedmethods title=""/>
<protectedstaticmethods title=""/>
<protectedattributes title=""/>
<protectedstaticattributes title=""/>
<packagetypes title=""/>
<packagemethods title=""/>
<packagestaticmethods title=""/>
<packageattributes title=""/>
<packagestaticattributes title=""/>
<properties title=""/>
<events title=""/>
<privatetypes title=""/>
<privateslots title=""/>
<privatemethods title=""/>
<privatestaticmethods title=""/>
<privateattributes title=""/>
<privatestaticattributes title=""/>
<friends title=""/>
<related title="" subtitle=""/>
<membergroups visible="yes"/>
</memberdecl>
<detaileddescription title=""/>
<memberdef>
<inlineclasses title=""/>
<typedefs title=""/>
<enums title=""/>
<services title=""/>
<interfaces title=""/>
<constructors title=""/>
<functions title=""/>
<related title=""/>
<variables title=""/>
<properties title=""/>
<events title=""/>
</memberdef>
<allmemberslink visible="yes"/>
<usedfiles visible="$SHOW_USED_FILES"/>
<authorsection visible="yes"/>
</class>
<!-- Layout definition for a namespace page -->
<namespace>
<briefdescription visible="yes"/>
<memberdecl>
<nestednamespaces visible="yes" title=""/>
<constantgroups visible="yes" title=""/>
<classes visible="yes" title=""/>
<typedefs title=""/>
<enums title=""/>
<functions title=""/>
<variables title=""/>
<membergroups visible="yes"/>
</memberdecl>
<detaileddescription title=""/>
<memberdef>
<inlineclasses title=""/>
<typedefs title=""/>
<enums title=""/>
<functions title=""/>
<variables title=""/>
</memberdef>
<authorsection visible="yes"/>
</namespace>
<!-- Layout definition for a file page -->
<file>
<briefdescription visible="yes"/>
<includes visible="no"/> <!-- this is useless -->
<includegraph visible="$INCLUDE_GRAPH"/>
<includedbygraph visible="$INCLUDED_BY_GRAPH"/>
<sourcelink visible="yes"/>
<memberdecl>
<classes visible="yes" title=""/>
<namespaces visible="yes" title=""/>
<constantgroups visible="yes" title=""/>
<defines title=""/>
<typedefs title=""/>
<enums title=""/>
<functions title=""/>
<variables title=""/>
<membergroups visible="yes"/>
</memberdecl>
<detaileddescription title=""/>
<memberdef>
<inlineclasses title=""/>
<defines title=""/>
<typedefs title=""/>
<enums title=""/>
<functions title=""/>
<variables title=""/>
</memberdef>
<authorsection/>
</file>
<!-- Layout definition for a group page -->
<group>
<briefdescription visible="yes"/>
<groupgraph visible="$GROUP_GRAPHS"/>
<memberdecl>
<nestedgroups visible="yes" title=""/>
<dirs visible="yes" title=""/>
<files visible="yes" title=""/>
<namespaces visible="yes" title=""/>
<classes visible="yes" title=""/>
<defines title=""/>
<typedefs title=""/>
<enums title=""/>
<enumvalues title=""/>
<functions title=""/>
<variables title=""/>
<signals title=""/>
<publicslots title=""/>
<protectedslots title=""/>
<privateslots title=""/>
<events title=""/>
<properties title=""/>
<friends title=""/>
<membergroups visible="yes"/>
</memberdecl>
<detaileddescription title=""/>
<memberdef>
<pagedocs/>
<inlineclasses title=""/>
<defines title=""/>
<typedefs title=""/>
<enums title=""/>
<enumvalues title=""/>
<functions title=""/>
<variables title=""/>
<signals title=""/>
<publicslots title=""/>
<protectedslots title=""/>
<privateslots title=""/>
<events title=""/>
<properties title=""/>
<friends title=""/>
</memberdef>
<authorsection visible="yes"/>
</group>
<!-- Layout definition for a directory page -->
<directory>
<briefdescription visible="yes"/>
<directorygraph visible="yes"/>
<memberdecl>
<dirs visible="yes"/>
<files visible="yes"/>
</memberdecl>
<detaileddescription title=""/>
</directory>
</doxygenlayout>

6
doc/building.dox

@ -139,9 +139,9 @@ available for desktop OpenGL only, see @ref requires-gl.
emulation in desktop OpenGL library. Might not be supported in all drivers.
The features used can be conveniently detected in depending projects both in
CMake and C++ sources, see @ref cmake and @ref src/Magnum.h for more
information. See also @ref corrade-cmake and @ref src/Corrade.h for additional
information.
CMake and C++ sources, see @ref cmake and @ref Magnum/Magnum.h for more
information. See also @ref corrade-cmake and @ref Corrade/Corrade.h for
additional information.
By default the engine is built with nearly everything except Audio library,
plugins and application libraries (see below). Using `WITH_*` CMake parameters

6
doc/cmake.dox

@ -47,7 +47,6 @@ variables:
(e.g. set it to `.` when deploying on Windows with plugins stored
relatively to the executable), the following `MAGNUM_PLUGINS_*_DIR`
variables depend on it.
- `MAGNUM_PLUGINS_INCLUDE_DIR` -- Include dir with plugins
- `MAGNUM_PLUGINS_FONT_DIR` -- Directory with font plugins
- `MAGNUM_PLUGINS_FONTCONVERTER_DIR` -- Directory with font converter plugins
- `MAGNUM_PLUGINS_IMAGECONVERTER_DIR` -- Directory with image converter
@ -135,6 +134,11 @@ are also available as preprocessor variables if including Magnum.h:
- `MAGNUM_TARGET_DESKTOP_GLES` -- Defined if compiled with OpenGL ES
emulation on desktop OpenGL
If `MAGNUM_BUILD_DEPRECATED` is defined, the `MAGNUM_INCLUDE_DIR` variable also
contains path directly to Magnum directory (i.e. for includes without `Magnum/`
prefix) and `MAGNUM_PLUGINS_INCLUDE_DIR` contains include dir for plugins (i.e.
instead of `MagnumPlugins/` prefix).
%Corrade library provides also its own set of CMake macros and variables, see
@ref corrade-cmake "its documentation" for more information.
@ref cmake-plugins "Plugins repository" and @ref cmake-integration "Integration library"

2
doc/coding-style.dox

@ -187,7 +187,7 @@ and OpenGL ES version/extension, first come desktop requirements, then ES
requirements.
All classes and functions using those commands are cross-referenced in page
@ref required-extensions.
@ref opengl-required-extensions.
@section unit-tests Unit tests

10
doc/getting-started.dox

@ -85,8 +85,8 @@ repository.
Directory `src/` contains the actual project. To keep things simple, the
project consists of just one source file with the most minimal code possible:
@code
#include <Platform/GlutApplication.h>
#include <DefaultFramebuffer.h>
#include <Magnum/DefaultFramebuffer.h>
#include <Magnum/Platform/GlutApplication.h>
using namespace Magnum;
@ -160,9 +160,9 @@ the concepts of graphics programming, we can change clear color to something
else and also print basic information about the GPU the engine is running on.
First include the needed headers:
@code
#include <Color.h>
#include <Context.h>
#include <Renderer.h>
#include <Magnum/Color.h>
#include <Magnum/Context.h>
#include <Magnum/Renderer.h>
@endcode
And in the constructor (which is currently empty) change the clear color and

43
doc/namespaces.dox

@ -22,11 +22,8 @@
DEALINGS IN THE SOFTWARE.
*/
/** @dir magnum
* @brief %Magnum library
*/
/** @dir magnum/src
* @brief Namespace Magnum
/** @dir magnum/src/Magnum
* @brief Namespace Magnum (part of @ref building "Magnum library")
*/
/** @namespace Magnum
@brief Root namespace
@ -39,7 +36,7 @@ to `${MAGNUM_LIBRARIES}`. See @ref building and @ref cmake for more
information.
*/
/** @dir Platform
/** @dir Magnum/Platform
* @brief Namespace Magnum::Platform
*/
/** @namespace Magnum::Platform
@ -57,7 +54,7 @@ documentation, @ref building, @ref cmake and @ref platform for more
information.
*/
/** @dir Math
/** @dir Magnum/Math
* @brief Namespace Magnum::Math
*/
/** @namespace Magnum::Math
@ -71,7 +68,7 @@ to `${MAGNUM_LIBRARIES}`. See @ref building, @ref cmake, @ref matrix-vector and
@ref transformations for more information.
*/
/** @dir Math/Algorithms
/** @dir Magnum/Math/Algorithms
* @brief Namespace Magnum::Math::Algorithms
*/
/** @namespace Magnum::Math::Algorithms
@ -85,7 +82,7 @@ to `${MAGNUM_LIBRARIES}`. See @ref building and @ref cmake for more
information.
*/
/** @dir Math/Geometry
/** @dir Magnum/Math/Geometry
* @brief Namespace Magnum::Math::Geometry
*/
/** @namespace Magnum::Math::Geometry
@ -99,7 +96,7 @@ to `${MAGNUM_LIBRARIES}`. See @ref building and @ref cmake for more
information.
*/
/** @dir Audio
/** @dir Magnum/Audio
* @brief Namespace Magnum::Audio
*/
/** @namespace Magnum::Audio
@ -116,7 +113,7 @@ particular `*Importer` class documentation, @ref building-plugins,
@ref cmake-plugins and @ref plugins for more information.
*/
/** @dir DebugTools
/** @dir Magnum/DebugTools
* @brief Namespace Magnum::DebugTools
*/
/** @namespace Magnum::DebugTools
@ -130,7 +127,7 @@ package in CMake and link to `${MAGNUM_DEBUGTOOLS_LIBRARIES}`. See
@ref building, @ref cmake and @ref debug-tools for more information.
*/
/** @dir MeshTools
/** @dir Magnum/MeshTools
* @brief Namespace Magnum::MeshTools
*/
/** @namespace Magnum::MeshTools
@ -144,11 +141,7 @@ package in CMake and link to `${MAGNUM_MESHTOOLS_LIBRARIES}`. See @ref building
and @ref cmake for more information.
*/
/** @dir Plugins
* @brief Basic plugins
*/
/** @dir Primitives
/** @dir Magnum/Primitives
* @brief Namespace Magnum::Primitives
*/
/** @namespace Magnum::Primitives
@ -162,7 +155,7 @@ package in CMake and link to `${MAGNUM_PRIMITIVES_LIBRARIES}`. See
@ref building and @ref cmake for more information.
*/
/** @dir SceneGraph
/** @dir Magnum/SceneGraph
* @brief Namespace Magnum::SceneGraph
*/
/**
@ -177,7 +170,7 @@ package in CMake and link to `${MAGNUM_SCENEGRAPH_LIBRARIES}`. See
@ref building, @ref cmake and @ref scenegraph for more information.
*/
/** @dir Shaders
/** @dir Magnum/Shaders
* @brief Namespace Magnum::Shaders
*/
/** @namespace Magnum::Shaders
@ -191,7 +184,7 @@ in CMake and link to `${MAGNUM_MESHTOOLS_SHADERS}`. See @ref building and
@ref cmake for more information.
*/
/** @dir Shapes
/** @dir Magnum/Shapes
* @brief Namespace Magnum::Shapes
*/
/** @namespace Magnum::Shapes
@ -205,7 +198,7 @@ CMake and link to `${MAGNUM_SHAPES_LIBRARIES}`. See @ref building, @ref cmake
and @ref shapes for more information.
*/
/** @dir Text
/** @dir Magnum/Text
* @brief Namespace Magnum::Text
*/
/** @namespace Magnum::Text
@ -221,7 +214,7 @@ for more information. Additional plugins are enabled separately, see particular
@ref cmake-plugins and @ref plugins for more information.
*/
/** @dir TextureTools
/** @dir Magnum/TextureTools
* @brief Namespace Magnum::TextureTools
*/
/** @namespace Magnum::TextureTools
@ -235,7 +228,7 @@ package in CMake and link to `${MAGNUM_TEXTURETOOLS_LIBRARIES}`. See
@ref building and @ref cmake for more information.
*/
/** @dir Trade
/** @dir Magnum/Trade
* @brief Namespace Magnum::Trade
*/
/** @namespace Magnum::Trade
@ -251,3 +244,7 @@ information. Additional plugins are enabled separately, see particular
`*Importer` and `*ImageConverter` class documentation, @ref building-plugins,
@ref cmake-plugins and @ref plugins for more information.
*/
/** @dir magnum/src/MagnumPlugins
* @brief %Magnum plugins (part of @ref building "Magnum library")
*/

390
doc/opengl-mapping.dox

@ -0,0 +1,390 @@
/*
This file is part of Magnum.
Copyright © 2010, 2011, 2012, 2013 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.
*/
namespace Magnum {
/** @page opengl-mapping OpenGL command mapping
@brief List of OpenGL commands corresponding to particular %Magnum API.
@tableofcontents
Legend:
- *not needed* -- given feature is implemented in a way that makes the
function unnecessary
- *not queryable*, *not supported* -- see @ref opengl-unsupported
- (empty) -- given feature is not yet implemented
@section opengl-mapping-functions Functions
OpenGL function | Matching API
-------------------------------------- | ------------
@fn_gl{ActiveShaderProgram} | |
@fn_gl{ActiveTexture} | @ref AbstractTexture::bind()
@fn_gl{AttachShader} | @ref AbstractShaderProgram::attachShader()
@fn_gl{BeginConditionalRender}, `glEndConditionalRender()` | @ref SampleQuery::beginConditionalRender(), \n @ref SampleQuery::endConditionalRender()
@fn_gl{BeginQuery}, `glEndQuery()` | @ref PrimitiveQuery::begin(), \n @ref SampleQuery::begin(), \n @ref TimeQuery::begin(), \n @ref AbstractQuery::end()
@fn_gl{BeginQueryIndexed}, `glEndQueryIndexed()` | |
@fn_gl{BeginTransformFeedback}, `glEndTransformFeedback()` | |
@fn_gl{BindAttribLocation} | @ref AbstractShaderProgram::bindAttributeLocation()
@fn_gl{BindBuffer} | not needed, handhled internally in @ref Buffer and elsewhere
@fn_gl{BindBufferBase} | |
@fn_gl{BindBufferRange} | |
@fn_gl{BindBuffersBase} | |
@fn_gl{BindBuffersRange} | |
@fn_gl{BindFragDataLocation} | @ref AbstractShaderProgram::bindFragmentDataLocation()
@fn_gl{BindFragDataLocationIndexed} | @ref AbstractShaderProgram::bindFragmentDataLocationIndexed()
@fn_gl{BindFramebuffer} | @ref Framebuffer::bind()
@fn_gl{BindImageTexture} | |
@fn_gl{BindImageTextures} | |
@fn_gl{BindProgramPipeline} | |
@fn_gl{BindRenderbuffer} | not needed, handhled internally in @ref Renderbuffer
@fn_gl{BindSampler} | |
@fn_gl{BindSamplers} | |
@fn_gl{BindTexture}, \n @fn_gl_extension{BindMultiTexture,EXT,direct_state_access} | @ref AbstractTexture::bind()
@fn_gl{BindTextures} | |
@fn_gl{BindTransformFeedback} | |
@fn_gl{BindVertexArray} | not needed, handhled internally in @ref Mesh
@fn_gl{BindVertexBuffer} | |
@fn_gl{BindVertexBuffers} | |
@fn_gl{BlendColor} | @ref Renderer::setBlendColor()
@fn_gl{BlendEquation}, \n @fn_gl{BlendEquationSeparate} | @ref Renderer::setBlendEquation()
@fn_gl{BlendFunc}, \n @fn_gl{BlendFuncSeparate} | @ref Renderer::setBlendFunction()
@fn_gl{BlitFramebuffer} | @ref AbstractFramebuffer::blit()
@fn_gl{BufferData}, \n @fn_gl_extension{NamedBufferData,EXT,direct_state_access} | @ref Buffer::setData()
@fn_gl{BufferStorage} | |
@fn_gl{BufferSubData}, \n @fn_gl_extension{NamedBufferSubData,EXT,direct_state_access} | @ref Buffer::setSubData()
@fn_gl{CheckFramebufferStatus}, \n @fn_gl_extension{CheckNamedFramebufferStatus,EXT,direct_state_access} | @ref DefaultFramebuffer::checkStatus(), \n @ref Framebuffer::checkStatus()
@fn_gl{ClampColor} | |
@fn_gl{Clear} | @ref AbstractFramebuffer::clear()
@fn_gl{ClearBuffer} | |
@fn_gl{ClearBufferData} | |
@fn_gl{ClearBufferSubData} | |
@fn_gl{ClearColor} | @ref Renderer::setClearColor()
@fn_gl{ClearDepth} | @ref Renderer::setClearDepth()
@fn_gl{ClearStencil} | @ref Renderer::setClearStencil()
@fn_gl{ClearTexImage} | |
@fn_gl{ClearTexSubImage} | |
@fn_gl{ClientWaitSync} | |
@fn_gl{ColorMask} | @ref Renderer::setColorMask()
@fn_gl{CompileShader} | @ref Shader::compile()
@fn_gl{CompressedTexImage1D}, \n @fn_gl{CompressedTexImage2D}, \n @fn_gl{CompressedTexImage3D} | |
@fn_gl{CompressedTexSubImage1D}, \n @fn_gl{CompressedTexSubImage2D}, \n @fn_gl{CompressedTexSubImage3D} | |
@fn_gl{CopyBufferSubData}, \n @fn_gl_extension{NamedCopyBufferSubData,EXT,direct_state_access} | @ref Buffer::copy()
@fn_gl{CopyImageSubData} | |
@fn_gl{CopyTexImage1D}, \n @fn_gl{CopyTexImage2D} | |
@fn_gl{CopyTexSubImage1D}, \n @fn_gl{CopyTexSubImage2D}, \n @fn_gl{CopyTexSubImage3D} | |
@fn_gl{CreateProgram}, @fn_gl{DeleteProgram} | @ref AbstractShaderProgram constructor and destructor
@fn_gl{CreateShader}, @fn_gl{DeleteShader} | @ref Shader constructor and destructor
@fn_gl{CreateShaderProgram} | |
@fn_gl{CullFace} | @ref Renderer::setFaceCullingMode()
@fn_gl{DebugMessageCallback} | @ref DebugMessage::setCallback()
@fn_gl{DebugMessageControl} | |
@fn_gl{DebugMessageInsert}, \n @fn_gl_extension2{InsertEventMarker,EXT,debug_marker}, \n @fn_gl_extension{StringMarker,GREMEDY,string_marker} | @ref DebugMessage::insert()
@fn_gl{DepthFunc} | @ref Renderer::setDepthFunction()
@fn_gl{DepthMask} | @ref Renderer::setDepthMask()
@fn_gl{DepthRange} | |
@fn_gl{DepthRangeArray} | |
@fn_gl{DepthRangeIndexed} | |
@fn_gl{DetachShader} | |
@fn_gl{DispatchCompute} | |
@fn_gl{DispatchComputeIndirect} | |
@fn_gl{DrawArrays}, \n @fn_gl{DrawElements}, \n @fn_gl{DrawRangeElements} | @ref Mesh::draw()
@fn_gl{DrawArraysIndirect}, \n @fn_gl{DrawArraysInstanced}, \n @fn_gl{DrawArraysInstancedBaseInstance}, \n @fn_gl{DrawElementsBaseVertex}, \n @fn_gl{DrawElementsIndirect}, \n @fn_gl{DrawElementsInstanced}, \n @fn_gl{DrawElementsInstancedBaseInstance}, \n @fn_gl{DrawElementsInstancedBaseVertex}, \n @fn_gl{DrawElementsInstancedBaseVertexBaseInstance}, \n @fn_gl{DrawRangeElementsBaseVertex} | |
@fn_gl{DrawBuffer}, \n @fn_gl_extension{FramebufferDrawBuffers,EXT,direct_state_access}, \n @fn_gl{DrawBuffers}, \n @fn_gl_extension{FramebufferDrawBuffers,EXT,direct_state_access} | @ref DefaultFramebuffer::mapForDraw(), \n @ref Framebuffer::mapForDraw()
@fn_gl{DrawTransformFeedback}, \n @fn_gl{DrawTransformFeedbackInstanced}, \n @fn_gl{DrawTransformFeedbackStream}, \n @fn_gl{DrawTransformFeedbackStreamInstanced} | |
@fn_gl{Enable}, `glDisable()` | @ref Renderer::setFeature()
@fn_gl{EnableVertexAttribArray}, \n @fn_gl_extension{EnableVertexArrayAttrib,EXT,direct_state_access} \n @fn_gl2{DisableVertexAttribArray,EnableVertexAttribArray}, \n @fn_gl_extension{DisableVertexArrayAttrib,EXT,direct_state_access} | @ref Mesh::addVertexBuffer()
@fn_gl{FenceSync}, @fn_gl{DeleteSync} | |
@fn_gl{Finish} | @ref Renderer::finish()
@fn_gl{Flush} | @ref Renderer::flush()
@fn_gl{FlushMappedBufferRange}, \n @fn_gl_extension{FlushMappedNamedBufferRange,EXT,direct_state_access} | @ref Buffer::flushMappedRange()
@fn_gl2{FramebufferParameter,FramebufferParameteri} | |
@fn_gl{FramebufferRenderbuffer}, \n @fn_gl_extension{NamedFramebufferRenderbuffer,EXT,direct_state_access} | @ref Framebuffer::attachRenderbuffer()
@fn_gl{FramebufferTexture} | |
@fn_gl2{FramebufferTexture1D,FramebufferTexture}, \n @fn_gl_extension{NamedFramebufferTexture1D,EXT,direct_state_access} | @ref Framebuffer::attachTexture1D()
@fn_gl2{FramebufferTexture2D,FramebufferTexture}, \n @fn_gl_extension{NamedFramebufferTexture2D,EXT,direct_state_access} | @ref Framebuffer::attachTexture2D()
@fn_gl2{FramebufferTexture3D,FramebufferTexture}, \n @fn_gl_extension{NamedFramebufferTexture3D,EXT,direct_state_access} | @ref Framebuffer::attachTexture3D()
@fn_gl{FramebufferTextureLayer} | |
@fn_gl{FrontFace} | @ref Renderer::setFrontFace()
@fn_gl{GenBuffers}, @fn_gl{DeleteBuffers} | @ref Buffer constructor and destructor
@fn_gl{GenFramebuffers}, @fn_gl{DeleteFramebuffers} | @ref Framebuffer constructor and destructor
@fn_gl{GenProgramPipelines}, @fn_gl{DeleteProgramPipelines} | |
@fn_gl{GenQueries}, @fn_gl{DeleteQueries} | @ref AbstractQuery constructor and destructor
@fn_gl{GenRenderbuffers}, @fn_gl{DeleteRenderbuffers} | @ref Renderbuffer constructor and destructor
@fn_gl{GenSamplers}, @fn_gl{DeleteSamplers} | |
@fn_gl{GenTextures}, @fn_gl{DeleteTextures} | @ref AbstractTexture constructor and destructor
@fn_gl{GenTransformFeedbacks}, @fn_gl{DeleteTransformFeedbacks} | |
@fn_gl{GenVertexArrays}, @fn_gl{DeleteVertexArrays} | @ref Mesh constructor and destructor
@fn_gl{GenerateMipmap}, \n @fn_gl_extension{GenerateTextureMipmap,EXT,direct_state_access} | @ref AbstractTexture::generateMipmap()
@fn_gl{Get} | see @ref opengl-mapping-state "table below"
@fn_gl2{GetActiveAtomicCounterBuffer,GetActiveAtomicCounterBufferiv} | not queryable
@fn_gl{GetActiveAttrib}, \n @fn_gl{GetActiveSubroutineName}, \n @fn_gl{GetActiveSubroutineUniform}, \n @fn_gl{GetActiveSubroutineUniformName}, \n @fn_gl{GetActiveUniform}, \n @fn_gl{GetActiveUniformBlock}, \n @fn_gl{GetActiveUniformBlockName}, \n @fn_gl{GetActiveUniformName}, \n @fn_gl{GetActiveUniforms} | not queryable
@fn_gl{GetAttachedShaders} | not queryable, @ref AbstractShaderProgram::attachShader() setter only
@fn_gl{GetAttribLocation} | not queryable, @ref AbstractShaderProgram::bindAttributeLocation() setter only
@fn_gl{GetBufferParameter}, \n @fn_gl_extension{GetNamedBufferParameter,EXT,direct_state_access} | @ref Buffer::size()
@fn_gl2{GetBufferPointer,GetBufferPointerv} | not queryable, @ref Buffer::map() setter only
@fn_gl{GetBufferSubData}, \n @fn_gl_extension{GetNamedBufferSubData,EXT,direct_state_access} | @ref Buffer::data(), \n @ref Buffer::subData()
@fn_gl{GetCompressedTexImage} | |
@fn_gl{GetDebugMessageLog} | |
@fn_gl{GetError} | @ref Renderer::error()
@fn_gl{GetFragDataIndex}, @fn_gl{GetFragDataLocation} | not queryable, @ref AbstractShaderProgram::bindFragmentDataLocation() and \n @ref AbstractShaderProgram::bindFragmentDataLocationIndexed() setters only
@fn_gl{GetFramebufferAttachmentParameter} | not queryable, @ref Framebuffer setters only
@fn_gl{GetFramebufferParameter} | not queryable, @ref DefaultFramebuffer and \n @ref Framebuffer setters only
@fn_gl_extension{GetGraphicsResetStatus,ARB,robustness} | @ref Renderer::graphicsResetStatus()
@fn_gl{GetInternalformat} | |
@fn_gl{GetMultisample} | |
@fn_gl{GetObjectLabel}, \n @fn_gl{GetObjectPtrLabel} | not queryable, @ref AbstractShaderProgram::setLabel(), \n @ref AbstractQuery::setLabel(), \n @ref AbstractTexture::setLabel(), \n @ref Buffer::setLabel(), \n @ref Framebuffer::setLabel(), \n @ref Mesh::setLabel(), \n @ref Renderbuffer::setLabel() and \n @ref Shader::setLabel() setters only
@fn_gl{GetProgram}, \n @fn_gl{GetProgramInfoLog} | @ref AbstractShaderProgram::link(), \n @ref AbstractShaderProgram::validate()
@fn_gl{GetProgramBinary} | |
@fn_gl{GetProgramInterface} | |
@fn_gl{GetProgramPipeline} | |
@fn_gl{GetProgramPipelineInfoLog} | |
@fn_gl{GetProgramResource} | |
@fn_gl{GetProgramResourceIndex} | |
@fn_gl{GetProgramResourceLocation} | |
@fn_gl{GetProgramResourceLocationIndex}| |
@fn_gl{GetProgramResourceName} | |
@fn_gl{GetProgramStage} | |
@fn_gl{GetQueryIndexed} | |
@fn_gl{GetQueryObject} | @ref AbstractQuery::result()
@fn_gl2{GetQuery,GetQueryiv} | |
@fn_gl{GetRenderbufferParameter} | not queryable, @ref Renderbuffer::setStorage() and \n @ref Renderbuffer::setStorageMultisample() setter only
@fn_gl{GetSamplerParameter} | |
@fn_gl{GetShader}, \n @fn_gl{GetShaderInfoLog} | @ref Shader::compile()
@fn_gl{GetShaderPrecisionFormat} | |
@fn_gl{GetShaderSource} | not queryable but tracked in @ref Shader::sources()
@fn_gl{GetString} | @ref Context::supportedExtensions(), \n @ref Context::rendererString(), \n @ref Context::shadingLanguageVersionString(), \n @ref Context::vendorString(), \n @ref Context::versionString()
@fn_gl{GetSubroutineIndex} | |
@fn_gl{GetSubroutineUniformLocation} | |
@fn_gl{GetSync} | |
@fn_gl{GetTexImage}, \n @fn_gl_extension{GetTextureImage,EXT,direct_state_access}, \n @fn_gl_extension{GetnTexImage,ARB,robustness} | @ref Texture::image(), \n @ref CubeMapTexture::image(), \n @ref CubeMapTextureArray::image()
@fn_gl{GetTexLevelParameter}, \n @fn_gl_extension{GetTextureLevelParameter,EXT,direct_state_access} | @ref Texture::imageSize(), \n @ref CubeMapTexture::imageSize(), \n @ref CubeMapTextureArray::imageSize()
@fn_gl{GetTexParameter} | |
@fn_gl{GetTransformFeedbackVarying} | |
@fn_gl{GetUniform} | not queryable, @ref AbstractShaderProgram::setUniform() setter only
@fn_gl{GetUniformBlockIndex} | |
@fn_gl{GetUniformIndices} | |
@fn_gl{GetUniformLocation} | @ref AbstractShaderProgram::uniformLocation()
@fn_gl{GetUniformSubroutine} | |
@fn_gl{GetVertexAttrib} | not queryable, @ref Mesh::addVertexBuffer() setter only
@fn_gl{InvalidateBufferData} | @ref Buffer::invalidateData()
@fn_gl{InvalidateBufferSubData} | @ref Buffer::invalidateSubData()
@fn_gl{InvalidateFramebuffer}, \n @fn_gles_extension{DiscardFramebuffer,EXT,discard_framebuffer} | @ref DefaultFramebuffer::invalidate(), \n @ref Framebuffer::invalidate()
@fn_gl{InvalidateSubFramebuffer}, \n @fn_gles_extension{DiscardSubFramebuffer,EXT,discard_framebuffer} | @ref DefaultFramebuffer::invalidate(), \n @ref Framebuffer::invalidate()
@fn_gl{InvalidateTexImage} | @ref AbstractTexture::invalidateImage()
@fn_gl{InvalidateTexSubImage} | @ref Texture::invalidateSubImage(),\n @ref CubeMapTexture::invalidateSubImage(), \n @ref CubeMapTextureArray::invalidateSubImage()
@fn_gl{IsBuffer}, \n @fn_gl{IsFramebuffer}, \n @fn_gl{IsProgram}, \n @fn_gl{IsProgramPipeline}, \n @fn_gl{IsQuery}, \n @fn_gl{IsRenderbuffer}, \n @fn_gl{IsSampler}, \n @fn_gl{IsShader}, \n @fn_gl{IsSync}, \n @fn_gl{IsTexture}, \n @fn_gl{IsTransformFeedback}, \n @fn_gl{IsVertexArray} | not needed, objects are strongly typed
@fn_gl{IsEnabled} | not queryable, @ref Renderer::setFeature() setter only
@fn_gl{LineWidth} | @ref Renderer::setLineWidth()
@fn_gl{LinkProgram} | @ref AbstractShaderProgram::link()
@fn_gl{LogicOp} | @ref Renderer::setLogicOperation()
@fn_gl{MapBuffer}, `glUnmapBuffer()`, \n @fn_gl_extension{MapNamedBuffer,EXT,direct_state_access}, @fn_gl_extension{UnmapNamedBuffer,EXT,direct_state_access}, \n @fn_gl{MapBufferRange}, \n @fn_gl_extension{MapNamedBufferRange,EXT,direct_state_access} | @ref Buffer::map(), @ref Buffer::unmap()
@fn_gl_extension{MapBufferSubData,CHROMIUM,map_sub}, @fn_gl_extension{UnmapBufferSubData,CHROMIUM,map_sub} | @ref Buffer::mapSub(), @ref Buffer::unmapSub()
@fn_gl{MemoryBarrier} | |
@fn_gl{MinSampleShading} | |
@fn_gl{MultiDrawArrays}, \n @fn_gl{MultiDrawArraysIndirect}, \n @fn_gl{MultiDrawElements}, \n @fn_gl{MultiDrawElementsBaseVertex}, \n @fn_gl{MultiDrawElementsIndirect} | |
@fn_gl{ObjectLabel}, \n @fn_gl{ObjectPtrLabel}, \n @fn_gl_extension2{LabelObject,EXT,debug_label} | @ref AbstractShaderProgram::setLabel(), \n @ref AbstractQuery::setLabel(), \n @ref AbstractTexture::setLabel(), \n @ref Buffer::setLabel(), \n @ref Framebuffer::setLabel(), \n @ref Mesh::setLabel(), \n @ref Renderbuffer::setLabel(), \n @ref Shader::setLabel()
@fn_gl{PatchParameter} | |
@fn_gl{PauseTransformFeedback}, @fn_gl{ResumeTransformFeedback} | |
@fn_gl{PixelStore} | |
@fn_gl{PointParameter} | |
@fn_gl{PointSize} | @ref Renderer::setPointSize()
@fn_gl{PolygonMode} | @ref Renderer::setPolygonMode()
@fn_gl{PolygonOffset} | @ref Renderer::setPolygonOffset()
@fn_gl{PrimitiveRestartIndex} | |
@fn_gl{ProgramBinary} | |
@fn_gl{ProgramParameter} | @ref AbstractShaderProgram::setRetrievableBinary(), \n @ref AbstractShaderProgram::setSeparable()
@fn_gl{ProvokingVertex} | @ref Renderer::setProvokingVertex()
@fn_gl{PushDebugGroup}, @fn_gl{PopDebugGroup} | |
@fn_gl{QueryCounter} | @ref TimeQuery::timestamp()
@fn_gl{ReadBuffer}, \n @fn_gl_extension{FramebufferReadBuffer,EXT,direct_state_access} | @ref DefaultFramebuffer::mapForRead(), \n @ref Framebuffer::mapForRead()
@fn_gl{ReadPixels}, \n @fn_gl_extension{ReadnPixels,ARB,robustness} | @ref DefaultFramebuffer::read(), \n @ref Framebuffer::read()
@fn_gl{ReleaseShaderCompiler} | |
@fn_gl{RenderbufferStorage}, \n @fn_gl_extension{NamedRenderbufferStorage,EXT,direct_state_access} | @ref Renderbuffer::setStorage()
@fn_gl{RenderbufferStorageMultisample}, \n @fn_gl_extension{NamedRenderbufferStorageMultisample,EXT,direct_state_access} | @ref Renderbuffer::setStorageMultisample()
@fn_gl{SampleCoverage} | |
@fn_gl{SampleMaski} | |
@fn_gl{SamplerParameter} | |
@fn_gl{Scissor} | @ref Renderer::setScissor()
@fn_gl{ScissorArray} | |
@fn_gl{ScissorIndexed} | |
@fn_gl{ShaderBinary} | |
@fn_gl{ShaderSource} | @ref Shader::addFile(), \n @ref Shader::addSource()
@fn_gl{ShaderStorageBlockBinding} | |
@fn_gl{StencilFunc}, \n @fn_gl{StencilFuncSeparate} | @ref Renderer::setStencilFunction()
@fn_gl{StencilMask}, \n @fn_gl{StencilMaskSeparate} | @ref Renderer::setStencilMask()
@fn_gl{StencilOp}, \n @fn_gl{StencilOpSeparate} | @ref Renderer::setStencilOperation()
@fn_gl{TexBuffer}, \n @fn_gl_extension{TextureBuffer,EXT,direct_state_access}, \n @fn_gl{TexBufferRange}, \n @fn_gl_extension{TextureBufferRange,EXT,direct_state_access} | @ref BufferTexture::setBuffer()
@fn_gl{TexImage1D}, \n @fn_gl_extension{TextureImage1D,EXT,direct_state_access} \n @fn_gl{TexImage2D}, \n @fn_gl_extension{TextureImage2D,EXT,direct_state_access}, \n @fn_gl{TexImage3D}, \n @fn_gl_extension{TextureImage3D,EXT,direct_state_access} | @ref Texture::setImage(), \n @ref CubeMapTexture::setImage(), \n @ref CubeMapTextureArray::setImage()
@fn_gl{TexImage2DMultisample}, \n @fn_gl{TexImage3DMultisample} | |
@fn_gl{TexParameter}, \n @fn_gl_extension{TextureParameter,EXT,direct_state_access} | @ref AbstractTexture::setMinificationFilter(), \n @ref AbstractTexture::setMagnificationFilter(), \n @ref AbstractTexture::setBorderColor(), \n @ref AbstractTexture::setMaxAnisotropy(), \n @ref Texture::setWrapping(), \n @ref CubeMapTexture::setWrapping(), \n @ref CubeMapTextureArray::setWrapping()
@fn_gl{TexStorage1D}, \n @fn_gl_extension{TextureStorage1D,EXT,direct_state_access}, \n @fn_gl{TexStorage2D}, \n @fn_gl_extension{TextureStorage2D,EXT,direct_state_access}, \n @fn_gl{TexStorage3D}, \n @fn_gl_extension{TextureStorage3D,EXT,direct_state_access} | @ref Texture::setStorage(), \n @ref CubeMapTexture::setStorage(), \n @ref CubeMapTextureArray::setStorage()
@fn_gl{TexStorage2DMultisample}, \n @fn_gl{TexStorage3DMultisample} | |
@fn_gl{TexSubImage1D}, \n @fn_gl_extension{TextureSubImage1D,EXT,direct_state_access}, \n @fn_gl{TexSubImage2D}, \n @fn_gl_extension{TextureSubImage2D,EXT,direct_state_access}, \n @fn_gl{TexSubImage3D}, \n @fn_gl_extension{TextureSubImage3D,EXT,direct_state_access} | @ref Texture::setSubImage(), \n @ref CubeMapTexture::setSubImage(), \n @ref CubeMapTextureArray::setSubImage()
@fn_gl{TextureView} | |
@fn_gl{TransformFeedbackVaryings} | |
@fn_gl{Uniform}, \n @fn_gl{ProgramUniform}, \n @fn_gl_extension{ProgramUniform,EXT,direct_state_access} | @ref AbstractShaderProgram::setUniform()
@fn_gl{UniformBlockBinding} | |
@fn_gl{UniformSubroutines} | |
@fn_gl{UseProgram} | @ref AbstractShaderProgram::use()
@fn_gl{UseProgramStages} | |
@fn_gl{ValidateProgram} | @ref AbstractShaderProgram::validate()
@fn_gl{ValidateProgramPipeline} | |
@fn_gl{VertexAttrib} | not supported (@ref opengl-unsupported "details")
@fn_gl{VertexAttribBinding} | |
@fn_gl{VertexAttribDivisor} | |
@fn_gl{VertexAttribFormat} | |
@fn_gl{VertexAttribPointer}, \n @fn_gl_extension{VertexArrayVertexAttribOffset,EXT,direct_state_access} | @ref Mesh::addVertexBuffer()
@fn_gl{VertexBindingDivisor} | |
@fn_gl{Viewport} | @ref DefaultFramebuffer::setViewport(), \n @ref Framebuffer::setViewport()
@fn_gl{ViewportArray} | |
@fn_gl{ViewportIndexed} | |
@fn_gl{WaitSync} | |
@section opengl-mapping-state Limit and state queries
@todo Things marked only as *not queryable* should have at least setter
@fn_gl{Get} parameter | Matching API
-------------------------------------- | ------------
@def_gl{ACTIVE_TEXTURE}, \n @def_gl{TEXTURE_BINDING_1D_ARRAY}, \n @def_gl{TEXTURE_BINDING_1D}, \n @def_gl{TEXTURE_BINDING_2D_ARRAY}, \n @def_gl{TEXTURE_BINDING_2D_MULTISAMPLE_ARRAY}, \n @def_gl{TEXTURE_BINDING_2D_MULTISAMPLE}, \n @def_gl{TEXTURE_BINDING_2D} , \n @def_gl{TEXTURE_BINDING_3D}, \n @def_gl{TEXTURE_BINDING_BUFFER}, \n @def_gl{TEXTURE_BINDING_BUFFER}, \n @def_gl{TEXTURE_BINDING_CUBE_MAP}, \n @def_gl{TEXTURE_BINDING_RECTANGLE} | not queryable but tracked internally
@def_gl{ALIASED_LINE_WIDTH_RANGE} | |
@def_gl{ARRAY_BUFFER_BINDING}, \n @def_gl{DISPATCH_INDIRECT_BUFFER_BINDING}, \n @def_gl{ELEMENT_ARRAY_BUFFER_BINDING}, \n @def_gl{PIXEL_PACK_BUFFER_BINDING}, \n @def_gl{PIXEL_UNPACK_BUFFER_BINDING} | not queryable but tracked internally
@def_gl{BLEND_COLOR} | not queryable, @ref Renderer::setBlendColor() setter only
@def_gl{BLEND_DST_ALPHA}, \n @def_gl{BLEND_DST_RGB}, \n @def_gl{BLEND_SRC_ALPHA}, \n @def_gl{BLEND_SRC_RGB} | not queryable, @ref Renderer::setBlendFunction() setter only
@def_gl{BLEND_EQUATION_ALPHA}, \n @def_gl{BLEND_EQUATION_RGB} | not queryable, @ref Renderer::setBlendEquation() setter only
@def_gl{BLEND}, \n @def_gl{COLOR_LOGIC_OP}, \n @def_gl{CULL_FACE}, \n @def_gl{DEBUG_OUTPUT}, \n @def_gl{DEBUG_OUTPUT_SYNCHRONOUS}, \n @def_gl{DEPTH_CLAMP}, \n @def_gl{DEPTH_TEST}, \n @def_gl{DITHER}, \n @def_gl{MULTISAMPLE}, \n @def_gl{POLYGON_OFFSET_FILL}, \n @def_gl{POLYGON_OFFSET_LINE}, \n @def_gl{POLYGON_OFFSET_POINT}, \n @def_gl{PROGRAM_POINT_SIZE}, \n @def_gl{SCISSOR}, \n @def_gl{TEXTURE_CUBE_MAP_SEAMLESS}, \n @def_gl{STENCIL_TEST} | not queryable, @ref Renderer::setFeature() setter only
@def_gl{COLOR_CLEAR_VALUE}, \n @def_gl{DEPTH_CLEAR_VALUE}, \n @def_gl{STENCIL_CLEAR_VALUE} | not queryable, @ref Renderer::setClearColor(), \n @ref Renderer::setClearDepth() and \n @ref Renderer::setClearStencil() setters only
@def_gl{COLOR_WRITEMASK}, \n @def_gl{DEPTH_WRITEMASK}, \n @def_gl{STENCIL_BACK_WRITEMASK}, \n @def_gl{STENCIL_WRITEMASK} | not queryable, @ref Renderer::setColorMask(), \n @ref Renderer::setDepthMask() and \n @ref Renderer::setStencilMask() setters only
@def_gl{COMPRESSED_TEXTURE_FORMATS} | |
@def_gl{CONTEXT_FLAGS} | @ref Context::flags()
@def_gl{CURRENT_PROGRAM} | not queryable but tracked internally
@def_gl{DEBUG_GROUP_STACK_DEPTH} | |
@def_gl{DEPTH_FUNC} | not queryable, @ref Renderer::setDepthFunction() setter only
@def_gl{DEPTH_RANGE} | not queryable
@def_gl{DOUBLEBUFFER}, \n @def_gl{STEREO} | |
@def_gl{DRAW_BUFFERi}, \n @def_gl{DRAW_BUFFER}, \n @def_gl{READ_BUFFER} | not queryable, @ref DefaultFramebuffer::mapForDraw(), \n @ref DefaultFramebuffer::mapForRead(), \n @ref Framebuffer::mapForDraw() and \n @ref Framebuffer::mapForRead() setters only
@def_gl{DRAW_FRAMEBUFFER_BINDING}, \n @def_gl{READ_FRAMEBUFFER_BINDING} | not queryable but tracked internally
@def_gl{FRAGMENT_SHADER_DERIVATIVE_HINT}, \n @def_gl{LINE_SMOOTH_HINT}, \n @def_gl{POLYGON_SMOOTH_HINT}, \n @def_gl{TEXTURE_COMPRESSION_HINT} | not queryable
@def_gl{IMPLEMENTATION_COLOR_READ_FORMAT} | |
@def_gl{IMPLEMENTATION_COLOR_READ_TYPE} | |
@def_gl{LAYER_PROVOKING_VERTEX} | |
@def_gl{LINE_SMOOTH}, \n @def_gl{POLYGON_SMOOTH} | not supported (@ref opengl-unsupported "details")
@def_gl{LINE_WIDTH_GRANULARITY}, \n @def_gl{LINE_WIDTH_RANGE} | |
@def_gl{LINE_WIDTH} | not queryable, @ref Renderer::setLineWidth() setter only
@def_gl{LOGIC_OP_MODE} | not queryable, @ref Renderer::setLogicOperation() setter only
@def_gl{MAJOR_VERSION}, \n @def_gl{MINOR_VERSION} | @ref Context::version()
`GL_MAX_*_ATOMIC_COUNTER_BUFFERS`, \n @def_gl{MAX_COMBINED_ATOMIC_COUNTER_BUFFERS} | @ref Shader::maxAtomicCounterBuffers(), \n @ref Shader::maxCombinedAtomicCounterBuffers()
`GL_MAX_*_ATOMIC_COUNTERS`, \n @def_gl{MAX_COMBINED_ATOMIC_COUNTERS} | @ref Shader::maxAtomicCounters(), \n @ref Shader::maxCombinedAtomicCounters()
`GL_MAX_*_IMAGE_UNIFORMS`, \n @def_gl{MAX_COMBINED_IMAGE_UNIFORMS} | @ref Shader::maxImageUniforms(), \n @ref Shader::maxCombinedImageUniforms()
`GL_MAX_*_SHADER_STORAGE_BLOCKS`, \n @def_gl{MAX_COMBINED_SHADER_STORAGE_BLOCKS} | @ref Shader::maxShaderStorageBlocks(), \n @ref Shader::maxCombinedShaderStorageBlocks()
`GL_MAX_*_TEXTURE_IMAGE_UNITS`, \n @def_gl{MAX_TEXTURE_IMAGE_UNITS}, \n @def_gl{MAX_COMBINED_TEXTURE_IMAGE_UNITS} | @ref Shader::maxTextureImageUnits(), \n @ref Shader::maxCombinedTextureImageUnits()
`GL_MAX_*_UNIFORM_BLOCKS`, \n @def_gl{MAX_COMBINED_UNIFORM_BLOCKS} | @ref Shader::maxUniformBlocks(), \n @ref Shader::maxCombinedUniformBlocks()
`GL_MAX_*_UNIFORM_COMPONENTS`, \n @def_gl{MAX_VERTEX_UNIFORM_VECTORS}, \n @def_gl{MAX_FRAGMENT_UNIFORM_VECTORS} | @ref Shader::maxUniformComponents()
`GL_MAX_COMBINED_*_UNIFORM_COMPONENTS` | @ref Shader::maxCombinedUniformComponents()
@def_gl{MAX_3D_TEXTURE_SIZE}, \n @def_gl{MAX_ARRAY_TEXTURE_LAYERS}, \n @def_gl{MAX_CUBE_MAP_TEXTURE_SIZE}, \n @def_gl{MAX_RECTANGLE_TEXTURE_SIZE}, \n @def_gl{MAX_TEXTURE_SIZE} | |
@def_gl{MAX_ATOMIC_COUNTER_BUFFER_SIZE} | @ref AbstractShaderProgram::maxAtomicCounterBufferSize()
@def_gl{MAX_ATOMIC_COUNTER_BUFFER_BINDINGS} | @ref Buffer::maxAtomicCounterBindings()
@def_gl{MAX_COLOR_ATTACHMENTS} | @ref Framebuffer::maxColorAttachments()
@def_gl{MAX_COMBINED_SHADER_OUTPUT_RESOURCES} | @ref AbstractShaderProgram::maxCombinedShaderOutputResources()
@def_gl{MAX_COMPUTE_SHARED_MEMORY_SIZE} | @ref AbstractShaderProgram::maxComputeSharedMemorySize()
@def_gl{MAX_COMPUTE_WORK_GROUP_COUNT} | |
@def_gl{MAX_COMPUTE_WORK_GROUP_INVOCATIONS} | @ref AbstractShaderProgram::maxComputeWorkGroupInvocations()
@def_gl{MAX_COMPUTE_WORK_GROUP_SIZE} | |
@def_gl{MAX_DEBUG_LOGGED_MESSAGES} | @ref DebugMessage::maxLoggedMessages()
@def_gl{MAX_DEBUG_MESSAGE_LENGTH} | @ref DebugMessage::maxMessageLength()
@def_gl{MAX_DEBUG_GROUP_STACK_DEPTH} | |
@def_gl{MAX_CLIP_DISTANCES} | |
@def_gl{MAX_COLOR_TEXTURE_SAMPLES}, \n @def_gl{MAX_DEPTH_TEXTURE_SAMPLES}, \n @def_gl{MAX_INTEGER_SAMPLES} | @ref AbstractTexture::maxColorSamples(), \n @ref AbstractTexture::maxDepthSamples(), \n @ref AbstractTexture::maxIntegerSamples()
@def_gl{MAX_DRAW_BUFFERS} | @ref AbstractFramebuffer::maxDrawBuffers()
@def_gl{MAX_DUAL_SOURCE_DRAW_BUFFERS} | @ref AbstractFramebuffer::maxDualSourceDrawBuffers()
@def_gl{MAX_ELEMENTS_INDICES} | @ref Mesh::maxElementsIndices()
@def_gl{MAX_ELEMENTS_VERTICES} | @ref Mesh::maxElementsVertices()
@def_gl{MAX_ELEMENT_INDEX} | |
@def_gl{MAX_FRAMEBUFFER_HEIGHT} | |
@def_gl{MAX_FRAMEBUFFER_LAYERS} | |
@def_gl{MAX_FRAMEBUFFER_SAMPLES} | |
@def_gl{MAX_FRAMEBUFFER_WIDTH} | |
@def_gl{MAX_FRAGMENT_INPUT_COMPONENTS}, \n @def_gl{MAX_GEOMETRY_INPUT_COMPONENTS}, \n @def_gl{MAX_GEOMETRY_OUTPUT_COMPONENTS}, \n @def_gl{MAX_GEOMETRY_TOTAL_OUTPUT_COMPONENTS}, \n @def_gl{MAX_TESS_CONTROL_INPUT_COMPONENTS}, \n @def_gl{MAX_TESS_CONTROL_OUTPUT_COMPONENTS}, \n @def_gl{MAX_TESS_CONTROL_TOTAL_OUTPUT_COMPONENTS}, \n @def_gl{MAX_TESS_EVALUATION_INPUT_COMPONENTS}, \n @def_gl{MAX_TESS_EVALUATION_OUTPUT_COMPONENTS}, \n @def_gl{MAX_VERTEX_OUTPUT_COMPONENTS}, \n @def_gl{MAX_VARYING_COMPONENTS}, \n @def_gl{MAX_VARYING_FLOATS}, \n @def_gl{MAX_VARYING_VECTORS} | @ref Shader::maxFragmentInputComponents(), \n @ref Shader::maxGeometryInputComponents(), \n @ref Shader::maxGeometryOutputComponents(), \n @ref Shader::maxGeometryTotalOutputComponents(), \n @ref Shader::maxTessellationControlInputComponents(), \n @ref Shader::maxTessellationControlOutputComponents(), \n @ref Shader::maxTessellationControlTotalOutputComponents(), \n @ref Shader::maxTessellationEvaluationInputComponents(), \n @ref Shader::maxTessellationEvaluationOutputComponents(), \n @ref Shader::maxVertexOutputComponents()
@def_gl{MAX_IMAGE_SAMPLES} | @ref AbstractShaderProgram::maxImageSamples()
@def_gl{MAX_IMAGE_UNITS} | @ref AbstractShaderProgram::maxImageUnits()
@def_gl{MAX_LABEL_LENGTH} | @ref AbstractObject::maxLabelLength()
@def_gl{MAX_RENDERBUFFER_SIZE} | @ref Renderbuffer::maxSize()
@def_gl{MAX_SAMPLE_MASK_WORDS} | |
@def_gl{MAX_SERVER_WAIT_TIMEOUT} | |
@def_gl{MAX_SHADER_STORAGE_BLOCK_SIZE} | @ref AbstractShaderProgram::maxShaderStorageBlockSize()
@def_gl{MAX_SHADER_STORAGE_BUFFER_BINDINGS} | @ref Buffer::maxShaderStorageBindings()
@def_gl{MAX_TEXTURE_BUFFER_SIZE} | |
@def_gl_extension{MAX_TEXTURE_MAX_ANISOTROPY,EXT,texture_filter_anisotropic} | @ref Sampler::maxMaxAnisotropy()
@def_gl{MAX_TEXTURE_LOD_BIAS} | |
@def_gl{MAX_UNIFORM_BLOCK_SIZE} | @ref AbstractShaderProgram::maxUniformBlockSize()
@def_gl{MAX_UNIFORM_BUFFER_BINDINGS} | @ref Buffer::maxUniformBindings()
@def_gl{MAX_UNIFORM_LOCATIONS} | @ref AbstractShaderProgram::maxUniformLocations()
@def_gl{MAX_VERTEX_ATTRIBS} | @ref AbstractShaderProgram::maxVertexAttributes()
@def_gl{MAX_VERTEX_ATTRIB_BINDINGS} | @ref Buffer::maxVertexAttributeBindings()
@def_gl{MAX_VERTEX_ATTRIB_RELATIVE_OFFSET} | |
@def_gl{MAX_VIEWPORTS} | |
@def_gl{MAX_VIEWPORT_DIMS} | @ref AbstractFramebuffer::maxViewportSize()
@def_gl{MIN_MAP_BUFFER_ALIGNMENT} | @ref Buffer::minMapAlignment()
@def_gl{MIN_PROGRAM_TEXEL_OFFSET}, \n @def_gl{MAX_PROGRAM_TEXEL_OFFSET} | @ref AbstractShaderProgram::minTexelOffset(), \n @ref AbstractShaderProgram::maxTexelOffset()
@def_gl{NUM_COMPRESSED_TEXTURE_FORMATS} | |
@def_gl{NUM_EXTENSIONS} | @ref Context::supportedExtensions()
@def_gl{NUM_PROGRAM_BINARY_FORMATS}, \n @def_gl{PROGRAM_BINARY_FORMATS} | |
@def_gl{NUM_SHADER_BINARY_FORMATS}, \n @def_gl{SHADER_BINARY_FORMATS} | |
@def_gl{PACK_ALIGNMENT}, \n @def_gl{PACK_IMAGE_HEIGHT}, \n @def_gl{PACK_LSB_FIRST}, \n @def_gl{PACK_ROW_LENGTH}, \n @def_gl{PACK_SKIP_IMAGES}, \n @def_gl{PACK_SKIP_PIXELS}, \n @def_gl{PACK_SKIP_ROWS}, \n @def_gl{PACK_SWAP_BYTES}, \n @def_gl{UNPACK_ALIGNMENT}, \n @def_gl{UNPACK_IMAGE_HEIGHT}, \n @def_gl{UNPACK_LSB_FIRST}, \n @def_gl{UNPACK_ROW_LENGTH}, \n @def_gl{UNPACK_SKIP_IMAGES}, \n @def_gl{UNPACK_SKIP_PIXELS}, \n @def_gl{UNPACK_SKIP_ROWS}, \n @def_gl{UNPACK_SWAP_BYTES} | not queryable
@def_gl{POINT_FADE_THRESHOLD_SIZE} | |
@def_gl{POINT_SIZE_GRANULARITY}, \n @def_gl{POINT_SIZE_RANGE} | |
@def_gl{POINT_SIZE} | not queryable, @ref Renderer::setPointSize() setter only
@def_gl{POLYGON_OFFSET_FACTOR}, \n @def_gl{POLYGON_OFFSET_UNITS} | not queryable, @ref Renderer::setPolygonOffset() setter only
@def_gl{PRIMITIVE_RESTART_INDEX} | not queryable
@def_gl{PROGRAM_PIPELINE_BINDING} | not queryable
@def_gl{PROVOKING_VERTEX} | not queryable, @ref Renderer::setProvokingVertex() setter only
@def_gl{RENDERBUFFER_BINDING} | not queryable but tracked internally
@def_gl{SAMPLER_BINDING} | not queryable
@def_gl{SAMPLES} | @ref Renderbuffer::maxSamples()
@def_gl{SAMPLE_BUFFERS} | |
@def_gl{SAMPLE_COVERAGE_INVERT}, \n @def_gl{SAMPLE_COVERAGE_VALUE} | |
@def_gl{SCISSOR_BOX} | not queryable, @ref Renderer::setScissor() setter only
@def_gl{SHADER_COMPILER} | not supported (@ref opengl-unsupported "details")
@def_gl{SHADER_STORAGE_BUFFER_BINDING}, \n @def_gl{SHADER_STORAGE_BUFFER_SIZE}, \n @def_gl{SHADER_STORAGE_BUFFER_START} | not queryable
@def_gl{SHADER_STORAGE_BUFFER_OFFSET_ALIGNMENT} | @ref Buffer::shaderStorageOffsetAlignment()
@def_gl{SMOOTH_LINE_WIDTH_GRANULARITY}, \n @def_gl{SMOOTH_LINE_WIDTH_RANGE} | |
@def_gl{STENCIL_BACK_FUNC}, \n @def_gl{STENCIL_BACK_REF}, \n @def_gl{STENCIL_BACK_VALUE_MASK}, \n @def_gl{STENCIL_FUNC}, \n @def_gl{STENCIL_REF}, \n @def_gl{STENCIL_VALUE_MASK} | not queryable, @ref Renderer::setStencilFunction() setter only
@def_gl{STENCIL_BACK_FAIL}, \n @def_gl{STENCIL_BACK_PASS_DEPTH_FAIL}, \n @def_gl{STENCIL_BACK_PASS_DEPTH_PASS}, \n @def_gl{STENCIL_FAIL}, \n @def_gl{STENCIL_PASS_DEPTH_FAIL}, \n @def_gl{STENCIL_PASS_DEPTH_PASS} | not queryable, @ref Renderer::setStencilOperation() setter only
@def_gl{SUBPIXEL_BITS} | |
@def_gl{TEXTURE_BUFFER_OFFSET_ALIGNMENT} | @ref BufferTexture::offsetAlignment()
@def_gl{TIMESTAMP} | |
@def_gl{TRANSFORM_FEEDBACK_BUFFER_BINDING}, \n @def_gl{TRANSFORM_FEEDBACK_BUFFER_SIZE}, \n @def_gl{TRANSFORM_FEEDBACK_BUFFER_START} | not queryable
@def_gl{UNIFORM_BUFFER_OFFSET_ALIGNMENT} | |
@def_gl{UNIFORM_BUFFER_BINDING}, \n @def_gl{UNIFORM_BUFFER_SIZE}, \n @def_gl{UNIFORM_BUFFER_START} | not queryable
@def_gl{VERTEX_BINDING_DIVISOR}, \n @def_gl{VERTEX_BINDING_OFFSET}, \n @def_gl{VERTEX_BINDING_STRIDE} | not queryable
@def_gl{VERTEX_PROGRAM_POINT_SIZE} | not queryable
@def_gl{VIEWPORT_BOUNDS_RANGE} | |
@def_gl{VIEWPORT_INDEX_PROVOKING_VERTEX} | |
@def_gl{VIEWPORT_SUBPIXEL_BITS} | |
@def_gl{VIEWPORT} | not queryable but tracked in @ref AbstractFramebuffer::viewport()
*/
}

342
doc/opengl-support.dox

@ -0,0 +1,342 @@
/*
This file is part of Magnum.
Copyright © 2010, 2011, 2012, 2013 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.
*/
/** @page opengl-support OpenGL support state
@brief List of (un)supported OpenGL features and extensions.
@tableofcontents
@section opengl-support-state OpenGL implementation state
The extension implementation is considered complete if all its defined types,
functions and enum values are exposed through the API, except for features
listed below in @ref opengl-unsupported-features.
@subsection opengl-support-21 OpenGL 2.1
The core subset of OpenGL 2.1 should be fully implemented, except for the
following:
- Pixel store state (@fn_gl{PixelStore} function)
- Compressed texture upload
- Proxy textures
- Copying framebuffer to texture (@fn_gl{CopyTexImage2D} etc.)
- Some forgotten limit queries
@subsection opengl-support-30 OpenGL 3.0
@todo @extension{APPLE,flush_buffer_range} doesn't add anything to @extension{ARB,map_buffer_range}
@todo @extension{EXT,texture_array} overlaps with @extension{ARB,framebuffer_object}
%Extension | Status
-------------------------------------------- | ------
@extension{APPLE,flush_buffer_range} | done (GL 3.0 subset)
@extension{APPLE,vertex_array_object} | done (GL 3.0 subset)
@extension{ARB,map_buffer_range} | done
@extension{ARB,color_buffer_float} | |
@extension{ARB,half_float_pixel} | done
@extension{ARB,texture_float} | done
@extension{ARB,depth_buffer_float} | done
@extension{ARB,texture_rg} | done
@extension{ARB,framebuffer_object} | missing texture layer attachments
@extension{EXT,gpu_shader4} | done
@extension{EXT,packed_float} | done
@extension{EXT,texture_array} | missing texture layer attachments
@extension{EXT,texture_compression_rgtc} | done
@extension{EXT,texture_shared_exponent} | done
@extension{EXT,framebuffer_sRGB} | |
@extension{EXT,draw_buffers2} | |
@extension{EXT,texture_integer} | missing integer color specification functions
@extension{EXT,transform_feedback} | |
@extension{NV,half_float} | done (GL 3.0 subset)
@extension{NV,depth_buffer_float} | |
@extension{NV,conditional_render} | done
@subsection opengl-support-31 OpenGL 3.1
%Extension | Status
-------------------------------------------- | ------
@extension{ARB,texture_rectangle} | missing limit query
@extension{ARB,draw_instanced} | |
@extension{ARB,texture_buffer_object} | missing limit query
@extension{ARB,uniform_buffer_object} | |
@extension{ARB,copy_buffer} | done
@extension{EXT,texture_snorm} | done
@extension{NV,primitive_restart} | |
@subsection opengl-support-32 OpenGL 3.2
%Extension | Status
-------------------------------------------- | ------
@extension{ARB,geometry_shader4} | done (GL 3.2 subset)
@extension{ARB,depth_clamp} | done
@extension{ARB,draw_elements_base_vertex} | |
@extension{ARB,fragment_coord_conventions} | done (shading language only)
@extension{ARB,provoking_vertex} | done
@extension{ARB,seamless_cube_map} | done
@extension{ARB,sync} | |
@extension{ARB,texture_multisample} | |
@extension{ARB,vertex_array_bgra} | done
@subsection opengl-support-33 OpenGL 3.3
%Extension | Status
-------------------------------------------- | ------
@extension{ARB,instanced_arrays} | |
@extension{ARB,blend_func_extended} | missing limit query
@extension{ARB,explicit_attrib_location} | done (shading language only)
@extension{ARB,occlusion_query2} | done
@extension{ARB,sampler_objects} | |
@extension{ARB,shader_bit_encoding} | done (shading language only)
@extension{ARB,texture_rgb10_a2ui} | done
@extension{ARB,texture_swizzle} | |
@extension{ARB,timer_query} | missing direct query
@extension{ARB,vertex_type_2_10_10_10_rev} | done
@subsection opengl-support-40 OpenGL 4.0
%Extension | Status
-------------------------------------------- | ------
@extension{ARB,draw_buffers_blend} | |
@extension{ARB,sample_shading} | |
@extension{ARB,texture_cube_map_array} | done
@extension{ARB,texture_gather} | missing limit queries
@extension{ARB,texture_query_lod} | done (shading language only)
@extension{ARB,draw_indirect} | |
@extension{ARB,gpu_shader5} | missing limit queries
@extension{ARB,gpu_shader_fp64} | done
@extension{ARB,shader_subroutine} | |
@extension{ARB,tessellation_shader} | missing some limit queries and patch parameter specification function
@extension{ARB,texture_buffer_object_rgb32} | done
@extension{ARB,transform_feedback2} | |
@extension{ARB,transform_feedback3} | |
@subsection opengl-support-41 OpenGL 4.1
%Extension | Status
-------------------------------------------- | ------
@extension{ARB,ES2_compatibility} | only float depth clear
@extension{ARB,get_program_binary} | |
@extension{ARB,separate_shader_objects} | |
@extension{ARB,shader_precision} | done (shading language only)
@extension{ARB,vertex_attrib_64bit} | done
@extension{ARB,viewport_array} | |
@subsection opengl-support-42 OpenGL 4.2
%Extension | Status
-------------------------------------------- | ------
@extension{ARB,texture_compression_bptc} | done
@extension{ARB,base_instance} | |
@extension{ARB,shading_language_420pack} | done (shading language only)
@extension{ARB,transform_feedback_instanced} | |
@extension{ARB,compressed_texture_pixel_storage} | |
@extension{ARB,conservative_depth} | done (shading language only)
@extension{ARB,internalformat_query} | |
@extension{ARB,map_buffer_alignment} | done
@extension{ARB,shader_atomic_counters} | |
@extension{ARB,shader_image_load_store} | |
@extension{ARB,shading_language_packing} | done (shading language only)
@extension{ARB,texture_storage} | done
@subsection opengl-support-43 OpenGL 4.3
%Extension | Status
-------------------------------------------- | ------
@extension{ARB,arrays_of_arrays} | done (shading language only)
@extension{ARB,ES3_compatibility} | only conservative sample query
@extension{ARB,clear_buffer_object} | |
@extension{ARB,compute_shader} | |
@extension{ARB,copy_image} | |
@extension{KHR,debug} (also in ES) | missing log control and retrieval, sync, pipeline, transform feedback and sampler label and debug groups
@extension{ARB,explicit_uniform_location} | done
@extension{ARB,fragment_layer_viewport} | done (shading language only)
@extension{ARB,framebuffer_no_attachments} | |
@extension{ARB,internalformat_query2} | |
@extension{ARB,invalidate_subdata} | done
@extension{ARB,multi_draw_indirect} | |
@extension{ARB,program_interface_query} | |
@extension{ARB,robust_buffer_access_behavior} | done (nothing to do)
@extension{ARB,shader_image_size} | done (shading language only)
@extension{ARB,shader_storage_buffer_object} | only limit queries
@extension{ARB,stencil_texturing} | |
@extension{ARB,texture_buffer_range} | done
@extension{ARB,texture_query_levels} | done (shading language only)
@extension{ARB,texture_storage_multisample} | |
@extension{ARB,texture_view} | |
@extension{ARB,vertex_attrib_binding} | |
@subsection opengl-support-44 OpenGL 4.4
%Extension | Status
-------------------------------------------- | ------
@extension{ARB,buffer_storage} | |
@extension{ARB,clear_texture} | |
@extension{ARB,enhanced_layouts} | done (shading language only)
@extension{ARB,multi_bind} | |
@extension{ARB,query_buffer_object} | |
@extension{ARB,texture_mirror_clamp_to_edge} | done
@extension{ARB,texture_stencil8} | done
@extension{ARB,vertex_type_10f_11f_11f_rev} | |
@subsection opengl-support-extensions OpenGL extensions
%Extension | Status
-------------------------------------------- | ------
@extension{AMD,vertex_shader_layer} | done (shading language only)
@extension{AMD,shader_trinary_minmax} | done (shading language only)
@extension{ARB,robustness} | done
@extension{ATI,texture_mirror_once} | done (GL 4.4 subset)
@extension{EXT,texture_filter_anisotropic} (also in ES) | done
@extension{EXT,texture_mirror_clamp} | only GL 4.4 subset
@extension{EXT,direct_state_access} | done for implemented functionality
@extension2{EXT,debug_label} (also in ES) | missing pipeline, transform feedback and sampler label
@extension2{EXT,debug_marker} (also in ES) | missing marker groups
@extension{GREMEDY,string_marker} | done
@subsection opengl-support-es20 OpenGL ES 2.0
Features that have their equivalents implemented in desktop version are
supported.
@subsection opengl-support-es30 OpenGL ES 3.0
Features that have their equivalents implemented in desktop version are
supported.
@subsection opengl-support-es30-extensions OpenGL ES 2.0 extensions to match ES 3.0 functionality
%Extension | Status
-------------------------------------------- | ------
@es_extension{ANGLE,framebuffer_blit} | done
@es_extension{ANGLE,framebuffer_multisample} | done
@es_extension{ANGLE,depth_texture} | done
@es_extension{APPLE,framebuffer_multisample} | done (ES 3.0 subset)
@es_extension{ARM,rgba8} | done
@es_extension{EXT,texture_type_2_10_10_10_REV} | done
@es_extension{EXT,discard_framebuffer} | done
@es_extension2{EXT,blend_minmax,blend_minmax} | done
@es_extension{EXT,occlusion_query_boolean} | done
@es_extension{EXT,texture_rg} | done
@es_extension{EXT,texture_storage} | done
@es_extension{EXT,map_buffer_range} | done
@es_extension{NV,draw_buffers} | done
@es_extension{NV,fbo_color_attachments} | done
@es_extension{NV,read_buffer} | done
@es_extension{NV,framebuffer_blit} | done
@es_extension{NV,framebuffer_multisample} | done
@es_extension{OES,depth24} | done
@es_extension{OES,element_index_uint} | done
@es_extension{OES,rgb8_rgba8} | done (desktop-compatible subset)
@es_extension2{OES,texture_half_float_linear,OES_texture_float_linear} | done
@es_extension{OES,texture_float_linear} | done
@es_extension2{OES,texture_half_float,OES_texture_float} | done
@es_extension{OES,texture_float} | done
@es_extension{OES,vertex_half_float} | done
@es_extension{OES,packed_depth_stencil} | done
@es_extension{OES,depth_texture} | done
@es_extension{OES,standard_derivatives} | done
@es_extension{OES,vertex_array_object} | done
@es_extension{OES,required_internalformat} | done (desktop-compatible subset)
@es_extension{OES,surfaceless_context} | done
@subsection opengl-support-es-extensions OpenGL ES extensions to match desktop functionality
Only extensions not already listed in above tables are included here.
%Extension | Status
-------------------------------------------- | ------
@es_extension{APPLE,texture_format_BGRA8888} | done
@es_extension{CHROMIUM,map_sub} | only buffer mapping
@es_extension{EXT,texture_format_BGRA8888} | done
@es_extension{EXT,read_format_bgra} | done
@es_extension{EXT,disjoint_timer_query} | only time elapsed query
@es_extension{EXT,separate_shader_objects} | |
@es_extension{EXT,sRGB} | done
@es_extension{EXT,multisampled_render_to_texture} | only renderbuffer storage
@es_extension{EXT,robustness} | done
@es_extension2{NV,read_buffer_front,NV_read_buffer} | done
@es_extension2{NV,read_depth,NV_read_depth_stencil} | done
@es_extension2{NV,read_stencil,NV_read_depth_stencil} | done
@es_extension{NV,read_depth_stencil} | done
@es_extension{NV,texture_border_clamp} | done
@es_extension{OES,depth32} | done
@es_extension{OES,mapbuffer} | done
@es_extension{OES,stencil1} | done
@es_extension{OES,stencil4} | done
@es_extension{OES,texture_3D} | missing limit query
@section opengl-unsupported Unsupported OpenGL features
Some functionality, which is either soon-to-be deprecated or isn't proven to
add any performance gains, is not supported in %Magnum. See also
@ref opengl-deprecated.
@subsection opengl-unsupported-features Unsupported features
- State queries (various `glIs*()`, `glGet*()` functions) are not supported.
%Magnum API is designed to prevent the need for majority of them, many of
them are tracked internally to avoid redundant state changes and in many
cases it is easier to set the state to some value rather than query it and
then decide on the result. For detailed state introspection please use
external debugger (such as ApiTrace), which is more convenient to use than
manual queries. Queries of implementation-defined values (various limits
etc.) and queries of generated values (buffer data, texture data) are
supported.
- Line and polygon smoothing (`GL_LINE_SMOOTH`, `GL_POLYGON_SMOOTH`) and
related functions are not supported, as the driver might do it in software
with serious performance drops. Multisampling is far superior solution.
- Fixed precision data types (`GL_FIXED` in OpenGL ES) are not supported, as
they occupy the same memory as floats and they aren't faster than floats on
current hardware anymore.
- Shader compiler is assumed to be present (`GL_SHADER_COMPILER` returning
true), as all desktop GL implementations and also ES3 are required to
support it.
- Querying shader attribute locations (as opposed to setting them) is not
supported, as newer GL versions encourage setting them explicitly in shader
code.
- Direct vertex data specification (as opposed to using buffers) is not
supported, as it encourages bad practices.
@subsection opengl-unsupported-extensions Unsupported extensions
- @extension{INTEL,map_texture} negatively affects texture access performance.
Combination of buffer mapping and pixel buffers might be of the same or
better performance, without affecting texture access speed.
- @extension{NV,draw_texture} can be done with framebuffer blitting and
doesn't make any full-screen postprocessing easier, as shaders are excluded.
*/
/** @page opengl-deprecated Deprecated OpenGL API list
See also @ref opengl-unsupported and @ref deprecated.
*/
/** @page deprecated Deprecated list
See also @ref opengl-deprecated.
*/

37
doc/required-extensions.dox → doc/opengl.dox

@ -22,21 +22,28 @@
DEALINGS IN THE SOFTWARE.
*/
/** @page required-extensions Functionality requiring specific OpenGL version or extensions
@brief List of functions not available on OpenGL 2.1 / OpenGL ES 2.
/** @page opengl OpenGL
@brief State of OpenGL support, version and extension requirements.
The engine is meant to be run on OpenGL 3 capable hardware, but most of the
functionality is working in OpenGL 2.1 hardware too (i.e. integrated Intel
GPUs), unless stated otherwise. OpenGL ES is also supported.
The following table maps OpenGL function names to %Magnum API, useful for
developers with existing OpenGL background. Note that, as reverse mapping, each
function documentation also contains list of OpenGL functions used.
@see @ref building, @ref cmake, @ref MAGNUM_TARGET_GLES,
@ref MAGNUM_TARGET_GLES2
- @subpage opengl-mapping
State of implementation of particular OpenGL versions and extensions is in the
following table.
- @subpage opengl-support
Following are lists of functionality requiring specific OpenGL version. In
most cases it is also specified which extension is required for given
functionality, so if given hardware supports required extension, it doesn't
need to have required OpenGL version too (e.g. `APPLE_vertex_array_object` is
supported on Intel GPUs even if they are capable of OpenGL 2.1 only).
@section opengl-required-extensions Version and extension requirements
The engine requires at least OpenGL 2.1 or OpenGL ES 2.0, but some specific
functionality has greater requirements. Following are lists of features
requiring specific OpenGL version. In most cases it is also specified which
extension is required, so if given hardware supports required extension, it
doesn't need to have required OpenGL version too (e.g. `APPLE_vertex_array_object`
is supported on older Intel GPUs even if they are capable of OpenGL 2.1 only).
- @subpage requires-gl30
- @subpage requires-gl31
@ -52,7 +59,9 @@ supported on Intel GPUs even if they are capable of OpenGL 2.1 only).
- @subpage requires-gles20
- @subpage requires-gles30
- @subpage requires-es-extension
- @subpage unsupported
@see @ref building, @ref cmake, @ref MAGNUM_TARGET_GLES,
@ref MAGNUM_TARGET_GLES2
@page requires-gl30 Functionality requiring OpenGL 3.0
@page requires-gl31 Functionality requiring OpenGL 3.1
@ -69,7 +78,7 @@ supported on Intel GPUs even if they are capable of OpenGL 2.1 only).
@page requires-gl Functionality requiring desktop OpenGL (not available on OpenGL ES)
@see @ref MAGNUM_TARGET_GLES
@page requires-gles20 Functionality requiring OpenGL ES 2.0 (not available in ES 3.0 and desktop OpenGL)
@page requires-gles20 Functionality requiring OpenGL ES 2.0 (not available on desktop or ES 3.0)
@see @ref MAGNUM_TARGET_GLES2
@page requires-gles30 Functionality requiring OpenGL ES 3.0

6
doc/portability.dox

@ -107,7 +107,7 @@ advantage of some extensions and enable faster code paths if given extension is
available, but also have proper fallback when it's not, see for example
@ref AbstractShaderProgram-performance-optimization "AbstractShaderProgram",
@ref AbstractTexture-performance-optimization "AbstractTexture" or
@ref Mesh-performance-optimization "Mesh". See also @ref required-extensions.
@ref Mesh-performance-optimization "Mesh". See also @ref opengl-required-extensions.
@section portability-shaders Writing portable shaders
@ -145,8 +145,8 @@ void main() {
It is often desirable to query extension presence based on actually used GLSL
version -- while the extension might be supported in the driver, it might not
be available in given GLSL version (e.g. causing compilation errors). You can
use @ref Context::isExtensionSupported(Version) to check that the extension
is present in given version:
use @ref Context::isExtensionSupported(Version) const to check that the
extension is present in given version:
@code
if(!Context::instance()->isExtensionSupported<Extensions::GL::ARB::explicit_attrib_location>(version)) {
bindAttributeLocation(Position::Location, "position");

2
doc/tips.dox

@ -30,5 +30,7 @@ namespace Magnum {
- @subpage portability -- @copybrief portability
- @subpage best-practices -- @copybrief best-practices
- @subpage compilation-speedup -- @copybrief compilation-speedup
- @subpage troubleshooting -- @copybrief troubleshooting
*/
}

93
doc/troubleshooting.dox

@ -0,0 +1,93 @@
/*
This file is part of Magnum.
Copyright © 2010, 2011, 2012, 2013 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.
*/
namespace Magnum {
/** @page troubleshooting Troubleshooting
@brief Various tricks to overcome to common building and rendering issues.
@section troubleshooting-building Building issues
If your project suddenly stops building after %Magnum upgrade, check these
things:
- If the building fails on CMake step, be sure that you have up-to-date
`FindCorrade.cmake`, `FindMagnum.cmake` and other CMake modules in your
project (`FindSDL2.cmake`). They are contained in `modules/` directory of
%Magnum sources (and sources of other projects) also are installed into
`share/cmake/Magnum`.
- In some cases when the changes done to build system are too drastic,
recreating the build dir or clearing CMake cache is needed, but this is
a very rare occasion.
- The library is constantly evolving, thus some API might get deprecated over
time (and later removed). Either build the libraries with `BUILD_DEPRECATED`
or switch to non-deprecated features. See @ref building for more
information.
@section troubleshooting-rendering Rendering issues
If you are experiencing so-called "black screen of death", you might want to
try these things:
- Verify that @ref Renderer::error() "no OpenGL error was emitted".
- Check that you use only extensions that are
@ref Context::isExtensionSupported() "available on your system".
- Check that you didn't exceed any implementation-defined limit (see
`magnum-info` output for list of all of them).
- Enable @ref DebugMessage "debug output" to see more detailed errors,
warnings and performance hints.
- If using framebuffer objects, @ref Framebuffer::checkStatus() "check that they are complete".
- Change @ref Renderer::setClearColor() "framebuffer clear color" to
something else than black to verify that at least something is drawn.
- If nothing is drawn, use @ref PrimitiveQuery to check that at least some
primitives were generated. Use @ref SampleQuery to check whether fragments
were drawn.
- Verify that the mesh is properly set up -- nonzero vertex/index count,
matching type in buffer and @ref Mesh::addVertexBuffer() "vertex specification",
properly set up @ref Mesh::setIndexBuffer() "index buffer" and index count
for indexed mesh. If you specified index range, be sure that all indices
fall into it, otherwise you would get undefined behavior.
- Try disabling @ref Renderer::Feature::DepthTest "depth test",
@ref Renderer::Feature::FaceCulling "face culling" and other renderer
features that might affect the fragments.
- Verify that your projection and transformation matrix is properly set up --
try drawing points instead of triangles, to see if they are at least at
proper places.
- @ref AbstractShaderProgram::validate() "Validate the shader", check that
all used uniforms and attributes have proper locations. Try reducing it
until it is able to draw something, possibly also with some simpler mesh.
@section troubleshooting-debugging Debugging rendering
- Enable @ref DebugMessage "debug output" to see additional performance hints
and implementation-dependent information.
- Use @ref TimeQuery to find hot spots in the rendering code.
- @ref DebugMessage::insert() "Mark relevant parts of code" to find them
easier in the debugger.
- Use ApiTrace to trace the program call by call, verify buffer and texture
contents, vertex binding and count of generated primitives, rendered
fragments and time spent in various calls.
*/
}

62
doc/unsupported.dox

@ -1,62 +0,0 @@
/*
This file is part of Magnum.
Copyright © 2010, 2011, 2012, 2013 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.
*/
/** @page unsupported Unsupported OpenGL features
Some functionality, which is either soon-to-be deprecated or isn't proven to
add any performance gains, is not supported in %Magnum. See also @ref deprecated-gl.
@section unsupported-features Unsupported features
- Line and polygon smoothing (`GL_LINE_SMOOTH`, `GL_POLYGON_SMOOTH`) and
related functions are not supported, as the driver might do it in software
with serious performance drops. Multisampling is far superior solution.
- Fixed precision data types (`GL_FIXED` in OpenGL ES) are not supported, as
they occupy the same memory as floats and they aren't faster than floats on
current hardware anymore.
- Shader compiler is assumed to be present (`GL_SHADER_COMPILER` returning
true), as all desktop GL implementations and also ES3 are required to
support it.
@section unsupported-extensions Unsupported extensions
- @extension{INTEL,map_texture} negatively affects texture access performance.
Combination of buffer mapping and pixel buffers might be of the same or
better performance, without affecting texture access speed.
- @extension{NV,draw_texture} can be done with framebuffer blitting and
doesn't make any full-screen postprocessing easier, as shaders are excluded.
*/
/** @page deprecated-gl Deprecated OpenGL API list
See also @ref unsupported and @ref deprecated.
*/
/** @page deprecated Deprecated list
See also @ref deprecated-gl.
*/

14
modules/FindCorrade.cmake

@ -43,6 +43,10 @@
# Native Client with `glibc` toolchain
# CORRADE_TARGET_EMSCRIPTEN - Defined if compiled for Emscripten
#
# If CORRADE_BUILD_DEPRECATED is defined, the CORRADE_INCLUDE_DIR variable also
# contains path directly to Corrade directory (i.e. for includes without
# `Corrade/` prefix).
#
# Corrade provides these macros and functions:
#
#
@ -132,8 +136,7 @@ find_program(CORRADE_RC_EXECUTABLE corrade-rc)
# Include dir
find_path(CORRADE_INCLUDE_DIR
NAMES PluginManager Utility
PATH_SUFFIXES Corrade)
NAMES Corrade/PluginManager Corrade/Utility)
# CMake module dir
find_path(_CORRADE_MODULE_DIR
@ -161,7 +164,7 @@ if(NOT CORRADE_FOUND)
endif()
# Configuration
file(READ ${CORRADE_INCLUDE_DIR}/corradeConfigure.h _corradeConfigure)
file(READ ${CORRADE_INCLUDE_DIR}/Corrade/configure.h _corradeConfigure)
# Compatibility?
string(FIND "${_corradeConfigure}" "#define CORRADE_GCC47_COMPATIBILITY" _GCC47_COMPATIBILITY)
@ -233,6 +236,11 @@ mark_as_advanced(CORRADE_UTILITY_LIBRARY
CORRADE_TESTSUITE_LIBRARY
_CORRADE_MODULE_DIR)
# Add Corrade dir to include path if this is deprecated build
if(CORRADE_BUILD_DEPRECATED)
set(CORRADE_INCLUDE_DIR ${CORRADE_INCLUDE_DIR} ${CORRADE_INCLUDE_DIR}/Corrade)
endif()
# Include our module dir, if we have any
if(NOT "${_CORRADE_MODULE_DIR}" STREQUAL "${CMAKE_ROOT}/Modules")
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${_CORRADE_MODULE_DIR}")

31
modules/FindMagnum.cmake

@ -7,7 +7,6 @@
# MAGNUM_LIBRARIES - Magnum library and dependent libraries
# MAGNUM_INCLUDE_DIRS - Root include dir and include dirs of
# dependencies
# MAGNUM_PLUGINS_INCLUDE_DIR - Include dir with plugins
# MAGNUM_PLUGINS_DIR - Base directory with plugins. You can modify
# it (e.g. set it to `.` when deploying on Windows with plugins stored
# relatively to the executable), the following MAGNUM_PLUGINS_*_DIR
@ -68,6 +67,11 @@
# MAGNUM_TARGET_DESKTOP_GLES - Defined if compiled with OpenGL ES
# emulation on desktop OpenGL
#
# If `MAGNUM_BUILD_DEPRECATED` is defined, the `MAGNUM_INCLUDE_DIR` variable
# also contains path directly to Magnum directory (i.e. for includes without
# `Magnum/` prefix) and `MAGNUM_PLUGINS_INCLUDE_DIR` contains include dir for
# plugins (i.e. instead of `MagnumPlugins/` prefix).
#
# Additionally these variables are defined for internal usage:
# MAGNUM_INCLUDE_DIR - Root include dir (w/o
# dependencies)
@ -126,11 +130,10 @@ find_library(MAGNUM_LIBRARY Magnum)
# Root include dir
find_path(MAGNUM_INCLUDE_DIR
NAMES Magnum.h
PATH_SUFFIXES Magnum)
NAMES Magnum/Magnum.h)
# Configuration
file(READ ${MAGNUM_INCLUDE_DIR}/magnumConfigure.h _magnumConfigure)
file(READ ${MAGNUM_INCLUDE_DIR}/Magnum/configure.h _magnumConfigure)
string(FIND "${_magnumConfigure}" "#define MAGNUM_BUILD_DEPRECATED" _BUILD_DEPRECATED)
if(NOT _BUILD_DEPRECATED EQUAL -1)
@ -208,7 +211,7 @@ foreach(component ${Magnum_FIND_COMPONENTS})
# Set plugin defaults, find the plugin
if(_MAGNUM_${_COMPONENT}_IS_PLUGIN)
set(_MAGNUM_${_COMPONENT}_INCLUDE_PATH_SUFFIX Plugins/${component})
set(_MAGNUM_${_COMPONENT}_INCLUDE_PATH_SUFFIX MagnumPlugins/${component})
# Don't override the one for *AudioImporter plugins
if(NOT _MAGNUM_${_COMPONENT}_INCLUDE_PATH_NAMES)
@ -226,7 +229,7 @@ foreach(component ${Magnum_FIND_COMPONENTS})
# Set library defaults, find the library
else()
set(_MAGNUM_${_COMPONENT}_INCLUDE_PATH_SUFFIX ${component})
set(_MAGNUM_${_COMPONENT}_INCLUDE_PATH_SUFFIX Magnum/${component})
set(_MAGNUM_${_COMPONENT}_INCLUDE_PATH_NAMES ${component}.h)
find_library(MAGNUM_${_COMPONENT}_LIBRARY Magnum${component})
@ -234,7 +237,7 @@ foreach(component ${Magnum_FIND_COMPONENTS})
# Applications
if(${component} MATCHES .+Application)
set(_MAGNUM_${_COMPONENT}_INCLUDE_PATH_SUFFIX Platform)
set(_MAGNUM_${_COMPONENT}_INCLUDE_PATH_SUFFIX Magnum/Platform)
# GLUT application dependencies
if(${component} STREQUAL GlutApplication)
@ -354,7 +357,7 @@ find_package_handle_standard_args(Magnum
# Dependent libraries and includes
set(MAGNUM_INCLUDE_DIRS ${MAGNUM_INCLUDE_DIR}
${MAGNUM_INCLUDE_DIR}/OpenGL
${MAGNUM_INCLUDE_DIR}/MagnumExternal/OpenGL
${CORRADE_INCLUDE_DIR})
set(MAGNUM_LIBRARIES ${MAGNUM_LIBRARY}
${CORRADE_UTILITY_LIBRARIES}
@ -376,7 +379,7 @@ set(MAGNUM_PLUGINS_IMPORTER_INSTALL_DIR ${MAGNUM_PLUGINS_INSTALL_DIR}/importers)
set(MAGNUM_PLUGINS_AUDIOIMPORTER_INSTALL_DIR ${MAGNUM_PLUGINS_INSTALL_DIR}/audioimporters)
set(MAGNUM_CMAKE_FIND_MODULE_INSTALL_DIR ${CMAKE_ROOT}/Modules)
set(MAGNUM_INCLUDE_INSTALL_DIR ${CMAKE_INSTALL_PREFIX}/include/Magnum)
set(MAGNUM_PLUGINS_INCLUDE_INSTALL_DIR ${CMAKE_INSTALL_PREFIX}/include/Magnum/Plugins)
set(MAGNUM_PLUGINS_INCLUDE_INSTALL_DIR ${CMAKE_INSTALL_PREFIX}/include/MagnumPlugins)
mark_as_advanced(FORCE
MAGNUM_LIBRARY
MAGNUM_INCLUDE_DIR
@ -391,11 +394,19 @@ mark_as_advanced(FORCE
MAGNUM_INCLUDE_INSTALL_DIR
MAGNUM_PLUGINS_INCLUDE_INSTALL_DIR)
# Add Magnum dir to include path and create MAGNUM_PLUGINS_INCLUDE_DIR if this
# is deprecated build
if(MAGNUM_BUILD_DEPRECATED)
set(MAGNUM_INCLUDE_DIRS ${MAGNUM_INCLUDE_DIRS}
${MAGNUM_INCLUDE_DIR}/Magnum
${MAGNUM_INCLUDE_DIR}/MagnumExternal)
set(MAGNUM_PLUGINS_INCLUDE_DIR ${MAGNUM_INCLUDE_DIR}/MagnumPlugins)
endif()
set(MAGNUM_PLUGINS_DIR ${MAGNUM_PLUGINS_INSTALL_DIR}
CACHE PATH "Base directory where to look for Magnum plugins")
# Plugin directories
set(MAGNUM_PLUGINS_INCLUDE_DIR ${MAGNUM_INCLUDE_DIR}/Plugins)
set(MAGNUM_PLUGINS_FONT_DIR ${MAGNUM_PLUGINS_DIR}/fonts)
set(MAGNUM_PLUGINS_FONTCONVERTER_DIR ${MAGNUM_PLUGINS_DIR}/fontconverters)
set(MAGNUM_PLUGINS_IMAGECONVERTER_DIR ${MAGNUM_PLUGINS_DIR}/imageconverters)

1
package/archlinux/PKGBUILD

@ -26,6 +26,7 @@ build() {
-DWITH_GLUTAPPLICATION=ON \
-DWITH_GLXAPPLICATION=ON \
-DWITH_SDL2APPLICATION=ON \
-DWITH_WINDOWLESSGLXAPPLICATION=ON \
-DWITH_MAGNUMFONT=ON \
-DWITH_MAGNUMFONTCONVERTER=ON \
-DWITH_TGAIMAGECONVERTER=ON \

1
package/archlinux/PKGBUILD-clang

@ -30,6 +30,7 @@ build() {
-DWITH_GLUTAPPLICATION=ON \
-DWITH_GLXAPPLICATION=ON \
-DWITH_SDL2APPLICATION=ON \
-DWITH_WINDOWLESSGLXAPPLICATION=ON \
-DWITH_MAGNUMFONT=ON \
-DWITH_MAGNUMFONTCONVERTER=ON \
-DWITH_TGAIMAGECONVERTER=ON \

1
package/archlinux/PKGBUILD-clang-libc++

@ -32,6 +32,7 @@ build() {
-DWITH_GLUTAPPLICATION=ON \
-DWITH_GLXAPPLICATION=ON \
-DWITH_SDL2APPLICATION=ON \
-DWITH_WINDOWLESSGLXAPPLICATION=ON \
-DWITH_MAGNUMFONT=ON \
-DWITH_MAGNUMFONTCONVERTER=ON \
-DWITH_TGAIMAGECONVERTER=ON \

1
package/archlinux/PKGBUILD-gcc46

@ -30,6 +30,7 @@ build() {
-DWITH_GLUTAPPLICATION=ON \
-DWITH_GLXAPPLICATION=ON \
-DWITH_SDL2APPLICATION=ON \
-DWITH_WINDOWLESSGLXAPPLICATION=ON \
-DWITH_MAGNUMFONT=ON \
-DWITH_MAGNUMFONTCONVERTER=ON \
-DWITH_TGAIMAGECONVERTER=ON \

1
package/archlinux/PKGBUILD-gcc47

@ -30,6 +30,7 @@ build() {
-DWITH_GLUTAPPLICATION=ON \
-DWITH_GLXAPPLICATION=ON \
-DWITH_SDL2APPLICATION=ON \
-DWITH_WINDOWLESSGLXAPPLICATION=ON \
-DWITH_MAGNUMFONT=ON \
-DWITH_MAGNUMFONTCONVERTER=ON \
-DWITH_TGAIMAGECONVERTER=ON \

1
package/archlinux/PKGBUILD-gcc49

@ -30,6 +30,7 @@ build() {
-DWITH_GLUTAPPLICATION=ON \
-DWITH_GLXAPPLICATION=ON \
-DWITH_SDL2APPLICATION=ON \
-DWITH_WINDOWLESSGLXAPPLICATION=ON \
-DWITH_MAGNUMFONT=ON \
-DWITH_MAGNUMFONTCONVERTER=ON \
-DWITH_TGAIMAGECONVERTER=ON \

1
package/archlinux/PKGBUILD-release

@ -21,6 +21,7 @@ build() {
-DWITH_GLUTAPPLICATION=ON \
-DWITH_GLXAPPLICATION=ON \
-DWITH_SDL2APPLICATION=ON \
-DWITH_WINDOWLESSGLXAPPLICATION=ON \
-DWITH_MAGNUMFONT=ON \
-DWITH_MAGNUMFONTCONVERTER=ON \
-DWITH_TGAIMAGECONVERTER=ON \

4
package/ci/jenkins-emscripten.xml

@ -67,9 +67,8 @@ cmake .. \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_MODULE_PATH="${WORKSPACE}/toolchains/modules" \
-DCMAKE_TOOLCHAIN_FILE="../toolchains/generic/Emscripten.cmake" \
-DCMAKE_FIND_ROOT_PATH=${JENKINS_HOME}/filesystem/emscripten \
-DCMAKE_FIND_ROOT_PATH=${JENKINS_HOME}/filesystem/emscripten-${compatibility} \
-DCMAKE_INSTALL_PREFIX=${JENKINS_HOME}/filesystem/emscripten-${compatibility} \
-DBUILD_TESTS=ON \
-DBUILD_DEPRECATED=${deprecated_build_flag} \
`#-DWITH_AUDIO=ON` \
-DWITH_SDL2APPLICATION=ON \
@ -81,7 +80,6 @@ cmake .. \
-G Ninja
ninja
ctest --output-on-failure || true
ninja install
]]>
</command>

2
package/ci/jenkins-mingw32.xml

@ -77,7 +77,7 @@ cd build-mingw32-${libraries}-${compatibility}
cmake .. \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_TOOLCHAIN_FILE=../toolchains/archlinux/basic-mingw32.cmake \
-DCMAKE_FIND_ROOT_PATH=${JENKINS_HOME}/filesystem/mingw32-${libraries} \
-DCMAKE_FIND_ROOT_PATH=${JENKINS_HOME}/filesystem/mingw32-${libraries}-${compatibility} \
-DCMAKE_INSTALL_PREFIX=${JENKINS_HOME}/filesystem/mingw32-${libraries}-${compatibility} \
-DBUILD_TESTS=ON \
-DBUILD_DEPRECATED=${deprecated_build_flag} \

120
package/ci/jenkins-nacl.xml

@ -0,0 +1,120 @@
<?xml version='1.0' encoding='UTF-8'?>
<matrix-project>
<actions/>
<description></description>
<logRotator class="hudson.tasks.LogRotator">
<daysToKeep>-1</daysToKeep>
<numToKeep>10</numToKeep>
<artifactDaysToKeep>-1</artifactDaysToKeep>
<artifactNumToKeep>-1</artifactNumToKeep>
</logRotator>
<keepDependencies>false</keepDependencies>
<properties/>
<scm class="hudson.plugins.git.GitSCM" plugin="git@2.0">
<configVersion>2</configVersion>
<userRemoteConfigs>
<hudson.plugins.git.UserRemoteConfig>
<url>git://github.com/mosra/magnum.git</url>
</hudson.plugins.git.UserRemoteConfig>
</userRemoteConfigs>
<branches>
<hudson.plugins.git.BranchSpec>
<name>*/master</name>
</hudson.plugins.git.BranchSpec>
</branches>
<doGenerateSubmoduleConfigurations>false</doGenerateSubmoduleConfigurations>
<submoduleCfg class="list"/>
<extensions>
<hudson.plugins.git.extensions.impl.CloneOption>
<shallow>true</shallow>
<reference></reference>
</hudson.plugins.git.extensions.impl.CloneOption>
</extensions>
</scm>
<canRoam>true</canRoam>
<disabled>false</disabled>
<blockBuildWhenDownstreamBuilding>false</blockBuildWhenDownstreamBuilding>
<blockBuildWhenUpstreamBuilding>false</blockBuildWhenUpstreamBuilding>
<triggers/>
<concurrentBuild>false</concurrentBuild>
<customWorkspace>Magnum</customWorkspace>
<axes>
<hudson.matrix.TextAxis>
<name>toolchain</name>
<values>
<string>newlib-x86-32</string>
<string>newlib-x86-64</string>
</values>
</hudson.matrix.TextAxis>
<hudson.matrix.TextAxis>
<name>compatibility</name>
<values>
<string></string>
<string>deprecated</string>
</values>
</hudson.matrix.TextAxis>
</axes>
<builders>
<hudson.tasks.Shell>
<command>
<![CDATA[
git submodule init
git submodule update
if [ "${compatibility}" = "deprecated" ] ; then
deprecated_build_flag=ON
else
deprecated_build_flag=OFF
fi
mkdir -p build-nacl-${toolchain}-${compatibility}
cd build-mingw32-${toolchain}-${compatibility}
cmake .. \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_MODULE_PATH="${WORKSPACE}/toolchains/modules" \
-DCMAKE_TOOLCHAIN_FILE=../toolchains/generic/NaCl-${toolchain}.cmake \
-DCMAKE_FIND_ROOT_PATH=${JENKINS_HOME}/filesystem/nacl-${toolchain}-${compatibility} \
-DCMAKE_INSTALL_PREFIX=${JENKINS_HOME}/filesystem/nacl-${toolchain}-${compatibility} \
-DBUILD_DEPRECATED=${deprecated_build_flag} \
`#-DWITH_AUDIO=ON` \
-DWITH_NACLAPPLICATION=ON \
-DWITH_MAGNUMFONT=ON \
-DWITH_MAGNUMFONTCONVERTER=ON \
-DWITH_TGAIMAGECONVERTER=ON \
-DWITH_TGAIMPORTER=ON \
`#-DWITH_WAVAUDIOIMPORTER=ON` \
-DWITH_MAGNUMINFO=ON \
-G Ninja
ninja
ninja install
]]>
</command>
</hudson.tasks.Shell>
</builders>
<publishers>
<hudson.plugins.textfinder.TextFinderPublisher plugin="text-finder@1.9">
<regexp>Errors while running CTest</regexp>
<succeedIfFound>false</succeedIfFound>
<unstableIfFound>true</unstableIfFound>
<alsoCheckConsoleOutput>true</alsoCheckConsoleOutput>
</hudson.plugins.textfinder.TextFinderPublisher>
</publishers>
<buildWrappers/>
<executionStrategy class="hudson.matrix.DefaultMatrixExecutionStrategyImpl">
<runSequentially>true</runSequentially>
<touchStoneCombinationFilter>
<![CDATA[
toolchain == "newlib-x86-64" && compatibility == "deprecated"
]]>
</touchStoneCombinationFilter>
<touchStoneResultCondition>
<name>UNSTABLE</name>
<ordinal>1</ordinal>
<color>YELLOW</color>
<completeBuild>true</completeBuild>
</touchStoneResultCondition>
</executionStrategy>
<childCustomWorkspace>.</childCustomWorkspace>
</matrix-project>

4
package/ci/jenkins.xml

@ -123,9 +123,9 @@ cd build-${compiler}-${libraries}-${compatibility}-${gl}
cmake .. \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_FIND_ROOT_PATH=${JENKINS_HOME}/filesystem/compatibility-${compiler}-${libraries} \
-DCMAKE_FIND_ROOT_PATH=${JENKINS_HOME}/filesystem/compatibility-${compiler}-${libraries}-${compatibility} \
-DCMAKE_INSTALL_PREFIX=${JENKINS_HOME}/filesystem/compatibility-${compiler}-${libraries}-${compatibility}-${gl} \
-DCMAKE_INSTALL_RPATH="${JENKINS_HOME}/filesystem/compatibility-${compiler}-${libraries}/lib;${JENKINS_HOME}/filesystem/compatibility-${compiler}-${libraries}-${compatibility}-${gl}/lib" \
-DCMAKE_INSTALL_RPATH="${JENKINS_HOME}/filesystem/compatibility-${compiler}-${libraries}-${compatibility}/lib;${JENKINS_HOME}/filesystem/compatibility-${compiler}-${libraries}-${compatibility}-${gl}/lib" \
-DCMAKE_CXX_COMPILER=${compiler_binary} \
"${compiler_flags[@]}" \
-DBUILD_TESTS=ON \

242
src/CMakeLists.txt

@ -49,240 +49,14 @@ elseif(CORRADE_GCC45_COMPATIBILITY AND NOT CORRADE_GCC44_COMPATIBILITY)
endif()
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${CORRADE_CXX_FLAGS}")
include_directories(
${CMAKE_CURRENT_SOURCE_DIR}
${CMAKE_CURRENT_BINARY_DIR}
${CORRADE_INCLUDE_DIR}
# We can use both implicit include path (GLES2/gl2.h) where our headers can
# be overriden with system ones or explicit (OpenGL/GLES2/gl2ext.h) where
# only our headers will be used
${CMAKE_SOURCE_DIR}/external
${CMAKE_SOURCE_DIR}/external/OpenGL)
include_directories(${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR} ${CORRADE_INCLUDE_DIR})
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/magnumConfigure.h.cmake
${CMAKE_CURRENT_BINARY_DIR}/magnumConfigure.h)
# 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
include_directories(${CMAKE_SOURCE_DIR}/src/MagnumExternal/OpenGL)
# Files shared between main library and unit test library
set(Magnum_SRCS
AbstractFramebuffer.cpp
AbstractImage.cpp
AbstractObject.cpp
AbstractTexture.cpp
AbstractShaderProgram.cpp
Buffer.cpp
ColorFormat.cpp
Context.cpp
DebugMessage.cpp
DefaultFramebuffer.cpp
Framebuffer.cpp
Image.cpp
Mesh.cpp
MeshView.cpp
OpenGL.cpp
Query.cpp
Renderbuffer.cpp
Renderer.cpp
Resource.cpp
Sampler.cpp
Shader.cpp
Timeline.cpp
Version.cpp
Implementation/BufferState.cpp
Implementation/DebugState.cpp
Implementation/State.cpp
Implementation/TextureState.cpp
Trade/AbstractImageConverter.cpp
Trade/AbstractImporter.cpp
Trade/AbstractMaterialData.cpp
Trade/MeshData2D.cpp
Trade/MeshData3D.cpp
Trade/MeshObjectData2D.cpp
Trade/MeshObjectData3D.cpp
Trade/ObjectData2D.cpp
Trade/ObjectData3D.cpp
Trade/PhongMaterialData.cpp
Trade/SceneData.cpp
Trade/TextureData.cpp)
set(Magnum_OBJECTS $<TARGET_OBJECTS:MagnumObjects>)
# Desktop-only code
if(NOT TARGET_GLES)
set(Magnum_SRCS ${Magnum_SRCS}
BufferTexture.cpp)
endif()
# Not-ES2 code
if(NOT TARGET_GLES2)
set(Magnum_SRCS ${Magnum_SRCS}
BufferImage.cpp)
endif()
set(Magnum_HEADERS
AbstractFramebuffer.h
AbstractImage.h
AbstractObject.h
AbstractResourceLoader.h
AbstractShaderProgram.h
AbstractTexture.h
Array.h
Buffer.h
Color.h
ColorFormat.h
Context.h
CubeMapTexture.h
DebugMessage.h
DefaultFramebuffer.h
DimensionTraits.h
Extensions.h
Framebuffer.h
Image.h
ImageReference.h
Magnum.h
Mesh.h
MeshView.h
OpenGL.h
Query.h
Renderbuffer.h
RenderbufferFormat.h
Renderer.h
Resource.h
ResourceManager.h
Sampler.h
Shader.h
Texture.h
TextureFormat.h
Timeline.h
Types.h
Version.h
magnumVisibility.h)
# Deprecated headers
if(BUILD_DEPRECATED)
set(Magnum_HEADERS ${Magnum_HEADERS}
DebugMarker.h
ImageFormat.h
Swizzle.h)
endif()
# Desktop-only headers and libraries
if(NOT TARGET_GLES)
set(Magnum_HEADERS ${Magnum_HEADERS}
BufferTexture.h
CubeMapTextureArray.h)
set(Magnum_OBJECTS ${Magnum_OBJECTS} $<TARGET_OBJECTS:MagnumGLLoadGenObjects>)
endif()
# Not-ES2 headers
if(NOT TARGET_GLES2)
set(Magnum_HEADERS ${Magnum_HEADERS}
BufferImage.h)
endif()
# Files shared between main library and math unit test library
set(MagnumMath_SRCS
Math/Functions.cpp
Math/instantiation.cpp)
# Set shared library flags for the objects, as they will be part of shared lib
# TODO: fix when CMake sets target_EXPORTS for OBJECT targets as well
add_library(MagnumMathObjects OBJECT ${MagnumMath_SRCS})
add_library(MagnumObjects OBJECT ${Magnum_SRCS})
set_target_properties(MagnumMathObjects PROPERTIES COMPILE_FLAGS "-DMagnumMathObjects_EXPORTS -DGLLoadGen_EXPORTS ${CMAKE_SHARED_LIBRARY_CXX_FLAGS}")
set_target_properties(MagnumObjects PROPERTIES COMPILE_FLAGS "-DMagnumObjects_EXPORTS -DGLLoadGen_EXPORTS ${CMAKE_SHARED_LIBRARY_CXX_FLAGS}")
# Main library
add_library(Magnum ${SHARED_OR_STATIC}
${Magnum_OBJECTS}
$<TARGET_OBJECTS:MagnumMathObjects>)
if(BUILD_STATIC_PIC)
# TODO: CMake 2.8.9 has this as POSITION_INDEPENDENT_CODE property
set_target_properties(Magnum PROPERTIES COMPILE_FLAGS "${CMAKE_SHARED_LIBRARY_CXX_FLAGS}")
endif()
set(Magnum_LIBS
${CORRADE_UTILITY_LIBRARIES}
${CORRADE_PLUGINMANAGER_LIBRARIES})
if(NOT TARGET_GLES OR TARGET_DESKTOP_GLES)
set(Magnum_LIBS ${Magnum_LIBS} ${OPENGL_gl_LIBRARY})
elseif(TARGET_GLES2)
set(Magnum_LIBS ${Magnum_LIBS} ${OPENGLES2_LIBRARY})
else()
set(Magnum_LIBS ${Magnum_LIBS} ${OPENGLES3_LIBRARY})
endif()
target_link_libraries(Magnum ${Magnum_LIBS})
install(TARGETS Magnum
RUNTIME DESTINATION ${MAGNUM_BINARY_INSTALL_DIR}
LIBRARY DESTINATION ${MAGNUM_LIBRARY_INSTALL_DIR}
ARCHIVE DESTINATION ${MAGNUM_LIBRARY_INSTALL_DIR})
install(FILES ${Magnum_HEADERS} DESTINATION ${MAGNUM_INCLUDE_INSTALL_DIR})
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/magnumConfigure.h DESTINATION ${MAGNUM_INCLUDE_INSTALL_DIR})
add_subdirectory(Math)
add_subdirectory(Platform)
add_subdirectory(Plugins)
add_subdirectory(Trade)
if(WITH_AUDIO)
add_subdirectory(Audio)
endif()
if(WITH_DEBUGTOOLS)
add_subdirectory(DebugTools)
endif()
if(WITH_MESHTOOLS)
add_subdirectory(MeshTools)
endif()
if(WITH_PRIMITIVES)
add_subdirectory(Primitives)
endif()
if(WITH_SCENEGRAPH)
add_subdirectory(SceneGraph)
endif()
if(WITH_SHADERS)
add_subdirectory(Shaders)
endif()
if(WITH_SHAPES)
add_subdirectory(Shapes)
endif()
if(WITH_TEXT)
add_subdirectory(Text)
endif()
if(WITH_TEXTURETOOLS)
add_subdirectory(TextureTools)
endif()
if(BUILD_TESTS)
# Libraries with graceful assert for testing
add_library(MagnumMathTestLib ${SHARED_OR_STATIC}
$<TARGET_OBJECTS:MagnumMathObjects>)
set_target_properties(MagnumMathTestLib PROPERTIES COMPILE_FLAGS -DCORRADE_GRACEFUL_ASSERT)
target_link_libraries(MagnumMathTestLib ${CORRADE_UTILITY_LIBRARY})
add_library(MagnumTestLib ${SHARED_OR_STATIC}
${Magnum_OBJECTS}
$<TARGET_OBJECTS:MagnumMathObjects>)
set_target_properties(MagnumTestLib PROPERTIES COMPILE_FLAGS -DCORRADE_GRACEFUL_ASSERT)
target_link_libraries(MagnumTestLib ${Magnum_LIBS})
# On Windows we need to install first and then run the tests to avoid "DLL
# not found" hell, thus we need to install this too
if(WIN32 AND NOT CMAKE_CROSSCOMPILING)
install(TARGETS MagnumMathTestLib MagnumTestLib
RUNTIME DESTINATION ${MAGNUM_BINARY_INSTALL_DIR}
LIBRARY DESTINATION ${MAGNUM_LIBRARY_INSTALL_DIR}
ARCHIVE DESTINATION ${MAGNUM_LIBRARY_INSTALL_DIR})
endif()
add_subdirectory(Test)
endif()
add_subdirectory(MagnumExternal)
add_subdirectory(Magnum)
add_subdirectory(MagnumPlugins)

15
src/AbstractFramebuffer.cpp → src/Magnum/AbstractFramebuffer.cpp

@ -24,10 +24,12 @@
#include "AbstractFramebuffer.h"
#include "BufferImage.h"
#include "Context.h"
#include "Extensions.h"
#include "Image.h"
#ifndef MAGNUM_TARGET_GLES2
#include "Magnum/BufferImage.h"
#endif
#include "Magnum/Context.h"
#include "Magnum/Extensions.h"
#include "Magnum/Image.h"
#include "Implementation/FramebufferState.h"
#include "Implementation/State.h"
@ -194,7 +196,7 @@ void AbstractFramebuffer::read(const Vector2i& offset, const Vector2i& size, Ima
#else
bindInternal(readTarget);
#endif
const std::size_t dataSize = image.pixelSize()*size.product();
const std::size_t dataSize = image.dataSize(size);
char* const data = new char[dataSize];
readImplementation(offset, size, image.format(), image.type(), dataSize, data);
image.setData(image.format(), image.type(), size, data);
@ -213,8 +215,7 @@ void AbstractFramebuffer::read(const Vector2i& offset, const Vector2i& size, Buf
image.setData(image.format(), image.type(), size, nullptr, usage);
image.buffer().bind(Buffer::Target::PixelPack);
/** @todo De-duplicate buffer size computation */
readImplementation(offset, size, image.format(), image.type(), image.pixelSize()*size.product(), nullptr);
readImplementation(offset, size, image.format(), image.type(), image.dataSize(size), nullptr);
}
#endif

49
src/AbstractFramebuffer.h → src/Magnum/AbstractFramebuffer.h

@ -25,14 +25,14 @@
*/
/** @file
* @brief Class Magnum::AbstractFramebuffer
* @brief Class @ref Magnum::AbstractFramebuffer, enum @ref Magnum::FramebufferClear, @ref Magnum::FramebufferBlit, @ref Magnum::FramebufferBlitFilter, @ref Magnum::FramebufferTarget, enum set @ref Magnum::FramebufferClearMask
*/
#include <Containers/EnumSet.h>
#include <Corrade/Containers/EnumSet.h>
#include "Math/Range.h"
#include "Magnum.h"
#include "OpenGL.h"
#include "Magnum/Magnum.h"
#include "Magnum/OpenGL.h"
#include "Magnum/Math/Range.h"
#ifdef CORRADE_GCC45_COMPATIBILITY
#include "Buffer.h"
@ -44,7 +44,7 @@ namespace Magnum {
/**
@brief Mask for framebuffer clearing
@see AbstractFramebuffer, FramebufferClearMask
@see @ref AbstractFramebuffer, @ref FramebufferClearMask
*/
enum class FramebufferClear: GLbitfield {
Color = GL_COLOR_BUFFER_BIT, /**< Color */
@ -55,7 +55,7 @@ enum class FramebufferClear: GLbitfield {
/**
@brief Mask for clearing
@see AbstractFramebuffer::clear()
@see @ref AbstractFramebuffer::clear()
*/
typedef Containers::EnumSet<FramebufferClear, GLbitfield,
GL_COLOR_BUFFER_BIT|GL_DEPTH_BUFFER_BIT|GL_STENCIL_BUFFER_BIT> FramebufferClearMask;
@ -63,10 +63,11 @@ typedef Containers::EnumSet<FramebufferClear, GLbitfield,
/**
@brief Mask for framebuffer blitting
@see AbstractFramebuffer, FramebufferBlitMask
@see @ref AbstractFramebuffer, @ref FramebufferBlitMask
@requires_gl30 %Extension @extension{ARB,framebuffer_object}
@requires_gles30 %Extension @es_extension{ANGLE,framebuffer_blit} or
@es_extension{NV,framebuffer_blit}
@todo Remove redundant `%Buffer`
*/
enum class FramebufferBlit: GLbitfield {
ColorBuffer = GL_COLOR_BUFFER_BIT, /**< Color buffer */
@ -77,7 +78,7 @@ enum class FramebufferBlit: GLbitfield {
/**
@brief Mask for framebuffer blitting
@see AbstractFramebuffer::blit()
@see @ref AbstractFramebuffer::blit()
@requires_gl30 %Extension @extension{ARB,framebuffer_object}
@requires_gles30 %Extension @es_extension{ANGLE,framebuffer_blit} or
@es_extension{NV,framebuffer_blit}
@ -88,7 +89,7 @@ typedef Containers::EnumSet<FramebufferBlit, GLbitfield,
/**
@brief %Framebuffer blit filtering
@see AbstractFramebuffer::blit()
@see @ref AbstractFramebuffer::blit()
@requires_gl30 %Extension @extension{ARB,framebuffer_object}
@requires_gles30 %Extension @es_extension{ANGLE,framebuffer_blit} or
@es_extension{NV,framebuffer_blit}
@ -101,7 +102,7 @@ enum class FramebufferBlitFilter: GLenum {
/**
@brief Target for binding framebuffer
@see DefaultFramebuffer::bind(), Framebuffer::bind()
@see @ref DefaultFramebuffer::bind(), @ref Framebuffer::bind()
@requires_gl30 %Extension @extension{ARB,framebuffer_object}
*/
enum class FramebufferTarget: GLenum {
@ -133,7 +134,7 @@ enum class FramebufferTarget: GLenum {
/**
@brief Base for default and named framebuffers
See DefaultFramebuffer and Framebuffer for more information.
See @ref DefaultFramebuffer and @ref Framebuffer for more information.
@section AbstractFramebuffer-performance-optimization Performance optimizations and security
@ -143,8 +144,8 @@ switching framebuffers. %Framebuffer limits and implementation-defined values
(such as @ref maxViewportSize()) are cached, so repeated queries don't result
in repeated @fn_gl{Get} calls.
If @extension{ARB,robustness} is available, read() operations are protected
from buffer overflow.
If @extension{ARB,robustness} is available, @ref read() operations are
protected from buffer overflow.
@todo @extension{ARB,viewport_array} (and `GL_MAX_VIEWPORTS`)
*/
class MAGNUM_EXPORT AbstractFramebuffer {
@ -234,9 +235,9 @@ class MAGNUM_EXPORT AbstractFramebuffer {
* @brief Bind framebuffer for rendering
*
* Binds the framebuffer and updates viewport to saved dimensions.
* @see setViewport(), DefaultFramebuffer::mapForRead(),
* Framebuffer::mapForRead(), DefaultFramebuffer::mapForDraw(),
* Framebuffer::mapForDraw(), @fn_gl{BindFramebuffer},
* @see @ref setViewport(), @ref DefaultFramebuffer::mapForRead(),
* @ref Framebuffer::mapForRead(), @ref DefaultFramebuffer::mapForDraw(),
* @ref Framebuffer::mapForDraw(), @fn_gl{BindFramebuffer},
* @fn_gl{Viewport}
* @todo Bind internally to ReadDraw if separate binding points are not
* supported
@ -250,7 +251,7 @@ class MAGNUM_EXPORT AbstractFramebuffer {
* @brief Set viewport
* @return Reference to self (for method chaining)
*
* Saves the viewport to be used at later time in bind(). If the
* Saves the viewport to be used at later time in @ref bind(). If the
* framebuffer is currently bound, updates the viewport to given
* rectangle.
* @see @ref maxViewportSize(), @fn_gl{Viewport}
@ -262,11 +263,11 @@ class MAGNUM_EXPORT AbstractFramebuffer {
* @param mask Which buffers to clear
*
* To improve performance you can also use
* DefaultFramebuffer::invalidate() / Framebuffer::invalidate() instead
* of clearing given buffer if you will not use it anymore or fully
* overwrite it later.
* @see Renderer::setClearColor(), Renderer::setClearDepth(),
* Renderer::setClearStencil(), @fn_gl{BindFramebuffer},
* @ref DefaultFramebuffer::invalidate() / @ref Framebuffer::invalidate()
* instead of clearing given buffer if you will not use it anymore or
* fully overwrite it later.
* @see @ref Renderer::setClearColor(), @ref Renderer::setClearDepth(),
* @ref Renderer::setClearStencil(), @fn_gl{BindFramebuffer},
* @fn_gl{Clear}
*/
void clear(FramebufferClearMask mask);
@ -295,7 +296,7 @@ class MAGNUM_EXPORT AbstractFramebuffer {
* @param image %Buffer image where to put the data
* @param usage %Buffer usage
*
* See read(const Vector2i&, const Vector2i&, Image2D*) for more
* See @ref read(const Vector2i&, const Vector2i&, Image2D&) for more
* information.
* @requires_gles30 Pixel buffer objects are not available in OpenGL ES 2.0.
*/

25
src/AbstractImage.cpp → src/Magnum/AbstractImage.cpp

@ -24,9 +24,10 @@
#include "AbstractImage.h"
#include <Utility/Assert.h>
#include <Corrade/Utility/Assert.h>
#include "ColorFormat.h"
#include "Magnum/ColorFormat.h"
#include "Magnum/Math/Vector.h"
namespace Magnum {
@ -97,6 +98,8 @@ std::size_t AbstractImage::pixelSize(ColorFormat format, ColorType type) {
#ifdef MAGNUM_TARGET_GLES2
case ColorFormat::Luminance:
#endif
case ColorFormat::DepthComponent:
case ColorFormat::StencilIndex:
return 1*size;
case ColorFormat::RG:
#ifndef MAGNUM_TARGET_GLES2
@ -126,13 +129,25 @@ std::size_t AbstractImage::pixelSize(ColorFormat format, ColorType type) {
return 4*size;
/* Handled above */
case ColorFormat::DepthComponent:
case ColorFormat::StencilIndex:
case ColorFormat::DepthStencil:
CORRADE_ASSERT_UNREACHABLE();
CORRADE_ASSERT(false, "AbstractImage::pixelSize(): invalid ColorType specified for depth/stencil ColorFormat", 0);
}
CORRADE_ASSERT_UNREACHABLE();
}
template<UnsignedInt dimensions> std::size_t AbstractImage::dataSize(Math::Vector<dimensions, Int> size) const {
/** @todo Code this properly when all @fn_gl{PixelStore} parameters are implemented */
/* Row size, rounded to multiple of 4 bytes */
const std::size_t rowSize = ((size[0]*pixelSize() + 3)/4)*4;
/** @todo Can't this be done somewhat nicer? */
size[0] = 1;
return rowSize*size.product();
}
template MAGNUM_EXPORT std::size_t AbstractImage::dataSize<1>(Math::Vector<1, Int>) const;
template MAGNUM_EXPORT std::size_t AbstractImage::dataSize<2>(Math::Vector<2, Int>) const;
template MAGNUM_EXPORT std::size_t AbstractImage::dataSize<3>(Math::Vector<3, Int>) const;
}

6
src/AbstractImage.h → src/Magnum/AbstractImage.h

@ -30,8 +30,8 @@
#include <cstddef>
#include "Magnum.h"
#include "magnumVisibility.h"
#include "Magnum/Magnum.h"
#include "Magnum/visibility.h"
#ifdef CORRADE_GCC45_COMPATIBILITY
#include "ColorFormat.h"
@ -89,6 +89,8 @@ class MAGNUM_EXPORT AbstractImage {
~AbstractImage();
#endif
template<UnsignedInt dimensions> std::size_t dataSize(Math::Vector<dimensions, Int> size) const;
#ifdef DOXYGEN_GENERATING_OUTPUT
private:
#else

7
src/AbstractObject.cpp → src/Magnum/AbstractObject.cpp

@ -24,10 +24,11 @@
#include "AbstractObject.h"
#include <Utility/Assert.h>
#include <Corrade/Utility/Assert.h>
#include "Magnum/Context.h"
#include "Magnum/Extensions.h"
#include "Context.h"
#include "Extensions.h"
#include "Implementation/State.h"
#include "Implementation/DebugState.h"

6
src/AbstractObject.h → src/Magnum/AbstractObject.h

@ -30,9 +30,9 @@
#include <string>
#include "OpenGL.h"
#include "Types.h"
#include "magnumVisibility.h"
#include "Magnum/OpenGL.h"
#include "Magnum/Types.h"
#include "Magnum/visibility.h"
namespace Magnum {

2
src/AbstractResourceLoader.h → src/Magnum/AbstractResourceLoader.h

@ -30,7 +30,7 @@
#include <string>
#include "ResourceManager.h"
#include "Magnum/ResourceManager.h"
namespace Magnum {

9
src/AbstractShaderProgram.cpp → src/Magnum/AbstractShaderProgram.cpp

@ -26,10 +26,11 @@
#include <algorithm> /* std::max(), needed by MSVC */
#include "Math/RectangularMatrix.h"
#include "Context.h"
#include "Extensions.h"
#include "Shader.h"
#include "Magnum/Context.h"
#include "Magnum/Extensions.h"
#include "Magnum/Shader.h"
#include "Magnum/Math/RectangularMatrix.h"
#include "Implementation/DebugState.h"
#include "Implementation/ShaderProgramState.h"
#include "Implementation/State.h"

171
src/AbstractShaderProgram.h → src/Magnum/AbstractShaderProgram.h

@ -25,15 +25,14 @@
*/
/** @file
* @brief Class Magnum::AbstractShaderProgram
* @brief Class @ref Magnum::AbstractShaderProgram
*/
#include <string>
#include <Containers/EnumSet.h>
#include <Corrade/Containers/EnumSet.h>
#include "AbstractObject.h"
#include "Magnum.h"
#include "magnumVisibility.h"
#include "Magnum/AbstractObject.h"
#include "Magnum/Magnum.h"
namespace Magnum {
@ -48,38 +47,38 @@ namespace Implementation {
This class is designed to be used via subclassing. Subclasses define these
functions and properties:
- <strong>%Attribute definitions</strong> with location and type for
configuring meshes, for example:
- <strong>%Attribute definitions</strong> with location and type for
configuring meshes, for example:
@code
typedef Attribute<0, Vector3> Position;
typedef Attribute<1, Vector3> Normal;
typedef Attribute<2, Vector2> TextureCoordinates;
@endcode
- **Output attribute locations**, if desired, for example:
- **Output attribute locations**, if desired, for example:
@code
enum: UnsignedInt {
ColorOutput = 0,
NormalOutput = 1
};
@endcode
- **Layers for texture uniforms** to which the textures will be bound before
rendering, for example:
- **Layers for texture uniforms** to which the textures will be bound before
rendering, for example:
@code
enum: Int {
DiffuseTextureLayer = 0,
SpecularTextureLayer = 1
};
@endcode
- **Uniform locations** for setting uniform data (see below) (private
variables), for example:
- **Uniform locations** for setting uniform data (see below) (private
variables), for example:
@code
Int TransformationUniform = 0,
ProjectionUniform = 1,
DiffuseTextureUniform = 2,
SpecularTextureUniform = 3;
@endcode
- **Constructor**, which attaches particular shaders, links the program and
gets uniform locations, for example:
- **Constructor**, which attaches particular shaders, links the program and
gets uniform locations, for example:
@code
MyShader() {
// Load shaders, compile them and attach them to the program
@ -97,9 +96,9 @@ MyShader() {
CORRADE_INTERNAL_ASSERT_OUTPUT(link());
}
@endcode
- **Uniform setting functions**, which will provide public interface for
protected setUniform() functions. For usability purposes you can implement
also method chaining. Example:
- **Uniform setting functions**, which will provide public interface for
protected @ref setUniform() functions. For usability purposes you can
implement also method chaining. Example:
@code
MyShader& setTransformation(const Matrix4& matrix) {
setUniform(TransformationUniform, matrix);
@ -113,9 +112,9 @@ MyShader& setProjection(const Matrix4& matrix) {
@subsection AbstractShaderProgram-attribute-location Binding attribute location
The preferred workflow is to specify attribute location for vertex shader
input attributes and fragment shader output attributes explicitly in the
shader code, e.g.:
The preferred workflow is to specify attribute location for vertex shader input
attributes and fragment shader output attributes explicitly in the shader code,
e.g.:
@code
// GLSL 3.30, or
#extension GL_ARB_explicit_attrib_location: enable
@ -124,9 +123,9 @@ layout(location = 1) in vec3 normal;
layout(location = 2) in vec2 textureCoordinates;
@endcode
Similarly for ouput attributes, you can also specify blend equation color
index for them (see Framebuffer::BlendFunction for more information about
using color input index):
Similarly for ouput attributes, you can also specify blend equation color index
for them (see @ref Renderer::BlendFunction for more information about using
color input index):
@code
layout(location = 0, index = 0) out vec4 color;
layout(location = 1, index = 1) out vec3 normal;
@ -161,14 +160,17 @@ bindFragmentDataLocationIndexed(NormalOutput, 1, "normal");
@see @ref Mesh::maxVertexAttributes(), @ref AbstractFramebuffer::maxDrawBuffers()
@requires_gl30 %Extension @extension{EXT,gpu_shader4} for using
bindFragmentDataLocation().
@ref Magnum::AbstractShaderProgram::bindFragmentDataLocation() "bindFragmentDataLocation()".
@requires_gl33 %Extension @extension{ARB,blend_func_extended} for using
bindFragmentDataLocationIndexed().
@ref Magnum::AbstractShaderProgram::bindFragmentDataLocationIndexed() "bindFragmentDataLocationIndexed()".
@requires_gl33 %Extension @extension{ARB,explicit_attrib_location} for
explicit attribute location instead of using bindAttributeLocation(),
bindFragmentDataLocation() or bindFragmentDataLocationIndexed().
explicit attribute location instead of using
@ref Magnum::AbstractShaderProgram::bindAttributeLocation() "bindAttributeLocation()",
@ref Magnum::AbstractShaderProgram::bindFragmentDataLocation() "bindFragmentDataLocation()"
or @ref Magnum::AbstractShaderProgram::bindFragmentDataLocationIndexed() "bindFragmentDataLocationIndexed()".
@requires_gles30 Explicit location specification of input attributes is not
supported in OpenGL ES 2.0, use bindAttributeLocation() instead.
supported in OpenGL ES 2.0, use @ref Magnum::AbstractShaderProgram::bindAttributeLocation() "bindAttributeLocation()"
instead.
@requires_gles30 Multiple fragment shader outputs are not available in OpenGL
ES 2.0, similar functionality is available in extension
@es_extension{NV,draw_buffers}.
@ -199,9 +201,11 @@ Int projectionUniform = uniformLocation("projection");
@see @ref maxUniformLocations()
@requires_gl43 %Extension @extension{ARB,explicit_uniform_location} for
explicit uniform location instead of using uniformLocation().
explicit uniform location instead of using
@ref Magnum::AbstractShaderProgram::uniformLocation() "uniformLocation()".
@requires_gl Explicit uniform location is not supported in OpenGL ES. Use
uniformLocation() instead.
@ref Magnum::AbstractShaderProgram::uniformLocation() "uniformLocation()"
instead.
@subsection AbstractShaderProgram-texture-layer Binding texture layer uniforms
@ -216,7 +220,7 @@ layout(binding = 1) uniform sampler2D specularTexture;
If you don't have the required extension (or if you want to change the layer
later), declare the uniforms without the `layout()` qualifier and set the
texture layer uniform using @ref Magnum::AbstractShaderProgram::setUniform(Int, const T&) "setUniform(Int, Int)".
texture layer uniform using @ref setUniform(Int, const T&) "setUniform(Int, Int)".
Note that additional syntax changes may be needed for GLSL 1.20 and GLSL ES
1.0.
@code
@ -244,8 +248,8 @@ for more information) and map shader outputs to framebuffer attachments if
needed (see @ref Framebuffer-usage "Framebuffer documentation" for more
information). In each draw event set uniforms, mark the shader for use, bind
specific framebuffer (if needed) and bind required textures to their
respective layers using AbstractTexture::bind(Int). Then call Mesh::draw().
Example:
respective layers using @ref AbstractTexture::bind(Int). Then call
@ref Mesh::draw(). Example:
@code
shader.setTransformation(transformation)
.setProjection(projection)
@ -260,7 +264,8 @@ mesh.draw();
@section AbstractShaderProgram-types Mapping between GLSL and Magnum types
See @ref types for more information, only types with GLSL equivalent can be used
(and their super- or subclasses with the same size and underlying type).
(and their super- or subclasses with the same size and underlying type). See
also @ref Attribute::DataType enum for additional type options.
@requires_gl30 %Extension @extension{EXT,gpu_shader4} is required when using
integer attributes (i.e. @ref Magnum::UnsignedInt "UnsignedInt",
@ -270,32 +275,29 @@ See @ref types for more information, only types with GLSL equivalent can be used
@ref Magnum::Vector4i "Vector4i") or unsigned integer uniforms (i.e.
@ref Magnum::UnsignedInt "UnsignedInt", @ref Magnum::Vector2ui "Vector2ui",
@ref Magnum::Vector3ui "Vector3ui" and @ref Magnum::Vector4ui "Vector4ui").
@requires_gles30 Integer attributes and unsigned integer uniforms are not
available in OpenGL ES 2.0.
@requires_gl40 %Extension @extension{ARB,gpu_shader_fp64} is required when
using double uniforms (i.e. @ref Magnum::Double "Double",
@ref Magnum::Vector2d "Vector2d", @ref Magnum::Vector3d "Vector3d",
@ref Magnum::Vector4d "Vector4d", @ref Magnum::Matrix2d "Matrix2d",
@ref Magnum::Matrix3d "Matrix3d", @ref Magnum::Matrix4d "Matrix4d",
@ref Magnum::Vector4d "Vector4d", @ref Magnum::Matrix2x2d "Matrix2x2d",
@ref Magnum::Matrix3x3d "Matrix3x3d", @ref Magnum::Matrix4x4d "Matrix4x4d",
@ref Magnum::Matrix2x3d "Matrix2x3d", @ref Magnum::Matrix3x2d "Matrix3x2d",
@ref Magnum::Matrix2x4d "Matrix2x4d", @ref Magnum::Matrix4x2d "Matrix4x2d",
@ref Magnum::Matrix3x4d "Matrix3x4d" and @ref Magnum::Matrix4x3d "Matrix4x3d").
@requires_gl41 %Extension @extension{ARB,vertex_attrib_64bit} is required when
using double attributes (i.e. @ref Magnum::Double "Double",
@ref Magnum::Vector2d "Vector2d", @ref Magnum::Vector3d "Vector3d",
@ref Magnum::Vector4d "Vector4d", @ref Magnum::Matrix2d "Matrix2d",
@ref Magnum::Matrix3d "Matrix3d", @ref Magnum::Matrix4d "Matrix4d",
@ref Magnum::Vector4d "Vector4d", @ref Magnum::Matrix2x2d "Matrix2x2d",
@ref Magnum::Matrix3x3d "Matrix3x3d", @ref Magnum::Matrix4x4d "Matrix4x4d",
@ref Magnum::Matrix2x3d "Matrix2x3d", @ref Magnum::Matrix3x2d "Matrix3x2d",
@ref Magnum::Matrix2x4d "Matrix2x4d", @ref Magnum::Matrix4x2d "Matrix4x2d",
@ref Magnum::Matrix3x4d "Matrix3x4d" and @ref Magnum::Matrix4x3d "Matrix4x3d").
@requires_gl Double attributes and uniforms are not available in OpenGL ES.
@requires_gles30 Non-square matrix attributes and uniforms (i.e.
@ref Magnum::Matrix2x3 "Matrix2x3", @ref Magnum::Matrix3x2 "Matrix3x2",
@ref Magnum::Matrix2x4 "Matrix2x4", @ref Magnum::Matrix4x2d "Matrix4x2",
@ref Magnum::Matrix3x4 "Matrix3x4" and @ref Magnum::Matrix4x3 "Matrix4x3")
are not available in OpenGL ES 2.0.
@requires_gles30 Integer attributes, unsigned integer uniforms and non-square
matrix attributes and uniforms (i.e. @ref Magnum::Matrix2x3 "Matrix2x3",
@ref Magnum::Matrix3x2 "Matrix3x2", @ref Magnum::Matrix2x4 "Matrix2x4",
@ref Magnum::Matrix4x2d "Matrix4x2", @ref Magnum::Matrix3x4 "Matrix3x4" and
@ref Magnum::Matrix4x3 "Matrix4x3") are not available in OpenGL ES 2.0.
@requires_gl Double attributes and uniforms are not available in OpenGL ES.
@section AbstractShaderProgram-performance-optimization Performance optimizations
@ -303,16 +305,17 @@ The engine tracks currently used shader program to avoid unnecessary calls to
@fn_gl{UseProgram}. %Shader limits (such as @ref maxVertexAttributes())
are cached, so repeated queries don't result in repeated @fn_gl{Get} calls.
If extension @extension{ARB,separate_shader_objects} or
If extension @extension{ARB,separate_shader_objects} (part of OpenGL 4.1) or
@extension{EXT,direct_state_access} is available, uniform setting functions
use DSA functions to avoid unnecessary calls to @fn_gl{UseProgram}. See
setUniform() documentation for more information.
@ref setUniform() documentation for more information.
To achieve least state changes, set all uniforms in one run -- method chaining
comes in handy.
@see @ref portability-shaders
@todo Use Containers::ArrayReference for setting uniform arrays?
@todo Compiling and linking more than one shader in parallel, then checking
status, should be faster -- https://twitter.com/g_truc/status/352778836657700866
@todo `GL_NUM_{PROGRAM,SHADER}_BINARY_FORMATS` + `GL_{PROGRAM,SHADER}_BINARY_FORMATS` (vector), (@extension{ARB,ES2_compatibility})
@ -586,7 +589,7 @@ class MAGNUM_EXPORT AbstractShaderProgram: public AbstractObject {
/**
* @brief Attach shader
*
* @fn_gl{AttachShader}
* @see @fn_gl{AttachShader}
*/
void attachShader(Shader& shader);
@ -609,11 +612,11 @@ class MAGNUM_EXPORT AbstractShaderProgram: public AbstractObject {
/**
* @brief Bind fragment data to given location and color input index
* @param location Location
* @param name Fragment output variable name
* @param index Blend equation color input index (`0` or `1`)
* @param name Fragment output variable name
*
* Binds fragment data to location which is used later for framebuffer
* operations. See also Framebuffer::BlendFunction for more
* operations. See also @ref Renderer::BlendFunction for more
* information about using color input index.
* @deprecated_gl Preferred usage is to specify attribute location
* explicitly in the shader instead of using this function. See
@ -631,12 +634,13 @@ class MAGNUM_EXPORT AbstractShaderProgram: public AbstractObject {
* @param location Location
* @param name Fragment output variable name
*
* The same as bindFragmentDataLocationIndexed(), but with `index` set
* to `0`.
* The same as @ref bindFragmentDataLocationIndexed(), but with `index`
* set to `0`.
* @see @fn_gl{BindFragDataLocation}
* @requires_gl30 %Extension @extension{EXT,gpu_shader4}
* @requires_gl Use explicit location specification in OpenGL ES 3.0
* instead.
* and `gl_FragData[n]` provided by @es_extension2{NV,draw_buffers,GL_NV_draw_buffers}
* in OpenGL ES 2.0.
*/
void bindFragmentDataLocation(UnsignedInt location, const std::string& name);
#endif
@ -646,7 +650,7 @@ class MAGNUM_EXPORT AbstractShaderProgram: public AbstractObject {
*
* Returns `false` if linking failed, `true` otherwise. Compiler
* message (if any) is printed to error output. All attached shaders
* must be explicitly compiled with Shader::compile() before linking.
* must be compiled with @ref Shader::compile() before linking.
* @see @fn_gl{LinkProgram}, @fn_gl{GetProgram} with
* @def_gl{LINK_STATUS} and @def_gl{INFO_LOG_LENGTH},
* @fn_gl{GetProgramInfoLog}
@ -671,7 +675,8 @@ class MAGNUM_EXPORT AbstractShaderProgram: public AbstractObject {
* @param value Value
*
* Convenience alternative for setting one value, see
* setUniform(Int, UnsignedInt, const Float*) for more information.
* @ref setUniform(Int, UnsignedInt, const Float*) for more
* information.
*/
#ifdef DOXYGEN_GENERATING_OUTPUT
template<class T> inline void setUniform(Int location, const T& value);
@ -706,10 +711,10 @@ class MAGNUM_EXPORT AbstractShaderProgram: public AbstractObject {
* @param count Value count
* @param values Values
*
* If neither @extension{ARB,separate_shader_objects} nor
* @extension{EXT,direct_state_access} is available, the shader is
* marked for use before the operation.
* @see setUniform(Int, const T&), @fn_gl{UseProgram}, @fn_gl{Uniform}
* If neither @extension{ARB,separate_shader_objects} (part of OpenGL
* 4.1) nor @extension{EXT,direct_state_access} is available, the
* shader is marked for use before the operation.
* @see @ref setUniform(Int, const T&), @fn_gl{UseProgram}, @fn_gl{Uniform}
* or @fn_gl{ProgramUniform}/@fn_gl_extension{ProgramUniform,EXT,direct_state_access}.
*/
void setUniform(Int location, UnsignedInt count, const Float* values) {
@ -1155,10 +1160,10 @@ Template parameter @p T is the type which is used for shader attribute, e.g.
buffers to mesh. By default it is the same as type used in shader (e.g.
@ref DataType::Int for @ref Vector4i). It's also possible to pass integer data
to floating-point shader inputs. In this case you may want to normalize the
values (e.g. color components from 0-255 to 0.0f - 1.0f) -- see @ref DataOption::Normalize.
values (e.g. color components from 0-255 to 0.0f - 1.0f) -- see @ref DataOption::Normalized.
Only some types are allowed as attribute types, see @ref AbstractShaderProgram-types
or TypeTraits::AttributeType for more information.
for more information.
See @ref AbstractShaderProgram-subclassing for example usage in shaders and
@ref Mesh-configuration for example usage when adding vertex buffers to mesh.
@ -1166,14 +1171,21 @@ See @ref AbstractShaderProgram-subclassing for example usage in shaders and
template<UnsignedInt location, class T> class AbstractShaderProgram::Attribute {
public:
enum: UnsignedInt {
Location = location /**< Location to which the attribute is bound */
Location = location, /**< Location to which the attribute is bound */
/**
* Count of vectors in this type
*
* @see @ref vectorSize()
*/
VectorCount = Implementation::Attribute<T>::VectorCount
};
/**
* @brief Type
*
* Type used in shader code.
* @see DataType
* @see @ref DataType
*/
typedef typename Implementation::Attribute<T>::Type Type;
@ -1216,12 +1228,13 @@ template<UnsignedInt location, class T> class AbstractShaderProgram::Attribute {
#ifndef MAGNUM_TARGET_GLES
/**
* Four components with BGRA ordering. Only for four-component
* float vector type.
* float vector type. Must be used along with @ref DataType::UnsignedByte
* and @ref DataOption::Normalized.
* @requires_gl32 %Extension @extension{ARB,vertex_array_bgra}
* @requires_gl Only RGBA component ordering is supported in OpenGL
* ES.
*/
BGRA = 1 << 1
BGRA = GL_BGRA
#endif
};
#else
@ -1232,7 +1245,7 @@ template<UnsignedInt location, class T> class AbstractShaderProgram::Attribute {
* @brief Data type
*
* Type of data passed to shader.
* @see Type, DataOptions, Attribute()
* @see @ref Type, @ref DataOptions, @ref Attribute()
*/
#ifdef DOXYGEN_GENERATING_OUTPUT
enum class DataType: GLenum {
@ -1288,7 +1301,7 @@ template<UnsignedInt location, class T> class AbstractShaderProgram::Attribute {
/**
* @brief Data option
* @see DataOptions, Attribute()
* @see @ref DataOptions, @ref Attribute()
*/
#ifdef DOXYGEN_GENERATING_OUTPUT
enum class DataOption: UnsignedByte {
@ -1296,7 +1309,7 @@ template<UnsignedInt location, class T> class AbstractShaderProgram::Attribute {
* Normalize integer components. Only for float attribute types.
* Default is to not normalize.
*/
Normalize = 1 << 0
Normalized = 1 << 0
};
#else
typedef typename Implementation::Attribute<T>::DataOption DataOption;
@ -1304,7 +1317,7 @@ template<UnsignedInt location, class T> class AbstractShaderProgram::Attribute {
/**
* @brief Data options
* @see Attribute()
* @see @ref Attribute()
*/
#ifdef DOXYGEN_GENERATING_OUTPUT
typedef typename Containers::EnumSet<DataOption, UnsignedByte> DataOptions;
@ -1316,7 +1329,7 @@ template<UnsignedInt location, class T> class AbstractShaderProgram::Attribute {
* @brief Constructor
* @param components Component count
* @param dataType Type of passed data. Default is the same as
* type used in shader (e.g. DataType::Integer for Vector4i).
* type used in shader (e.g. @ref DataType::Int for @ref Vector4i).
* @param dataOptions Data options. Default is no options.
*/
constexpr Attribute(Components components, DataType dataType = Implementation::Attribute<T>::DefaultDataType, DataOptions dataOptions = DataOptions()): _components(components), _dataType(dataType), _dataOptions(dataOptions) {}
@ -1338,9 +1351,13 @@ template<UnsignedInt location, class T> class AbstractShaderProgram::Attribute {
/** @brief Type of passed data */
constexpr DataType dataType() const { return _dataType; }
/** @brief Size of passed data */
std::size_t dataSize() const {
return Implementation::Attribute<T>::size(GLint(_components)*Implementation::Attribute<T>::vectorCount(), _dataType);
/**
* @brief Size of each vector in passed data
*
* @see @ref VectorCount
*/
UnsignedInt vectorSize() const {
return Implementation::Attribute<T>::size(GLint(_components), _dataType);
}
/** @brief Data options */
@ -1367,7 +1384,7 @@ template<std::size_t cols, std::size_t rows> struct SizedAttribute;
/* Vector attribute sizes */
template<std::size_t cols> struct SizedVectorAttribute {
constexpr static std::size_t vectorCount() { return cols; }
enum: UnsignedInt { VectorCount = UnsignedInt(cols) };
};
template<> struct SizedAttribute<1, 1>: SizedVectorAttribute<1> {
enum class Components: GLint { One = 1 };
@ -1628,7 +1645,7 @@ template<> struct Attribute<Math::Vector<4, Float>> {
};
typedef Containers::EnumSet<DataOption, UnsignedByte> DataOptions;
constexpr static std::size_t vectorCount() { return 1; }
enum: UnsignedInt { VectorCount = 1 };
static std::size_t MAGNUM_EXPORT size(GLint components, DataType dataType);
};

17
src/AbstractTexture.cpp → src/Magnum/AbstractTexture.cpp

@ -24,13 +24,16 @@
#include "AbstractTexture.h"
#include "BufferImage.h"
#include "ColorFormat.h"
#include "Context.h"
#include "Extensions.h"
#include "Image.h"
#include "Shader.h"
#include "TextureFormat.h"
#ifndef MAGNUM_TARGET_GLES2
#include "Magnum/BufferImage.h"
#endif
#include "Magnum/ColorFormat.h"
#include "Magnum/Context.h"
#include "Magnum/Extensions.h"
#include "Magnum/Image.h"
#include "Magnum/Shader.h"
#include "Magnum/TextureFormat.h"
#include "Implementation/DebugState.h"
#include "Implementation/State.h"
#include "Implementation/TextureState.h"

11
src/AbstractTexture.h → src/Magnum/AbstractTexture.h

@ -28,10 +28,10 @@
* @brief Class @ref Magnum::AbstractTexture
*/
#include "Array.h"
#include "Color.h"
#include "Sampler.h"
#include "AbstractObject.h"
#include "Magnum/Array.h"
#include "Magnum/Color.h"
#include "Magnum/Sampler.h"
#include "Magnum/AbstractObject.h"
#ifdef CORRADE_GCC45_COMPATIBILITY
#include "Buffer.h"
@ -101,6 +101,7 @@ nothing.
@todo `GL_MAX_TEXTURE_LOD_BIAS` when `TEXTURE_LOD_BIAS` is implemented
@todo `GL_NUM_COMPRESSED_TEXTURE_FORMATS` when compressed textures are implemented
@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 {
friend class Context;
@ -299,7 +300,7 @@ class MAGNUM_EXPORT AbstractTexture: public AbstractObject {
* @param level Mip level
*
* If running on OpenGL ES or extension @extension{ARB,invalidate_subdata}
* is not available, this function does nothing.
* (part of OpenGL 4.3) is not available, this function does nothing.
* @see @ref Texture::invalidateSubImage() "invalidateSubImage()",
* @fn_gl{InvalidateTexImage}
*/

6
src/Array.h → src/Magnum/Array.h

@ -24,14 +24,14 @@
DEALINGS IN THE SOFTWARE.
*/
/** @file /Array.h
/** @file
* @brief Class Magnum::Array, Magnum::Array1D, Magnum::Array2D, Magnum::Array3D
*/
#include <type_traits>
#include "Math/BoolVector.h" /* for Math::Implementation::Sequence */
#include "Magnum.h"
#include "Magnum/Magnum.h"
#include "Magnum/Math/BoolVector.h" /* for Math::Implementation::Sequence */
#ifdef CORRADE_MSVC2013_COMPATIBILITY
#include <array>

6
src/Audio/AbstractImporter.cpp → src/Magnum/Audio/AbstractImporter.cpp

@ -24,9 +24,9 @@
#include "AbstractImporter.h"
#include <Containers/Array.h>
#include <Utility/Assert.h>
#include <Utility/Directory.h>
#include <Corrade/Containers/Array.h>
#include <Corrade/Utility/Assert.h>
#include <Corrade/Utility/Directory.h>
namespace Magnum { namespace Audio {

6
src/Audio/AbstractImporter.h → src/Magnum/Audio/AbstractImporter.h

@ -28,10 +28,10 @@
* @brief Class Magnum::Audio::AbstractImporter
*/
#include <PluginManager/AbstractPlugin.h>
#include <Corrade/PluginManager/AbstractPlugin.h>
#include "Magnum.h"
#include "Audio/Buffer.h"
#include "Magnum/Magnum.h"
#include "Magnum/Audio/Buffer.h"
namespace Magnum { namespace Audio {

2
src/Audio/Audio.cpp → src/Magnum/Audio/Audio.cpp

@ -25,7 +25,7 @@
#include <type_traits>
#include <al.h>
#include "Types.h"
#include "Magnum/Types.h"
namespace Magnum { namespace Audio {

0
src/Audio/Audio.h → src/Magnum/Audio/Audio.h

2
src/Audio/Buffer.cpp → src/Magnum/Audio/Buffer.cpp

@ -24,7 +24,7 @@
#include "Buffer.h"
#include <Utility/Debug.h>
#include <Corrade/Utility/Debug.h>
namespace Magnum { namespace Audio {

6
src/Audio/Buffer.h → src/Magnum/Audio/Buffer.h

@ -30,10 +30,10 @@
#include <utility>
#include <al.h>
#include <Containers/Array.h>
#include <Corrade/Containers/Array.h>
#include "Magnum.h"
#include "Audio/magnumAudioVisibility.h"
#include "Magnum/Magnum.h"
#include "Magnum/Audio/visibility.h"
namespace Magnum { namespace Audio {

2
src/Audio/CMakeLists.txt → src/Magnum/Audio/CMakeLists.txt

@ -42,7 +42,7 @@ set(MagnumAudio_HEADERS
Renderer.h
Source.h
magnumAudioVisibility.h)
visibility.h)
add_library(MagnumAudio ${SHARED_OR_STATIC} ${MagnumAudio_SOURCES})
target_link_libraries(MagnumAudio ${CORRADE_PLUGINMANAGER_LIBRARIES} ${OPENAL_LIBRARY})

6
src/Audio/Context.cpp → src/Magnum/Audio/Context.cpp

@ -25,10 +25,10 @@
#include "Context.h"
#include <alc.h>
#include <Utility/Assert.h>
#include <Utility/Debug.h>
#include <Corrade/Utility/Assert.h>
#include <Corrade/Utility/Debug.h>
#include "Magnum.h"
#include "Magnum/Magnum.h"
namespace Magnum { namespace Audio {

4
src/Audio/Context.h → src/Magnum/Audio/Context.h

@ -28,10 +28,10 @@
* @brief Class Magnum::Audio::Context
*/
#include <al.h>
#include <string>
#include <al.h>
#include "Audio/magnumAudioVisibility.h"
#include "Magnum/Audio/visibility.h"
#ifndef DOXYGEN_GENERATING_OUTPUT
typedef struct ALCdevice_struct ALCdevice;

2
src/Audio/Renderer.cpp → src/Magnum/Audio/Renderer.cpp

@ -24,7 +24,7 @@
#include "Renderer.h"
#include <Utility/Debug.h>
#include <Corrade/Utility/Debug.h>
namespace Magnum { namespace Audio {

6
src/Audio/Renderer.h → src/Magnum/Audio/Renderer.h

@ -30,9 +30,9 @@
#include <al.h>
#include "Math/Vector3.h"
#include "Magnum.h"
#include "Audio/magnumAudioVisibility.h"
#include "Magnum/Magnum.h"
#include "Magnum/Audio/visibility.h"
#include "Magnum/Math/Vector3.h"
namespace Magnum { namespace Audio {

4
src/Audio/Source.cpp → src/Magnum/Audio/Source.cpp

@ -24,9 +24,9 @@
#include "Source.h"
#include <Containers/Array.h>
#include <Corrade/Containers/Array.h>
#include "Audio/Buffer.h"
#include "Magnum/Audio/Buffer.h"
namespace Magnum { namespace Audio {

8
src/Audio/Source.h → src/Magnum/Audio/Source.h

@ -32,10 +32,10 @@
#include <vector>
#include <al.h>
#include "Math/Vector3.h"
#include "Magnum.h"
#include "Audio/Audio.h"
#include "Audio/magnumAudioVisibility.h"
#include "Magnum/Magnum.h"
#include "Magnum/Audio/Audio.h"
#include "Magnum/Audio/visibility.h"
#include "Magnum/Math/Vector3.h"
namespace Magnum { namespace Audio {

10
src/Audio/Test/AbstractImporterTest.cpp → src/Magnum/Audio/Test/AbstractImporterTest.cpp

@ -22,13 +22,13 @@
DEALINGS IN THE SOFTWARE.
*/
#include <Containers/Array.h>
#include <TestSuite/Tester.h>
#include <Utility/Directory.h>
#include <Corrade/Containers/Array.h>
#include <Corrade/TestSuite/Tester.h>
#include <Corrade/Utility/Directory.h>
#include "Audio/AbstractImporter.h"
#include "Magnum/Audio/AbstractImporter.h"
#include "testConfigure.h"
#include "configure.h"
namespace Magnum { namespace Audio { namespace Test {

4
src/Audio/Test/BufferTest.cpp → src/Magnum/Audio/Test/BufferTest.cpp

@ -23,9 +23,9 @@
*/
#include <sstream>
#include <TestSuite/Tester.h>
#include <Corrade/TestSuite/Tester.h>
#include "Audio/Buffer.h"
#include "Magnum/Audio/Buffer.h"
namespace Magnum { namespace Audio { namespace Test {

6
src/Audio/Test/CMakeLists.txt → src/Magnum/Audio/Test/CMakeLists.txt

@ -22,10 +22,10 @@
# DEALINGS IN THE SOFTWARE.
#
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/testConfigure.h.cmake
${CMAKE_CURRENT_BINARY_DIR}/testConfigure.h)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/configure.h.cmake
${CMAKE_CURRENT_BINARY_DIR}/configure.h)
include_directories(${CMAKE_CURRENT_BINARY_DIR})
include_directories(BEFORE ${CMAKE_CURRENT_BINARY_DIR})
corrade_add_test(AudioAbstractImporterTest AbstractImporterTest.cpp LIBRARIES MagnumAudio)
corrade_add_test(AudioBufferTest BufferTest.cpp LIBRARIES MagnumAudio)

4
src/Audio/Test/RendererTest.cpp → src/Magnum/Audio/Test/RendererTest.cpp

@ -23,9 +23,9 @@
*/
#include <sstream>
#include <TestSuite/Tester.h>
#include <Corrade/TestSuite/Tester.h>
#include "Audio/Renderer.h"
#include "Magnum/Audio/Renderer.h"
namespace Magnum { namespace Audio { namespace Test {

4
src/Audio/Test/SourceTest.cpp → src/Magnum/Audio/Test/SourceTest.cpp

@ -23,9 +23,9 @@
*/
#include <sstream>
#include <TestSuite/Tester.h>
#include <Corrade/TestSuite/Tester.h>
#include "Audio/Source.h"
#include "Magnum/Audio/Source.h"
namespace Magnum { namespace Audio { namespace Test {

0
src/Audio/Test/testConfigure.h.cmake → src/Magnum/Audio/Test/configure.h.cmake

0
src/Audio/Test/file.bin → src/Magnum/Audio/Test/file.bin

8
src/Audio/magnumAudioVisibility.h → src/Magnum/Audio/visibility.h

@ -1,5 +1,5 @@
#ifndef Magnum_Audio_magnumAudioVisibility_h
#define Magnum_Audio_magnumAudioVisibility_h
#ifndef Magnum_Audio_visibility_h
#define Magnum_Audio_visibility_h
/*
This file is part of Magnum.
@ -24,9 +24,9 @@
DEALINGS IN THE SOFTWARE.
*/
#include <Utility/Visibility.h>
#include <Corrade/Utility/VisibilityMacros.h>
#include "magnumConfigure.h"
#include "Magnum/configure.h"
#ifndef MAGNUM_BUILD_STATIC
#ifdef MagnumAudio_EXPORTS

10
src/Buffer.cpp → src/Magnum/Buffer.cpp

@ -24,10 +24,11 @@
#include "Buffer.h"
#include <Utility/Debug.h>
#include <Corrade/Utility/Debug.h>
#include "Magnum/Context.h"
#include "Magnum/Extensions.h"
#include "Context.h"
#include "Extensions.h"
#include "Implementation/State.h"
#include "Implementation/BufferState.h"
#include "Implementation/DebugState.h"
@ -79,6 +80,9 @@ void Buffer::initializeContextBasedFunctionality(Context& context) {
#ifndef MAGNUM_TARGET_GLES
Int Buffer::minMapAlignment() {
if(!Context::current()->isExtensionSupported<Extensions::GL::ARB::map_buffer_alignment>())
return 0;
GLint& value = Context::current()->state().buffer->minMapAlignment;
if(value == 0)

23
src/Buffer.h → src/Magnum/Buffer.h

@ -24,19 +24,19 @@
DEALINGS IN THE SOFTWARE.
*/
/** @file /Buffer.h
/** @file
* @brief Class @ref Magnum::Buffer, enum @ref Magnum::BufferUsage
*/
#include <cstddef>
#include <array>
#include <vector>
#include <Containers/Array.h>
#include <Containers/EnumSet.h>
#include <Utility/Assert.h>
#include <Corrade/Containers/Array.h>
#include <Corrade/Containers/EnumSet.h>
#include <Corrade/Utility/Assert.h>
#include "AbstractObject.h"
#include "Magnum.h"
#include "Magnum/AbstractObject.h"
#include "Magnum/Magnum.h"
namespace Magnum {
@ -422,7 +422,8 @@ class MAGNUM_EXPORT Buffer: public AbstractObject {
* @brief Minimal supported mapping alignment
*
* The result is cached, repeated queries don't result in repeated
* OpenGL calls.
* OpenGL calls. If extension @extension{ARB,map_buffer_alignment} is
* not available, returns `0`.
* @see @ref map(), @fn_gl{Get} with @def_gl{MIN_MAP_BUFFER_ALIGNMENT}
* @requires_gl No minimal value is specified for OpenGL ES.
*/
@ -636,7 +637,7 @@ class MAGNUM_EXPORT Buffer: public AbstractObject {
* @requires_gl %Buffer data queries are not available in OpenGL ES.
* Use @ref Magnum::Buffer::map() "map()" instead.
*/
template<class T> Containers::Array<T> data();
template<class T = unsigned char> Containers::Array<T> data();
/**
* @brief %Buffer subdata
@ -652,7 +653,7 @@ class MAGNUM_EXPORT Buffer: public AbstractObject {
* @requires_gl %Buffer data queries are not available in OpenGL ES.
* Use @ref Magnum::Buffer::map() "map()" instead.
*/
template<class T> Containers::Array<T> subData(GLintptr offset, GLsizeiptr size);
template<class T = unsigned char> Containers::Array<T> subData(GLintptr offset, GLsizeiptr size);
#endif
/**
@ -741,7 +742,7 @@ class MAGNUM_EXPORT Buffer: public AbstractObject {
* @return Reference to self (for method chaining)
*
* If running on OpenGL ES or extension @extension{ARB,invalidate_subdata}
* is not available, this function does nothing.
* (part of OpenGL 4.3) is not available, this function does nothing.
* @see @ref MapFlag::InvalidateBuffer, @fn_gl{InvalidateBufferData}
*/
Buffer& invalidateData() {
@ -756,7 +757,7 @@ class MAGNUM_EXPORT Buffer: public AbstractObject {
* @return Reference to self (for method chaining)
*
* If running on OpenGL ES or extension @extension{ARB,invalidate_subdata}
* is not available, this function does nothing.
* (part of OpenGL 4.3) is not available, this function does nothing.
* @see @ref MapFlag::InvalidateRange, @fn_gl{InvalidateBufferData}
*/
Buffer& invalidateSubData(GLintptr offset, GLsizeiptr length) {

0
src/BufferImage.cpp → src/Magnum/BufferImage.cpp

15
src/BufferImage.h → src/Magnum/BufferImage.h

@ -30,10 +30,10 @@
*/
#endif
#include "Math/Vector3.h"
#include "AbstractImage.h"
#include "Buffer.h"
#include "DimensionTraits.h"
#include "Magnum/AbstractImage.h"
#include "Magnum/Buffer.h"
#include "Magnum/DimensionTraits.h"
#include "Magnum/Math/Vector3.h"
namespace Magnum {
@ -88,6 +88,11 @@ template<UnsignedInt dimensions> class MAGNUM_EXPORT BufferImage: public Abstrac
/** @brief %Image size */
typename DimensionTraits<Dimensions, Int>::VectorType size() const { return _size; }
/** @copydoc Image::dataSize() */
std::size_t dataSize(const typename DimensionTraits<Dimensions, Int>::VectorType& size) const {
return AbstractImage::dataSize<dimensions>(size);
}
/** @brief %Image buffer */
Buffer& buffer() { return _buffer; }
@ -139,6 +144,8 @@ template<UnsignedInt dimensions> inline BufferImage<dimensions>& BufferImage<dim
std::swap(_buffer, other._buffer);
return *this;
}
#else
#error this header is available only on desktop OpenGL and OpenGL ES 3.0 build
#endif
}

6
src/BufferTexture.cpp → src/Magnum/BufferTexture.cpp

@ -25,9 +25,9 @@
#include "BufferTexture.h"
#ifndef MAGNUM_TARGET_GLES
#include "Buffer.h"
#include "Context.h"
#include "Extensions.h"
#include "Magnum/Buffer.h"
#include "Magnum/Context.h"
#include "Magnum/Extensions.h"
#include "Implementation/State.h"
#include "Implementation/TextureState.h"

4
src/BufferTexture.h → src/Magnum/BufferTexture.h

@ -30,7 +30,7 @@
*/
#endif
#include "AbstractTexture.h"
#include "Magnum/AbstractTexture.h"
#ifndef MAGNUM_TARGET_GLES
namespace Magnum {
@ -290,6 +290,8 @@ class MAGNUM_EXPORT BufferTexture: private AbstractTexture {
};
}
#else
#error this header is available only on desktop OpenGL build
#endif
#endif

244
src/Magnum/CMakeLists.txt

@ -0,0 +1,244 @@
#
# This file is part of Magnum.
#
# Copyright © 2010, 2011, 2012, 2013 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.
#
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/configure.h.cmake
${CMAKE_CURRENT_BINARY_DIR}/configure.h)
# Files shared between main library and unit test library
set(Magnum_SRCS
AbstractFramebuffer.cpp
AbstractImage.cpp
AbstractObject.cpp
AbstractTexture.cpp
AbstractShaderProgram.cpp
Buffer.cpp
ColorFormat.cpp
Context.cpp
DebugMessage.cpp
DefaultFramebuffer.cpp
Framebuffer.cpp
Image.cpp
Mesh.cpp
MeshView.cpp
OpenGL.cpp
Query.cpp
Renderbuffer.cpp
Renderer.cpp
Resource.cpp
Sampler.cpp
Shader.cpp
Timeline.cpp
Version.cpp
Implementation/BufferState.cpp
Implementation/DebugState.cpp
Implementation/State.cpp
Implementation/TextureState.cpp
Trade/AbstractImageConverter.cpp
Trade/AbstractImporter.cpp
Trade/AbstractMaterialData.cpp
Trade/MeshData2D.cpp
Trade/MeshData3D.cpp
Trade/MeshObjectData2D.cpp
Trade/MeshObjectData3D.cpp
Trade/ObjectData2D.cpp
Trade/ObjectData3D.cpp
Trade/PhongMaterialData.cpp
Trade/SceneData.cpp
Trade/TextureData.cpp)
# Desktop-only code
if(NOT TARGET_GLES)
set(Magnum_SRCS ${Magnum_SRCS}
BufferTexture.cpp)
endif()
# Not-ES2 code
if(NOT TARGET_GLES2)
set(Magnum_SRCS ${Magnum_SRCS}
BufferImage.cpp)
endif()
set(Magnum_HEADERS
AbstractFramebuffer.h
AbstractImage.h
AbstractObject.h
AbstractResourceLoader.h
AbstractShaderProgram.h
AbstractTexture.h
Array.h
Buffer.h
Color.h
ColorFormat.h
Context.h
CubeMapTexture.h
DebugMessage.h
DefaultFramebuffer.h
DimensionTraits.h
Extensions.h
Framebuffer.h
Image.h
ImageReference.h
Magnum.h
Mesh.h
MeshView.h
OpenGL.h
Query.h
Renderbuffer.h
RenderbufferFormat.h
Renderer.h
Resource.h
ResourceManager.h
Sampler.h
Shader.h
Texture.h
TextureFormat.h
Timeline.h
Types.h
Version.h
visibility.h)
# Deprecated headers
if(BUILD_DEPRECATED)
set(Magnum_HEADERS ${Magnum_HEADERS}
DebugMarker.h
ImageFormat.h
Swizzle.h)
endif()
# Desktop-only headers and libraries
if(NOT TARGET_GLES)
set(Magnum_HEADERS ${Magnum_HEADERS}
BufferTexture.h
CubeMapTextureArray.h)
set(Magnum_SRCS ${Magnum_SRCS} $<TARGET_OBJECTS:MagnumGLLoadGenObjects>)
endif()
# Not-ES2 headers
if(NOT TARGET_GLES2)
set(Magnum_HEADERS ${Magnum_HEADERS}
BufferImage.h)
endif()
# Files shared between main library and math unit test library
set(MagnumMath_SRCS
Math/Functions.cpp
Math/instantiation.cpp)
# Main library
add_library(MagnumMathObjects OBJECT ${MagnumMath_SRCS})
add_library(Magnum ${SHARED_OR_STATIC}
${Magnum_SRCS}
$<TARGET_OBJECTS:MagnumMathObjects>)
# TODO: fix when CMake sets target_EXPORTS for OBJECT targets as well
if(NOT BUILD_STATIC OR BUILD_STATIC_PIC)
# Set shared library flags for the objects, as they will be part of shared lib
# TODO: CMake 2.8.9 has this as POSITION_INDEPENDENT_CODE property
set_target_properties(MagnumMathObjects PROPERTIES COMPILE_FLAGS "-DMagnumMathObjects_EXPORTS ${CMAKE_SHARED_LIBRARY_CXX_FLAGS}")
set_target_properties(Magnum PROPERTIES COMPILE_FLAGS "-DGLLoadGen_EXPORTS ${CMAKE_SHARED_LIBRARY_CXX_FLAGS}")
else()
set_target_properties(MagnumMathObjects PROPERTIES COMPILE_FLAGS "-DMagnumMathObjects_EXPORTS")
set_target_properties(Magnum PROPERTIES COMPILE_FLAGS "-DGLLoadGen_EXPORTS")
endif()
set(Magnum_LIBS
${CORRADE_UTILITY_LIBRARIES}
${CORRADE_PLUGINMANAGER_LIBRARIES})
if(NOT TARGET_GLES OR TARGET_DESKTOP_GLES)
set(Magnum_LIBS ${Magnum_LIBS} ${OPENGL_gl_LIBRARY})
elseif(TARGET_GLES2)
set(Magnum_LIBS ${Magnum_LIBS} ${OPENGLES2_LIBRARY})
else()
set(Magnum_LIBS ${Magnum_LIBS} ${OPENGLES3_LIBRARY})
endif()
target_link_libraries(Magnum ${Magnum_LIBS})
install(TARGETS Magnum
RUNTIME DESTINATION ${MAGNUM_BINARY_INSTALL_DIR}
LIBRARY DESTINATION ${MAGNUM_LIBRARY_INSTALL_DIR}
ARCHIVE DESTINATION ${MAGNUM_LIBRARY_INSTALL_DIR})
install(FILES ${Magnum_HEADERS} DESTINATION ${MAGNUM_INCLUDE_INSTALL_DIR})
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/configure.h DESTINATION ${MAGNUM_INCLUDE_INSTALL_DIR})
add_subdirectory(Math)
add_subdirectory(Platform)
add_subdirectory(Trade)
if(WITH_AUDIO)
add_subdirectory(Audio)
endif()
if(WITH_DEBUGTOOLS)
add_subdirectory(DebugTools)
endif()
if(WITH_MESHTOOLS)
add_subdirectory(MeshTools)
endif()
if(WITH_PRIMITIVES)
add_subdirectory(Primitives)
endif()
if(WITH_SCENEGRAPH)
add_subdirectory(SceneGraph)
endif()
if(WITH_SHADERS)
add_subdirectory(Shaders)
endif()
if(WITH_SHAPES)
add_subdirectory(Shapes)
endif()
if(WITH_TEXT)
add_subdirectory(Text)
endif()
if(WITH_TEXTURETOOLS)
add_subdirectory(TextureTools)
endif()
if(BUILD_TESTS)
# Libraries with graceful assert for testing
add_library(MagnumMathTestLib ${SHARED_OR_STATIC}
$<TARGET_OBJECTS:MagnumMathObjects>)
set_target_properties(MagnumMathTestLib PROPERTIES COMPILE_FLAGS -DCORRADE_GRACEFUL_ASSERT)
target_link_libraries(MagnumMathTestLib ${CORRADE_UTILITY_LIBRARY})
# On Windows we need to install first and then run the tests to avoid "DLL
# not found" hell, thus we need to install this too
if(WIN32 AND NOT CMAKE_CROSSCOMPILING)
install(TARGETS MagnumMathTestLib
RUNTIME DESTINATION ${MAGNUM_BINARY_INSTALL_DIR}
LIBRARY DESTINATION ${MAGNUM_LIBRARY_INSTALL_DIR}
ARCHIVE DESTINATION ${MAGNUM_LIBRARY_INSTALL_DIR})
endif()
add_subdirectory(Test)
endif()

34
src/Color.h → src/Magnum/Color.h

@ -25,14 +25,14 @@
*/
/** @file
* @brief Class Magnum::BasicColor3, Magnum::BasicColor4, typedef Magnum::Color3, Magnum::Color4
* @brief Class @ref Magnum::BasicColor3, @ref Magnum::BasicColor4, typedef @ref Magnum::Color3, @ref Magnum::Color4
*/
#include <tuple>
#include "Math/Functions.h"
#include "Math/Vector4.h"
#include "Magnum.h"
#include "Magnum/Magnum.h"
#include "Magnum/Math/Functions.h"
#include "Magnum/Math/Vector4.h"
namespace Magnum {
@ -151,7 +151,7 @@ Conversion from and to HSV is done always using floating-point types, so hue
is always in range in range @f$ [0.0, 360.0] @f$, saturation and value in
range @f$ [0.0, 1.0] @f$.
@see @ref Color3, @ref BasicColor4
@see @ref Color3, @ref Color3ub, @ref BasicColor4
*/
/* Not using template specialization because some internal functions are
impossible to explicitly instantiate */
@ -305,7 +305,7 @@ template<class T> class BasicColor3: public Math::Vector3<T> {
* std::tie(hue, saturation, value) = color.toHSV();
* @endcode
*
* @see hue(), saturation(), value(), fromHSV()
* @see @ref hue(), @ref saturation(), @ref value(), @ref fromHSV()
*/
constexpr HSV toHSV() const {
return Implementation::toHSV<T>(*this);
@ -315,7 +315,7 @@ template<class T> class BasicColor3: public Math::Vector3<T> {
* @brief Hue
* @return Hue in range @f$ [0.0, 360.0] @f$.
*
* @see saturation(), value(), toHSV(), fromHSV()
* @see @ref saturation(), @ref value(), @ref toHSV(), @ref fromHSV()
*/
constexpr Math::Deg<FloatingPointType> hue() const {
return Math::Deg<FloatingPointType>(Implementation::hue<T>(*this));
@ -325,7 +325,7 @@ template<class T> class BasicColor3: public Math::Vector3<T> {
* @brief Saturation
* @return Saturation in range @f$ [0.0, 1.0] @f$.
*
* @see hue(), value(), toHSV(), fromHSV()
* @see @ref hue(), @ref value(), @ref toHSV(), @ref fromHSV()
*/
constexpr FloatingPointType saturation() const {
return Implementation::saturation<T>(*this);
@ -335,7 +335,7 @@ template<class T> class BasicColor3: public Math::Vector3<T> {
* @brief Value
* @return Value in range @f$ [0.0, 1.0] @f$.
*
* @see hue(), saturation(), toHSV(), fromHSV()
* @see @ref hue(), @ref saturation(), @ref toHSV(), @ref fromHSV()
*/
constexpr FloatingPointType value() const {
return Implementation::value<T>(*this);
@ -353,13 +353,16 @@ template<class T> class BasicColor3: public Math::Vector3<T> {
/** @brief Three-component (RGB) float color */
typedef BasicColor3<Float> Color3;
/** @brief Three-component (RGB) unsigned byte color */
typedef BasicColor3<UnsignedByte> Color3ub;
MAGNUM_VECTORn_OPERATOR_IMPLEMENTATION(3, BasicColor3)
/**
@brief Four-component (RGBA) color
See @ref BasicColor3 for more information.
@see @ref Color4
@see @ref Color4, @ref Color4ub
*/
/* Not using template specialization because some internal functions are
impossible to explicitly instantiate */
@ -468,7 +471,7 @@ class BasicColor4: public Math::Vector4<T> {
/**
* @copydoc BasicColor3::fromHSV()
* @param a Alpha value, defaults to 1.0 for floating-point types
* @param a Alpha value, defaults to `1.0` for floating-point types
* and maximum positive value for integral types.
*/
#ifndef CORRADE_MSVC2013_COMPATIBILITY
@ -487,14 +490,14 @@ class BasicColor4: public Math::Vector4<T> {
/**
* @brief Default constructor
*
* RGB components are set to zero, A component is set to 1.0 for
* RGB components are set to zero, A component is set to `1.0` for
* floating-point types and maximum positive value for integral types.
*/
constexpr /*implicit*/ BasicColor4(): Math::Vector4<T>(T(0), T(0), T(0), Implementation::fullChannel<T>()) {}
/**
* @copydoc BasicColor3::BasicColor3(T)
* @param alpha Alpha value, defaults to 1.0 for floating-point types
* @param alpha Alpha value, defaults to `1.0` for floating-point types
* and maximum positive value for integral types.
*/
#ifndef CORRADE_MSVC2013_COMPATIBILITY
@ -508,7 +511,7 @@ class BasicColor4: public Math::Vector4<T> {
* @param r R value
* @param g G value
* @param b B value
* @param a A value, defaults to 1.0 for floating-point types and
* @param a A value, defaults to `1.0` for floating-point types and
* maximum positive value for integral types.
*/
#ifndef CORRADE_MSVC2013_COMPATIBILITY
@ -574,6 +577,9 @@ class BasicColor4: public Math::Vector4<T> {
/** @brief Four-component (RGBA) float color */
typedef BasicColor4<Float> Color4;
/** @brief Four-component (RGBA) unsigned byte color */
typedef BasicColor4<UnsignedByte> Color4ub;
MAGNUM_VECTORn_OPERATOR_IMPLEMENTATION(4, BasicColor4)
/** @debugoperator{Magnum::BasicColor3} */

2
src/ColorFormat.cpp → src/Magnum/ColorFormat.cpp

@ -24,7 +24,7 @@
#include "ColorFormat.h"
#include <Utility/Debug.h>
#include <Corrade/Utility/Debug.h>
namespace Magnum {

6
src/ColorFormat.h → src/Magnum/ColorFormat.h

@ -28,9 +28,9 @@
* @brief Enum @ref Magnum::ColorFormat, @ref Magnum::ColorType
*/
#include "Magnum.h"
#include "OpenGL.h"
#include "magnumVisibility.h"
#include "Magnum/Magnum.h"
#include "Magnum/OpenGL.h"
#include "Magnum/visibility.h"
namespace Magnum {

39
src/Context.cpp → src/Magnum/Context.cpp

@ -26,20 +26,22 @@
#include <string>
#include <unordered_map>
#include <Utility/Debug.h>
#include <Utility/String.h>
#include "AbstractFramebuffer.h"
#include "AbstractShaderProgram.h"
#include "AbstractTexture.h"
#include "Buffer.h"
#include "BufferTexture.h"
#include "DefaultFramebuffer.h"
#include "Extensions.h"
#include "Framebuffer.h"
#include "Mesh.h"
#include "Renderbuffer.h"
#include "Renderer.h"
#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"
#ifndef MAGNUM_TARGET_GLES
#include "Magnum/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"
@ -213,6 +215,7 @@ const std::vector<Extension>& Extension::extensions(Version version) {
_extension(GL,OES,stencil1),
_extension(GL,OES,stencil4),
_extension(GL,OES,texture_3D)};
#ifdef MAGNUM_TARGET_GLES2
static const std::vector<Extension> extensionsES300{
_extension(GL,ANGLE,framebuffer_blit),
_extension(GL,ANGLE,framebuffer_multisample),
@ -246,6 +249,7 @@ const std::vector<Extension>& Extension::extensions(Version version) {
_extension(GL,OES,required_internalformat),
_extension(GL,OES,surfaceless_context)}; // done
#endif
#endif
switch(version) {
case Version::None: return extensions;
@ -264,7 +268,12 @@ const std::vector<Extension>& Extension::extensions(Version version) {
case Version::GL440: return extensions440;
#else
case Version::GLES200: return empty;
case Version::GLES300: return extensionsES300;
case Version::GLES300:
#ifdef MAGNUM_TARGET_GLES2
return extensionsES300;
#else
return empty;
#endif
#endif
}

16
src/Context.h → src/Magnum/Context.h

@ -24,18 +24,18 @@
DEALINGS IN THE SOFTWARE.
*/
/** @file /Context.h
/** @file
* @brief Class @ref Magnum::Context, @ref Magnum::Extension, macro @ref MAGNUM_ASSERT_VERSION_SUPPORTED(), @ref MAGNUM_ASSERT_EXTENSION_SUPPORTED()
*/
#include <cstdlib>
#include <bitset>
#include <vector>
#include <Containers/EnumSet.h>
#include <Corrade/Containers/EnumSet.h>
#include "Magnum.h"
#include "OpenGL.h"
#include "magnumVisibility.h"
#include "Magnum/Magnum.h"
#include "Magnum/OpenGL.h"
#include "Magnum/visibility.h"
#ifdef CORRADE_GCC45_COMPATIBILITY
#include "Version.h"
@ -273,7 +273,8 @@ class MAGNUM_EXPORT Context {
* If no version from the list is supported, returns lowest available
* OpenGL version (@ref Version::GL210 for desktop OpenGL,
* @ref Version::GLES200 for OpenGL ES).
* @see @ref isExtensionSupported(Version)
* @see isExtensionSupported(Version) const
* @todoc Explicit reference when Doxygen is sane
*/
Version supportedVersion(std::initializer_list<Version> versions) const;
@ -290,8 +291,9 @@ class MAGNUM_EXPORT Context {
* }
* @endcode
*
* @see @ref isExtensionSupported(const Extension&) const,
* @see isExtensionSupported(const Extension&) const,
* @ref MAGNUM_ASSERT_EXTENSION_SUPPORTED()
* @todoc Explicit reference when Doxygen is sane
*/
template<class T> bool isExtensionSupported() const {
return isVersionSupported(T::coreVersion()) || (isVersionSupported(T::requiredVersion()) && extensionStatus[T::Index]);

2
src/CubeMapTexture.h → src/Magnum/CubeMapTexture.h

@ -28,7 +28,7 @@
* @brief Class @ref Magnum::CubeMapTexture
*/
#include "AbstractTexture.h"
#include "Magnum/AbstractTexture.h"
namespace Magnum {

4
src/CubeMapTextureArray.h → src/Magnum/CubeMapTextureArray.h

@ -30,7 +30,7 @@
*/
#endif
#include "AbstractTexture.h"
#include "Magnum/AbstractTexture.h"
#ifndef MAGNUM_TARGET_GLES
namespace Magnum {
@ -261,6 +261,8 @@ class CubeMapTextureArray: public AbstractTexture {
};
}
#else
#error this header is available only on desktop OpenGL build
#endif
#endif

2
src/DebugMarker.h → src/Magnum/DebugMarker.h

@ -29,7 +29,7 @@
* @deprecated Use @ref DebugMessage.h instead.
*/
#include "DebugMessage.h"
#include "Magnum/DebugMessage.h"
#ifdef MAGNUM_BUILD_DEPRECATED
namespace Magnum {

10
src/DebugMessage.cpp → src/Magnum/DebugMessage.cpp

@ -24,12 +24,12 @@
#include "DebugMessage.h"
#include <Utility/Assert.h>
#include <Corrade/Utility/Assert.h>
#include "Context.h"
#include "Extensions.h"
#include "Implementation/State.h"
#include "Implementation/DebugState.h"
#include "Magnum/Context.h"
#include "Magnum/Extensions.h"
#include "Magnum/Implementation/State.h"
#include "Magnum/Implementation/DebugState.h"
namespace Magnum {

13
src/DebugMessage.h → src/Magnum/DebugMessage.h

@ -30,9 +30,9 @@
#include <string>
#include "Magnum.h"
#include "OpenGL.h"
#include "magnumVisibility.h"
#include "Magnum/Magnum.h"
#include "Magnum/OpenGL.h"
#include "Magnum/visibility.h"
namespace Magnum {
@ -281,7 +281,8 @@ class MAGNUM_EXPORT DebugMessage {
* supported and @extension{KHR,debug} is not available, this function
* does nothing.
* @see @ref setDefaultCallback(),
* @ref Renderer::Feature::DebugOutputSynchronous
* @ref Renderer::Feature::DebugOutputSynchronous,
* @fn_gl{DebugMessageCallback}
*/
static void setCallback(Callback callback, const void* userParam = nullptr);
@ -296,8 +297,8 @@ class MAGNUM_EXPORT DebugMessage {
* DebugMessage::Type::Marker, 1337, DebugMessage::Severity::Notification, "Hello from OpenGL command stream!");
* @endcode
*
* <pre>%DebugMessage::Source::Application %DebugMessage::Type::Marker -1 %DebugMessage::Severity::Notification
* Hello from OpenGL command stream!</pre>
* > %DebugMessage::Source::Application %DebugMessage::Type::Marker -1 %DebugMessage::Severity::Notification\n
* > &nbsp;&nbsp;&nbsp;&nbsp;Hello from OpenGL command stream!
*/
static void setDefaultCallback();

2
src/DebugTools/CMakeLists.txt → src/Magnum/DebugTools/CMakeLists.txt

@ -47,7 +47,7 @@ set(MagnumDebugTools_HEADERS
ResourceManager.h
ShapeRenderer.h
magnumDebugToolsVisibility.h)
visibility.h)
add_library(MagnumDebugTools ${SHARED_OR_STATIC} ${MagnumDebugTools_SRCS})
if(BUILD_STATIC_PIC)

2
src/DebugTools/DebugTools.h → src/Magnum/DebugTools/DebugTools.h

@ -28,7 +28,7 @@
* @brief Forward declarations for Magnum::DebugTools namespace
*/
#include "Types.h"
#include "Magnum/Types.h"
namespace Magnum { namespace DebugTools {

12
src/DebugTools/ForceRenderer.cpp → src/Magnum/DebugTools/ForceRenderer.cpp

@ -24,13 +24,13 @@
#include "ForceRenderer.h"
#include "Buffer.h"
#include "Mesh.h"
#include "DebugTools/ResourceManager.h"
#include "SceneGraph/AbstractCamera.h"
#include "Shaders/Flat.h"
#include "Magnum/Buffer.h"
#include "Magnum/Mesh.h"
#include "Magnum/DebugTools/ResourceManager.h"
#include "Magnum/SceneGraph/AbstractCamera.h"
#include "Magnum/Shaders/Flat.h"
#include "DebugTools/Implementation/ForceRendererTransformation.h"
#include "Implementation/ForceRendererTransformation.h"
namespace Magnum { namespace DebugTools {

11
src/DebugTools/ForceRenderer.h → src/Magnum/DebugTools/ForceRenderer.h

@ -28,12 +28,11 @@
* @brief Class Magnum::DebugTools::ForceRenderer, Magnum::DebugTools::ForceRendererOptions, typedef Magnum::DebugTools::ForceRenderer2D, Magnum::DebugTools::ForceRenderer3D
*/
#include "Color.h"
#include "Resource.h"
#include "SceneGraph/Drawable.h"
#include "Shaders/Shaders.h"
#include "magnumDebugToolsVisibility.h"
#include "Magnum/Color.h"
#include "Magnum/Resource.h"
#include "Magnum/SceneGraph/Drawable.h"
#include "Magnum/Shaders/Shaders.h"
#include "Magnum/DebugTools/visibility.h"
namespace Magnum { namespace DebugTools {

10
src/DebugTools/Implementation/AbstractBoxRenderer.cpp → src/Magnum/DebugTools/Implementation/AbstractBoxRenderer.cpp

@ -24,11 +24,11 @@
#include "AbstractBoxRenderer.h"
#include "Mesh.h"
#include "Primitives/Cube.h"
#include "Primitives/Square.h"
#include "Trade/MeshData2D.h"
#include "Trade/MeshData3D.h"
#include "Magnum/Mesh.h"
#include "Magnum/Primitives/Cube.h"
#include "Magnum/Primitives/Square.h"
#include "Magnum/Trade/MeshData2D.h"
#include "Magnum/Trade/MeshData3D.h"
namespace Magnum { namespace DebugTools { namespace Implementation {

6
src/DebugTools/Implementation/AbstractBoxRenderer.h → src/Magnum/DebugTools/Implementation/AbstractBoxRenderer.h

@ -26,10 +26,8 @@
#include "AbstractShapeRenderer.h"
#include "Resource.h"
#include "Shaders/Shaders.h"
#include "corradeCompatibility.h"
#include "Magnum/Resource.h"
#include "Magnum/Shaders/Shaders.h"
namespace Magnum { namespace DebugTools { namespace Implementation {

16
src/DebugTools/Implementation/AbstractShapeRenderer.cpp → src/Magnum/DebugTools/Implementation/AbstractShapeRenderer.cpp

@ -24,14 +24,14 @@
#include "AbstractShapeRenderer.h"
#include "AbstractShaderProgram.h"
#include "Buffer.h"
#include "Mesh.h"
#include "DebugTools/ResourceManager.h"
#include "MeshTools/CompressIndices.h"
#include "Shaders/Flat.h"
#include "Trade/MeshData2D.h"
#include "Trade/MeshData3D.h"
#include "Magnum/AbstractShaderProgram.h"
#include "Magnum/Buffer.h"
#include "Magnum/Mesh.h"
#include "Magnum/DebugTools/ResourceManager.h"
#include "Magnum/MeshTools/CompressIndices.h"
#include "Magnum/Shaders/Flat.h"
#include "Magnum/Trade/MeshData2D.h"
#include "Magnum/Trade/MeshData3D.h"
namespace Magnum { namespace DebugTools { namespace Implementation {

12
src/DebugTools/Implementation/AbstractShapeRenderer.h → src/Magnum/DebugTools/Implementation/AbstractShapeRenderer.h

@ -24,12 +24,12 @@
DEALINGS IN THE SOFTWARE.
*/
#include "DimensionTraits.h"
#include "Resource.h"
#include "DebugTools/DebugTools.h"
#include "SceneGraph/SceneGraph.h"
#include "Shaders/Shaders.h"
#include "Trade/Trade.h"
#include "Magnum/DimensionTraits.h"
#include "Magnum/Resource.h"
#include "Magnum/DebugTools/DebugTools.h"
#include "Magnum/SceneGraph/SceneGraph.h"
#include "Magnum/Shaders/Shaders.h"
#include "Magnum/Trade/Trade.h"
namespace Magnum {

8
src/DebugTools/Implementation/AxisAlignedBoxRenderer.cpp → src/Magnum/DebugTools/Implementation/AxisAlignedBoxRenderer.cpp

@ -24,10 +24,10 @@
#include "AxisAlignedBoxRenderer.h"
#include "Mesh.h"
#include "DebugTools/ShapeRenderer.h"
#include "Shapes/AxisAlignedBox.h"
#include "Shaders/Flat.h"
#include "Magnum/Mesh.h"
#include "Magnum/DebugTools/ShapeRenderer.h"
#include "Magnum/Shapes/AxisAlignedBox.h"
#include "Magnum/Shaders/Flat.h"
namespace Magnum { namespace DebugTools { namespace Implementation {

6
src/DebugTools/Implementation/AxisAlignedBoxRenderer.h → src/Magnum/DebugTools/Implementation/AxisAlignedBoxRenderer.h

@ -24,11 +24,11 @@
DEALINGS IN THE SOFTWARE.
*/
#include "AbstractBoxRenderer.h"
#include <Corrade/compatibility.h>
#include "Shapes/Shapes.h"
#include "Magnum/Shapes/Shapes.h"
#include "corradeCompatibility.h"
#include "AbstractBoxRenderer.h"
namespace Magnum { namespace DebugTools { namespace Implementation {

8
src/DebugTools/Implementation/BoxRenderer.cpp → src/Magnum/DebugTools/Implementation/BoxRenderer.cpp

@ -24,10 +24,10 @@
#include "BoxRenderer.h"
#include "Mesh.h"
#include "DebugTools/ShapeRenderer.h"
#include "Shapes/Box.h"
#include "Shaders/Flat.h"
#include "Magnum/Mesh.h"
#include "Magnum/DebugTools/ShapeRenderer.h"
#include "Magnum/Shapes/Box.h"
#include "Magnum/Shaders/Flat.h"
namespace Magnum { namespace DebugTools { namespace Implementation {

6
src/DebugTools/Implementation/BoxRenderer.h → src/Magnum/DebugTools/Implementation/BoxRenderer.h

@ -24,11 +24,11 @@
DEALINGS IN THE SOFTWARE.
*/
#include "AbstractBoxRenderer.h"
#include <Corrade/compatibility.h>
#include "Shapes/Shapes.h"
#include "Magnum/Shapes/Shapes.h"
#include "corradeCompatibility.h"
#include "AbstractBoxRenderer.h"
namespace Magnum { namespace DebugTools { namespace Implementation {

22
src/DebugTools/Implementation/CapsuleRenderer.cpp → src/Magnum/DebugTools/Implementation/CapsuleRenderer.cpp

@ -24,17 +24,17 @@
#include "CapsuleRenderer.h"
#include "Mesh.h"
#include "MeshView.h"
#include "DebugTools/ResourceManager.h"
#include "DebugTools/ShapeRenderer.h"
#include "Primitives/Capsule.h"
#include "Shapes/Capsule.h"
#include "Shaders/Flat.h"
#include "Trade/MeshData2D.h"
#include "Trade/MeshData3D.h"
#include "DebugTools/Implementation/CapsuleRendererTransformation.h"
#include "Magnum/Mesh.h"
#include "Magnum/MeshView.h"
#include "Magnum/DebugTools/ResourceManager.h"
#include "Magnum/DebugTools/ShapeRenderer.h"
#include "Magnum/Primitives/Capsule.h"
#include "Magnum/Shapes/Capsule.h"
#include "Magnum/Shaders/Flat.h"
#include "Magnum/Trade/MeshData2D.h"
#include "Magnum/Trade/MeshData3D.h"
#include "CapsuleRendererTransformation.h"
namespace Magnum { namespace DebugTools { namespace Implementation {

6
src/DebugTools/Implementation/CapsuleRenderer.h → src/Magnum/DebugTools/Implementation/CapsuleRenderer.h

@ -24,11 +24,11 @@
DEALINGS IN THE SOFTWARE.
*/
#include "AbstractShapeRenderer.h"
#include <Corrade/compatibility.h>
#include "Shapes/Shapes.h"
#include "Magnum/Shapes/Shapes.h"
#include "corradeCompatibility.h"
#include "AbstractShapeRenderer.h"
namespace Magnum { namespace DebugTools { namespace Implementation {

10
src/DebugTools/Implementation/CapsuleRendererTransformation.h → src/Magnum/DebugTools/Implementation/CapsuleRendererTransformation.h

@ -26,11 +26,11 @@
#include <array>
#include "Math/Functions.h"
#include "Math/Matrix3.h"
#include "Math/Matrix4.h"
#include "Magnum.h"
#include "DimensionTraits.h"
#include "Magnum/DimensionTraits.h"
#include "Magnum/Magnum.h"
#include "Magnum/Math/Functions.h"
#include "Magnum/Math/Matrix3.h"
#include "Magnum/Math/Matrix4.h"
namespace Magnum { namespace DebugTools { namespace Implementation {

20
src/DebugTools/Implementation/CylinderRenderer.cpp → src/Magnum/DebugTools/Implementation/CylinderRenderer.cpp

@ -24,16 +24,16 @@
#include "CylinderRenderer.h"
#include "Mesh.h"
#include "DebugTools/ShapeRenderer.h"
#include "Shapes/Cylinder.h"
#include "Primitives/Cylinder.h"
#include "Primitives/Square.h"
#include "Shaders/Flat.h"
#include "Trade/MeshData2D.h"
#include "Trade/MeshData3D.h"
#include "DebugTools/Implementation/CylinderRendererTransformation.h"
#include "Magnum/Mesh.h"
#include "Magnum/DebugTools/ShapeRenderer.h"
#include "Magnum/Shapes/Cylinder.h"
#include "Magnum/Primitives/Cylinder.h"
#include "Magnum/Primitives/Square.h"
#include "Magnum/Shaders/Flat.h"
#include "Magnum/Trade/MeshData2D.h"
#include "Magnum/Trade/MeshData3D.h"
#include "CylinderRendererTransformation.h"
namespace Magnum { namespace DebugTools { namespace Implementation {

6
src/DebugTools/Implementation/CylinderRenderer.h → src/Magnum/DebugTools/Implementation/CylinderRenderer.h

@ -24,11 +24,11 @@
DEALINGS IN THE SOFTWARE.
*/
#include "AbstractShapeRenderer.h"
#include <Corrade/compatibility.h>
#include "Shapes/Shapes.h"
#include "Magnum/Shapes/Shapes.h"
#include "corradeCompatibility.h"
#include "AbstractShapeRenderer.h"
namespace Magnum { namespace DebugTools { namespace Implementation {

10
src/DebugTools/Implementation/CylinderRendererTransformation.h → src/Magnum/DebugTools/Implementation/CylinderRendererTransformation.h

@ -24,11 +24,11 @@
DEALINGS IN THE SOFTWARE.
*/
#include "Math/Functions.h"
#include "Math/Matrix3.h"
#include "Math/Matrix4.h"
#include "Magnum.h"
#include "DimensionTraits.h"
#include "Magnum/DimensionTraits.h"
#include "Magnum/Magnum.h"
#include "Magnum/Math/Functions.h"
#include "Magnum/Math/Matrix3.h"
#include "Magnum/Math/Matrix4.h"
namespace Magnum { namespace DebugTools { namespace Implementation {

10
src/DebugTools/Implementation/ForceRendererTransformation.h → src/Magnum/DebugTools/Implementation/ForceRendererTransformation.h

@ -24,11 +24,11 @@
DEALINGS IN THE SOFTWARE.
*/
#include "Math/Functions.h"
#include "Math/Matrix3.h"
#include "Math/Matrix4.h"
#include "Magnum.h"
#include "DimensionTraits.h"
#include "Magnum/DimensionTraits.h"
#include "Magnum/Magnum.h"
#include "Magnum/Math/Functions.h"
#include "Magnum/Math/Matrix3.h"
#include "Magnum/Math/Matrix4.h"
namespace Magnum { namespace DebugTools { namespace Implementation {

16
src/DebugTools/Implementation/LineSegmentRenderer.cpp → src/Magnum/DebugTools/Implementation/LineSegmentRenderer.cpp

@ -24,15 +24,15 @@
#include "LineSegmentRenderer.h"
#include "Mesh.h"
#include "DebugTools/ShapeRenderer.h"
#include "Shapes/LineSegment.h"
#include "Primitives/Line.h"
#include "Shaders/Flat.h"
#include "Trade/MeshData2D.h"
#include "Trade/MeshData3D.h"
#include "Magnum/Mesh.h"
#include "Magnum/DebugTools/ShapeRenderer.h"
#include "Magnum/Shapes/LineSegment.h"
#include "Magnum/Primitives/Line.h"
#include "Magnum/Shaders/Flat.h"
#include "Magnum/Trade/MeshData2D.h"
#include "Magnum/Trade/MeshData3D.h"
#include "DebugTools/Implementation/LineSegmentRendererTransformation.h"
#include "LineSegmentRendererTransformation.h"
namespace Magnum { namespace DebugTools { namespace Implementation {

6
src/DebugTools/Implementation/LineSegmentRenderer.h → src/Magnum/DebugTools/Implementation/LineSegmentRenderer.h

@ -24,11 +24,11 @@
DEALINGS IN THE SOFTWARE.
*/
#include "AbstractShapeRenderer.h"
#include <Corrade/compatibility.h>
#include "Shapes/Shapes.h"
#include "Magnum/Shapes/Shapes.h"
#include "corradeCompatibility.h"
#include "AbstractShapeRenderer.h"
namespace Magnum { namespace DebugTools { namespace Implementation {

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

Loading…
Cancel
Save