diff --git a/Doxyfile b/Doxyfile
index 02cbd995f..08f5bec3b 100644
--- a/Doxyfile
+++ b/Doxyfile
@@ -193,7 +193,14 @@ TAB_SIZE = 8
# will result in a user-defined paragraph with heading "Side Effects:".
# You can put \n's in the value part of an alias to insert newlines.
-ALIASES =
+ALIASES = \
+ "requires_gl30=@xrefitem RequiresGL30 \"Requires OpenGL 3.0\" \"Functionality requiring OpenGL 3.0\"" \
+ "requires_gl31=@xrefitem RequiresGL31 \"Requires OpenGL 3.1\" \"Functionality requiring OpenGL 3.1\"" \
+ "requires_gl32=@xrefitem RequiresGL32 \"Requires OpenGL 3.2\" \"Functionality requiring OpenGL 3.2\"" \
+ "requires_gl33=@xrefitem RequiresGL33 \"Requires OpenGL 3.3\" \"Functionality requiring OpenGL 3.3\"" \
+ "requires_gl40=@xrefitem RequiresGL40 \"Requires OpenGL 4.0\" \"Functionality requiring OpenGL 4.0\"" \
+ "requires_gl41=@xrefitem RequiresGL41 \"Requires OpenGL 4.1\" \"Functionality requiring OpenGL 4.1\"" \
+ "requires_gl42=@xrefitem RequiresGL42 \"Requires OpenGL 4.2\" \"Functionality requiring OpenGL 4.2\""
# This tag can be used to specify a number of word-keyword mappings (TCL only).
# A mapping has the form "name=value". For example adding
diff --git a/doc/MainPage.dox b/doc/MainPage.dox
index d4d77d924..0576241a3 100644
--- a/doc/MainPage.dox
+++ b/doc/MainPage.dox
@@ -16,6 +16,10 @@ Features:
Collection of pre-made @ref Primitives "graphic primitives" and
@ref Shaders "shaders" for testing purposes.
+The engine is meant to be run on OpenGL 3 capable hardware, but most of the
+functionality is working on OpenGL 2.1 hardware too. See also
+@ref RequiredExtensions.
+
@section BuildingLink Building Magnum
Guide @ref Building "how to build Magnum" on different platforms.
diff --git a/doc/RequiredExtensions.dox b/doc/RequiredExtensions.dox
new file mode 100644
index 000000000..b70a0394f
--- /dev/null
+++ b/doc/RequiredExtensions.dox
@@ -0,0 +1,28 @@
+/** @page RequiredExtensions Functionality requiring specific OpenGL version or extensions
+
+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. 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).
+
+- @subpage RequiresGL30
+- @subpage RequiresGL31
+- @subpage RequiresGL32
+- @subpage RequiresGL33
+- @subpage RequiresGL40
+- @subpage RequiresGL41
+- @subpage RequiresGL42
+
+@page RequiresGL30 Functionality requiring OpenGL 3.0
+@page RequiresGL31 Functionality requiring OpenGL 3.1
+@page RequiresGL32 Functionality requiring OpenGL 3.2
+@page RequiresGL33 Functionality requiring OpenGL 3.3
+@page RequiresGL40 Functionality requiring OpenGL 4.0
+@page RequiresGL41 Functionality requiring OpenGL 4.1
+@page RequiresGL42 Functionality requiring OpenGL 4.2
+
+*/
diff --git a/src/AbstractImage.h b/src/AbstractImage.h
index 24ee76f21..2d9c966ae 100644
--- a/src/AbstractImage.h
+++ b/src/AbstractImage.h
@@ -67,7 +67,11 @@ class MAGNUM_EXPORT AbstractImage {
/** Stencil index. For framebuffer reading only. */
StencilIndex = GL_STENCIL_INDEX,
- /** Depth and stencil component. For framebuffer reading only. */
+ /**
+ * Depth and stencil component. For framebuffer reading only.
+ *
+ * @requires_gl30 Extension EXT_packed_depth_stencil
+ */
DepthStencil = GL_DEPTH_STENCIL
};
@@ -80,7 +84,11 @@ class MAGNUM_EXPORT AbstractImage {
UnsignedInt = GL_UNSIGNED_INT, /**< Each component unsigned int */
Int = GL_INT, /**< Each component int */
- /** Each component half float (16bit). For framebuffer reading only. */
+ /**
+ * Each component half float (16bit). For framebuffer reading only.
+ *
+ * @requires_gl30 Extension NV_half_float / ARB_half_float_pixel
+ */
HalfFloat = GL_HALF_FLOAT,
Float = GL_FLOAT, /**< Each component float (32bit) */
@@ -160,6 +168,8 @@ class MAGNUM_EXPORT AbstractImage {
/**
* Three-component BGR, float, red and green 11bit, blue 10bit,
* 32bit total. For framebuffer reading only.
+ *
+ * @requires_gl30 Extension EXT_packed_float
*/
B10GR11Float = GL_UNSIGNED_INT_10F_11F_11F_REV,
@@ -167,18 +177,24 @@ class MAGNUM_EXPORT AbstractImage {
* Three-component BGR, unsigned integers with exponent, each
* component 9bit, exponent 5bit, 32bit total. For framebuffer
* reading only.
+ *
+ * @requires_gl30 Extension EXT_texture_shared_exponent
*/
Exponent5RGB9 = GL_UNSIGNED_INT_5_9_9_9_REV,
/**
* 24bit depth and 8bit stencil component, 32bit total. For
* framebuffer reading only.
+ *
+ * @requires_gl30 Extension EXT_packed_depth_stencil
*/
Depth24Stencil8 = GL_UNSIGNED_INT_24_8,
/**
* 32bit float depth component and 8bit stencil component, 64bit
* total. For framebuffer reading only.
+ *
+ * @requires_gl30 Extension ARB_depth_buffer_float
*/
Depth32FloatStencil8 = GL_FLOAT_32_UNSIGNED_INT_24_8_REV
};
diff --git a/src/AbstractShaderProgram.h b/src/AbstractShaderProgram.h
index 842722f92..8c9950a73 100644
--- a/src/AbstractShaderProgram.h
+++ b/src/AbstractShaderProgram.h
@@ -154,6 +154,8 @@ class MAGNUM_EXPORT AbstractShaderProgram {
*
* @note This function should be called between loadShader() calls
* and link().
+ *
+ * @requires_gl30 Extension EXT_gpu_shader4
*/
void bindFragmentDataLocation(GLuint location, const std::string& name);
@@ -184,7 +186,11 @@ class MAGNUM_EXPORT AbstractShaderProgram {
glUniform1i(location, value);
}
- /** @copydoc setUniform(GLint, GLint) */
+ /**
+ * @copydoc setUniform(GLint, GLint)
+ *
+ * @requires_gl30 Extension EXT_gpu_shader4
+ */
void setUniform(GLint location, GLuint value) {
glUniform1ui(location, value);
}
diff --git a/src/AbstractTexture.h b/src/AbstractTexture.h
index 0f64319bf..38cd8ebbc 100644
--- a/src/AbstractTexture.h
+++ b/src/AbstractTexture.h
@@ -116,14 +116,61 @@ class MAGNUM_EXPORT AbstractTexture {
/** @brief Type of data per each component */
enum class ComponentType {
- UnsignedByte, /**< Unsigned byte (char) */
- Byte, /**< Byte (char) */
- UnsignedShort, /**< Unsigned short */
- Short, /**< Short */
- UnsignedInt, /**< Unsigned integer */
- Int, /**< Integer */
- Half, /**< Half float (16 bit) */
- Float, /**< Float (32 bit) */
+ /**
+ * (Non-normalized) unsigned byte
+ *
+ * @requires_gl30 Extension EXT_texture_integer
+ */
+ UnsignedByte,
+
+ /**
+ * (Non-normalized) byte
+ *
+ * @requires_gl30 Extension EXT_texture_integer
+ */
+ Byte,
+
+ /**
+ * (Non-normalized) unsigned short
+ *
+ * @requires_gl30 Extension EXT_texture_integer
+ */
+ UnsignedShort,
+
+ /**
+ * (Non-normalized) short
+ *
+ * @requires_gl30 Extension EXT_texture_integer
+ */
+ Short,
+
+ /**
+ * (Non-normalized) unsigned integer
+ *
+ * @requires_gl30 Extension EXT_texture_integer
+ */
+ UnsignedInt,
+
+ /**
+ * (Non-normalized) integer
+ *
+ * @requires_gl30 Extension EXT_texture_integer
+ */
+ Int,
+
+ /**
+ * Half float (16 bit)
+ *
+ * @requires_gl30 Extension ARB_texture_float
+ */
+ Half,
+
+ /**
+ * Float (32 bit)
+ *
+ * @requires_gl30 Extension ARB_texture_float
+ */
+ Float,
/**
* Normalized unsigned byte, i.e. values from range
@@ -134,6 +181,8 @@ class MAGNUM_EXPORT AbstractTexture {
/**
* Normalized byte, i.e. values from range
* @f$ [-128; 127] @f$ are converted to range @f$ [0.0; 1.0] @f$.
+ *
+ * @requires_gl31 (no extension providing this functionality)
*/
NormalizedByte,
@@ -146,6 +195,8 @@ class MAGNUM_EXPORT AbstractTexture {
/**
* Normalized short, i.e. values from range
* @f$ [-32768; 32767] @f$ are converted to range @f$ [0.0; 1.0] @f$.
+ *
+ * @requires_gl31 (no extension providing this functionality)
*/
NormalizedShort
};
@@ -160,12 +211,16 @@ class MAGNUM_EXPORT AbstractTexture {
/**
* One-component (red channel), unsigned normalized, probably
* 8bit.
+ *
+ * @requires_gl30 (no extension providing this functionality)
*/
Red = GL_RED,
/**
* Two-component (red and green channel), unsigned normalized,
* each component probably 8bit, 16bit total.
+ *
+ * @requires_gl30 (no extension providing this functionality)
*/
RedGreen = GL_RG,
@@ -212,8 +267,10 @@ class MAGNUM_EXPORT AbstractTexture {
RGB10Alpha2 = GL_RGB10_A2,
/**
- * Four-component RGBA, unsigned integers, each RGB component
- * 10bit, alpha channel 2bit, 32bit total.
+ * Four-component RGBA, unsigned non-normalized, each RGB
+ * component 10bit, alpha channel 2bit, 32bit total.
+ *
+ * @requires_gl33 Extension ARB_texture_rgb10_a2ui
*/
RGB10Alpha2Unsigned = GL_RGB10_A2UI,
@@ -232,6 +289,8 @@ class MAGNUM_EXPORT AbstractTexture {
/**
* Three-component RGB, float, red and green 11bit, blue 10bit,
* 32bit total.
+ *
+ * @requires_gl30 Extension EXT_packed_float
*/
RG11B10Float = GL_R11F_G11F_B10F,
@@ -244,8 +303,10 @@ class MAGNUM_EXPORT AbstractTexture {
#endif
/**
- * Three-component RGB, unsigned integers with exponent, each
- * component 9bit, exponent 5bit, 32bit total.
+ * Three-component RGB, unsigned with exponent, each component
+ * 9bit, exponent 5bit, 32bit total.
+ *
+ * @requires_gl30 Extension EXT_texture_shared_exponent
*/
RGB9Exponent5 = GL_RGB9_E5,
@@ -261,29 +322,61 @@ class MAGNUM_EXPORT AbstractTexture {
/** Compressed RGBA, unsigned normalized. */
CompressedRGBA = GL_COMPRESSED_RGBA,
- /** RTGC compressed red channel, unsigned normalized. */
+ /**
+ * RTGC compressed red channel, unsigned normalized.
+ *
+ * @requires_gl30 Extension EXT_texture_compression_rgtc
+ */
CompressedRtgcRed = GL_COMPRESSED_RED_RGTC1,
- /** RTGC compressed red channel, signed normalized. */
+ /**
+ * RTGC compressed red channel, signed normalized.
+ *
+ * @requires_gl30 Extension EXT_texture_compression_rgtc
+ */
CompressedRtgcSignedRed = GL_COMPRESSED_SIGNED_RED_RGTC1,
- /** RTGC compressed red and green channel, unsigned normalized. */
+ /**
+ * RTGC compressed red and green channel, unsigned normalized.
+ *
+ * @requires_gl30 Extension EXT_texture_compression_rgtc
+ */
CompressedRtgcRedGreen = GL_COMPRESSED_RG_RGTC2,
- /** RTGC compressed red and green channel, signed normalized. */
+ /**
+ * RTGC compressed red and green channel, signed normalized.
+ *
+ * @requires_gl30 Extension EXT_texture_compression_rgtc
+ */
CompressedRtgcSignedRedGreen = GL_COMPRESSED_SIGNED_RG_RGTC2,
#if defined(GL_COMPRESSED_RGBA_BPTC_UNORM) || defined(DOXYGEN_GENERATING_OUTPUT)
- /** BTPC compressed RGBA, unsigned normalized. */
+ /**
+ * BTPC compressed RGBA, unsigned normalized.
+ *
+ * @requires_gl42 Extension ARB_texture_compression_btpc
+ */
CompressedBtpcRGBA = GL_COMPRESSED_RGBA_BPTC_UNORM,
- /** BTPC compressed sRGBA, unsigned normalized. */
+ /**
+ * BTPC compressed sRGBA, unsigned normalized.
+ *
+ * @requires_gl42 Extension ARB_texture_compression_btpc
+ */
CompressedBtpcSRGBA = GL_COMPRESSED_SRGB_ALPHA_BPTC_UNORM,
- /** BTPC compressed RGB, signed float. */
+ /**
+ * BTPC compressed RGB, signed float.
+ *
+ * @requires_gl42 Extension ARB_texture_compression_btpc
+ */
CompressedBtpcRGBSignedFloat = GL_COMPRESSED_RGB_BPTC_SIGNED_FLOAT,
- /** BTPC compressed RGB, unsigned float. */
+ /**
+ * BTPC compressed RGB, unsigned float.
+ *
+ * @requires_gl42 Extension ARB_texture_compression_btpc
+ */
CompressedBtpcRGBUnsignedFloat = GL_COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT,
#endif
@@ -299,13 +392,25 @@ class MAGNUM_EXPORT AbstractTexture {
/** 24bit depth component. */
Depth24 = GL_DEPTH_COMPONENT24,
- /** 32bit float depth component. */
+ /**
+ * 32bit float depth component.
+ *
+ * @requires_gl30 Extension ARB_depth_buffer_float
+ */
Depth32Float = GL_DEPTH_COMPONENT32F,
- /** 24bit depth and 8bit stencil component. */
+ /**
+ * 24bit depth and 8bit stencil component.
+ *
+ * @requires_gl30 Extension EXT_packed_depth_stencil
+ */
Depth24Stencil8 = GL_DEPTH24_STENCIL8,
- /** 32bit float depth component and 8bit stencil component. */
+ /**
+ * 32bit float depth component and 8bit stencil component.
+ *
+ * @requires_gl30 Extension ARB_depth_buffer_float
+ */
Depth32FloatStencil8 = GL_DEPTH32F_STENCIL8
};
@@ -420,13 +525,32 @@ class MAGNUM_EXPORT AbstractTexture {
* Each dimension has its own unique subset of these targets.
*/
enum class Target: GLenum {
- Texture1D = GL_TEXTURE_1D,
- Texture2D = GL_TEXTURE_2D,
- Texture3D = GL_TEXTURE_3D,
+ Texture1D = GL_TEXTURE_1D, /**< One-dimensional texture */
+ Texture2D = GL_TEXTURE_2D, /**< Two-dimensional texture */
+ Texture3D = GL_TEXTURE_3D, /**< Three-dimensional texture */
+
+ /**
+ * Array of one-dimensional textures
+ *
+ * @requires_gl30 Extension EXT_texture_array
+ */
Array1D = GL_TEXTURE_1D_ARRAY,
+
+ /**
+ * Array of two-dimensional textures
+ *
+ * @requires_gl30 Extension EXT_texture_array
+ */
Array2D = GL_TEXTURE_2D_ARRAY,
+
+ /**
+ * Rectangle texture
+ *
+ * @requires_gl31 Extension ARB_texture_rectangle
+ */
Rectangle = GL_TEXTURE_RECTANGLE,
- CubeMap = GL_TEXTURE_CUBE_MAP,
+
+ CubeMap = GL_TEXTURE_CUBE_MAP /**< Cube map texture */
};
/**
diff --git a/src/Buffer.h b/src/Buffer.h
index f39968a79..61aa3a168 100644
--- a/src/Buffer.h
+++ b/src/Buffer.h
@@ -38,10 +38,18 @@ class Buffer {
/** Used for storing vertex attributes. */
Array = GL_ARRAY_BUFFER,
- /** Source for copies. */
+ /**
+ * Source for copies.
+ *
+ * @requires_gl31 Extension ARB_copy_buffer
+ */
CopyRead = GL_COPY_READ_BUFFER,
- /** Target for copies. */
+ /**
+ * Target for copies.
+ *
+ * @requires_gl31 Extension ARB_copy_buffer
+ */
CopyWrite = GL_COPY_WRITE_BUFFER,
/** Used for storing vertex indices. */
@@ -53,13 +61,26 @@ class Buffer {
/** Target for pixel pack operations. */
PixelPack = GL_PIXEL_PACK_BUFFER,
- /** Source for texel fetches. */
+ /**
+ * Source for texel fetches.
+ *
+ * @see BufferedTexture
+ * @requires_gl31 Extension ARB_texture_buffer_object
+ */
Texture = GL_TEXTURE_BUFFER,
- /** Target for transform feedback. */
+ /**
+ * Target for transform feedback.
+ *
+ * @requires_gl30 Extension EXT_transform_feedback
+ */
TransformFeedback = GL_TRANSFORM_FEEDBACK_BUFFER,
- /** Used for storing uniforms. */
+ /**
+ * Used for storing uniforms.
+ *
+ * @requires_gl31 Extension ARB_uniform_buffer_object
+ */
Uniform = GL_UNIFORM_BUFFER
};
diff --git a/src/BufferedTexture.h b/src/BufferedTexture.h
index 791719d28..b53ce7c82 100644
--- a/src/BufferedTexture.h
+++ b/src/BufferedTexture.h
@@ -35,6 +35,8 @@ using data setting functions in Buffer itself.
When using buffered texture in the shader, use `samplerBuffer` and fetch the
data using integer coordinates in `texelFetch()`.
+
+@requires_gl31 Extension ARB_texture_buffer_object
*/
class BufferedTexture {
BufferedTexture(const BufferedTexture& other) = delete;
diff --git a/src/CubeMapTexture.h b/src/CubeMapTexture.h
index 12edaa6d9..85b2c556d 100644
--- a/src/CubeMapTexture.h
+++ b/src/CubeMapTexture.h
@@ -59,6 +59,8 @@ class CubeMapTexture: public Texture2D {
/**
* @brief Enable/disable seamless cube map textures
+ *
+ * @requires_gl32 Extension ARB_seamless_cube_map
*/
inline static void setSeamless(bool enabled) {
enabled ? glEnable(GL_TEXTURE_CUBE_MAP_SEAMLESS) : glDisable(GL_TEXTURE_CUBE_MAP_SEAMLESS);
diff --git a/src/Framebuffer.h b/src/Framebuffer.h
index e80ca9cc6..1e7ec9a97 100644
--- a/src/Framebuffer.h
+++ b/src/Framebuffer.h
@@ -28,6 +28,8 @@ namespace Magnum {
/**
@brief %Framebuffer
+
+@requires_gl30 Extension EXT_framebuffer_object
*/
class MAGNUM_EXPORT Framebuffer {
Framebuffer(const Framebuffer& other) = delete;
@@ -38,8 +40,19 @@ class MAGNUM_EXPORT Framebuffer {
public:
/** @brief %Framebuffer target */
enum class Target: GLenum {
- Read = GL_READ_FRAMEBUFFER, /**< For reading only. */
- Draw = GL_DRAW_FRAMEBUFFER, /**< For drawing only. */
+ /**
+ * For reading only.
+ *
+ * @requires_gl30 Extension EXT_framebuffer_blit
+ */
+ Read = GL_READ_FRAMEBUFFER,
+
+ /**
+ * For drawing only.
+ *
+ * @requires_gl30 Extension EXT_framebuffer_blit
+ */
+ Draw = GL_DRAW_FRAMEBUFFER,
ReadDraw = GL_FRAMEBUFFER /**< For both reading and drawing. */
};
@@ -146,6 +159,8 @@ class MAGNUM_EXPORT Framebuffer {
* mapDefaultForDraw() for binding particular framebuffer for reading
* and drawing. If multiple attachments are specified in mapForDraw()
* / mapDefaultForDraw(), the data are written to each of them.
+ *
+ * @requires_gl30 Extension EXT_framebuffer_blit
*/
inline static void blit(const Math::Vector2& bottomLeft, const Math::Vector2& topRight, const Math::Vector2& destinationBottomLeft, const Math::Vector2& destinationTopRight, BlitMask blitMask, AbstractTexture::Filter filter) {
glBlitFramebuffer(bottomLeft.x(), bottomLeft.y(), topRight.x(), topRight.y(), destinationBottomLeft.x(), destinationBottomLeft.y(), destinationTopRight.x(), destinationTopRight.y(), static_cast(blitMask), static_cast(filter));
@@ -164,6 +179,8 @@ class MAGNUM_EXPORT Framebuffer {
* no interpolation is needed and thus
* AbstractTexture::Filter::NearestNeighbor filtering is used by
* default.
+ *
+ * @requires_gl30 Extension EXT_framebuffer_blit
*/
inline static void blit(const Math::Vector2& bottomLeft, const Math::Vector2& topRight, BlitMask blitMask) {
glBlitFramebuffer(bottomLeft.x(), bottomLeft.y(), topRight.x(), topRight.y(), bottomLeft.x(), bottomLeft.y(), topRight.x(), topRight.y(), static_cast(blitMask), static_cast(AbstractTexture::Filter::NearestNeighbor));
@@ -266,6 +283,8 @@ class MAGNUM_EXPORT Framebuffer {
* @param depthStencilAttachment Depth/stencil attachment
* @param texture 1D texture
* @param mipLevel Mip level
+ *
+ * @requires_gl30 Extension EXT_framebuffer_object
*/
inline void attachTexture1D(Target target, DepthStencilAttachment depthStencilAttachment, Texture1D* texture, GLint mipLevel) {
/** @todo Check for internal format compatibility */
@@ -280,6 +299,8 @@ class MAGNUM_EXPORT Framebuffer {
* @param colorAttachment Color attachment ID (number between 0 and 15)
* @param texture 1D texture
* @param mipLevel Mip level
+ *
+ * @requires_gl30 Extension EXT_framebuffer_object
*/
inline void attachTexture1D(Target target, unsigned int colorAttachment, Texture1D* texture, GLint mipLevel) {
/** @todo Check for internal format compatibility */
@@ -297,6 +318,7 @@ class MAGNUM_EXPORT Framebuffer {
* should be always 0.
*
* @see attachCubeMapTexture()
+ * @requires_gl30 Extension EXT_framebuffer_object
*/
inline void attachTexture2D(Target target, DepthStencilAttachment depthStencilAttachment, Texture2D* texture, GLint mipLevel) {
/** @todo Check for internal format compatibility */
@@ -314,6 +336,7 @@ class MAGNUM_EXPORT Framebuffer {
* should be always 0.
*
* @see attachCubeMapTexture()
+ * @requires_gl30 Extension EXT_framebuffer_object
*/
inline void attachTexture2D(Target target, unsigned int colorAttachment, Texture2D* texture, GLint mipLevel) {
/** @todo Check for internal format compatibility */
@@ -331,6 +354,7 @@ class MAGNUM_EXPORT Framebuffer {
* @param mipLevel Mip level
*
* @see attachTexture2D()
+ * @requires_gl30 Extension EXT_framebuffer_object
*/
inline void attachCubeMapTexture(Target target, DepthStencilAttachment depthStencilAttachment, CubeMapTexture* texture, CubeMapTexture::Coordinate coordinate, GLint mipLevel) {
/** @todo Check for internal format compatibility */
@@ -347,6 +371,7 @@ class MAGNUM_EXPORT Framebuffer {
* @param mipLevel Mip level
*
* @see attachTexture2D()
+ * @requires_gl30 Extension EXT_framebuffer_object
*/
inline void attachCubeMapTexture(Target target, unsigned int colorAttachment, CubeMapTexture* texture, CubeMapTexture::Coordinate coordinate, GLint mipLevel) {
/** @todo Check for internal format compatibility */
@@ -361,6 +386,8 @@ class MAGNUM_EXPORT Framebuffer {
* @param texture 3D texture
* @param mipLevel Mip level
* @param layer Layer of 2D image within a 3D texture
+ *
+ * @requires_gl30 Extension EXT_framebuffer_object
*/
inline void attachTexture3D(Target target, DepthStencilAttachment depthStencilAttachment, Texture3D* texture, GLint mipLevel, GLint layer) {
/** @todo Check for internal format compatibility */
@@ -376,6 +403,8 @@ class MAGNUM_EXPORT Framebuffer {
* @param texture 3D texture
* @param mipLevel Mip level
* @param layer Layer of 2D image within a 3D texture.
+ *
+ * @requires_gl30 Extension EXT_framebuffer_object
*/
inline void attachTexture3D(Target target, unsigned int colorAttachment, Texture3D* texture, GLint mipLevel, GLint layer) {
/** @todo Check for internal format compatibility */
diff --git a/src/Mesh.h b/src/Mesh.h
index cfcd475b0..b9b9b94fa 100644
--- a/src/Mesh.h
+++ b/src/Mesh.h
@@ -31,10 +31,13 @@ namespace Magnum {
class Buffer;
/**
- * @brief Base class for managing non-indexed meshes
- *
- * @todo Support for normalized values (e.g. for color as char[4] passed to
- * shader as floating-point vec4)
+@brief Base class for managing non-indexed meshes
+
+@todo Support for normalized values (e.g. for color as char[4] passed to
+ shader as floating-point vec4)
+
+@requires_gl30 Extension APPLE_vertex_array_object
+@requires_gl30 Extension EXT_gpu_shader4 (for unsigned integer attributes)
*/
class MAGNUM_EXPORT Mesh {
Mesh(const Mesh& other) = delete;
diff --git a/src/Query.h b/src/Query.h
index 7635a56e4..3a34e4ec3 100644
--- a/src/Query.h
+++ b/src/Query.h
@@ -56,6 +56,8 @@ class MAGNUM_EXPORT AbstractQuery {
*
* Note that this function is blocking until the result is available.
* See resultAvailable().
+ *
+ * @requires_gl33 Extension ARB_timer_query (64bit integers)
*/
template T result() = delete;
@@ -105,7 +107,11 @@ class MAGNUM_EXPORT Query: public AbstractQuery {
/** Count of primitives written to transform feedback buffer. */
TransformFeedbackPrimitivesWritten = GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN,
- /** Elapsed time */
+ /**
+ * Elapsed time
+ *
+ * @requires_gl33 Extension ARB_timer_query
+ */
TimeElapsed = GL_TIME_ELAPSED
};
@@ -173,7 +179,11 @@ class MAGNUM_EXPORT SampleQuery: public AbstractQuery {
/** Count of samples passed from fragment shader */
SamplesPassed = GL_SAMPLES_PASSED,
- /** Whether any samples passed from fragment shader */
+ /**
+ * Whether any samples passed from fragment shader
+ *
+ * @requires_gl33 Extension ARB_occlusion_query2
+ */
AnySamplesPassed = GL_ANY_SAMPLES_PASSED
};
@@ -258,6 +268,8 @@ GLuint timeElapsed1 = tmp-q1.result();
GLuint timeElapsed2 = q3.result()-tmp;
@endcode
Using this query results in fewer OpenGL calls when doing more measures.
+
+@requires_gl33 Extension ARB_timer_query
*/
class TimeQuery: public AbstractQuery {
public:
diff --git a/src/Renderbuffer.h b/src/Renderbuffer.h
index 7e5fd721b..e39934c07 100644
--- a/src/Renderbuffer.h
+++ b/src/Renderbuffer.h
@@ -27,6 +27,8 @@ namespace Magnum {
@brief %Renderbuffer
Attachable to Framebuffer as render target.
+
+@requires_gl30 Extension EXT_framebuffer_object
*/
class Renderbuffer {
Renderbuffer(const Renderbuffer& other) = delete;
diff --git a/src/Shader.h b/src/Shader.h
index c80fe72c0..d638bcb8f 100644
--- a/src/Shader.h
+++ b/src/Shader.h
@@ -42,9 +42,16 @@ class MAGNUM_EXPORT Shader {
public:
/** @brief %Shader type */
enum Type {
- Vertex = GL_VERTEX_SHADER, /**< @brief Vertex shader */
- Geometry = GL_GEOMETRY_SHADER, /**< @brief Geometry shader */
- Fragment = GL_FRAGMENT_SHADER /**< @brief Fragment shader */
+ Vertex = GL_VERTEX_SHADER, /**< Vertex shader */
+
+ /**
+ * Geometry shader
+ *
+ * @requires_gl32 Extension ARB_geometry_shader4
+ */
+ Geometry = GL_GEOMETRY_SHADER,
+
+ Fragment = GL_FRAGMENT_SHADER /**< Fragment shader */
};
/** @brief %Shader state */
diff --git a/src/Shaders/PhongShader.h b/src/Shaders/PhongShader.h
index 7c3f5331e..3388d9e88 100644
--- a/src/Shaders/PhongShader.h
+++ b/src/Shaders/PhongShader.h
@@ -23,7 +23,12 @@
namespace Magnum { namespace Shaders {
-/** @brief Phong shader */
+/**
+@brief Phong shader
+
+@requires_gl33 The shader is written in GLSL 3.3, although it should be trivial
+ to port it to older versions.
+*/
class PhongShader: public AbstractShaderProgram {
public:
typedef Attribute<0, Vector4> Vertex; /**< @brief Vertex position */
diff --git a/src/Texture.h b/src/Texture.h
index b65d7f9fe..bf3c1582f 100644
--- a/src/Texture.h
+++ b/src/Texture.h
@@ -47,6 +47,8 @@ between 0 and `textureSizeInGivenDirection-1`. Note that rectangle textures
don't support mipmapping and repeating wrapping modes, see @ref Texture::Filter
"Filter", @ref Texture::Mipmap "Mipmap" and generateMipmap() documentation
for more information.
+
+@requires_gl31 Extension ARB_texture_rectangle (rectangle textures)
*/
template class Texture: public AbstractTexture {
public: