Browse Source

doc: texture documentation updates.

Remove duplicates, add minimal multisample docs, update GL function
mapping table.
pull/51/head
Vladimír Vondruš 12 years ago
parent
commit
d45857feb0
  1. 20
      doc/opengl-mapping.dox
  2. 7
      src/Magnum/AbstractTexture.h
  3. 7
      src/Magnum/BufferTexture.h
  4. 3
      src/Magnum/CubeMapTexture.h
  5. 46
      src/Magnum/CubeMapTextureArray.h
  6. 19
      src/Magnum/MultisampleTexture.h
  7. 48
      src/Magnum/RectangleTexture.h
  8. 41
      src/Magnum/Texture.h
  9. 7
      src/Magnum/TextureArray.h

20
doc/opengl-mapping.dox

@ -178,8 +178,8 @@ OpenGL function | Matching API
@fn_gl{GetSubroutineIndex} | | @fn_gl{GetSubroutineIndex} | |
@fn_gl{GetSubroutineUniformLocation} | | @fn_gl{GetSubroutineUniformLocation} | |
@fn_gl{GetSync} | | @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{GetTexImage}, \n @fn_gl_extension{GetTextureImage,EXT,direct_state_access}, \n @fn_gl_extension{GetnTexImage,ARB,robustness} | @ref Texture::image(), \n @ref TextureArray::image(), \n @ref CubeMapTexture::image(), \n @ref CubeMapTextureArray::image(), \n @ref RectangleTexture::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{GetTexLevelParameter}, \n @fn_gl_extension{GetTextureLevelParameter,EXT,direct_state_access} | @ref Texture::imageSize(), \n @ref TextureArray::imageSize(), \n @ref CubeMapTexture::imageSize(), \n @ref CubeMapTextureArray::imageSize(), \n @ref RectangleTexture::imageSize()
@fn_gl{GetTexParameter} | | @fn_gl{GetTexParameter} | |
@fn_gl{GetTransformFeedbackVarying} | | @fn_gl{GetTransformFeedbackVarying} | |
@fn_gl{GetUniform} | not queryable, @ref AbstractShaderProgram::setUniform() setter only @fn_gl{GetUniform} | not queryable, @ref AbstractShaderProgram::setUniform() setter only
@ -192,8 +192,8 @@ OpenGL function | Matching API
@fn_gl{InvalidateBufferSubData} | @ref Buffer::invalidateSubData() @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{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{InvalidateSubFramebuffer}, \n @fn_gles_extension{DiscardSubFramebuffer,EXT,discard_framebuffer} | @ref DefaultFramebuffer::invalidate(), \n @ref Framebuffer::invalidate()
@fn_gl{InvalidateTexImage} | @ref Texture::invalidateImage(), \n @ref TextureArray::invalidateImage(), \n @ref CubeMapTexture::invalidateImage(), \n @ref CubeMapTextureArray::invalidateImage(), \n @ref MultisampleTexture::invalidateImage(), \n @ref RectangleTexture::invalidateImage() @fn_gl{InvalidateTexImage} | @ref Texture::invalidateImage(), \n @ref TextureArray::invalidateImage(), \n @ref CubeMapTexture::invalidateImage(), \n @ref CubeMapTextureArray::invalidateImage(), \n @ref RectangleTexture::invalidateImage(), \n @ref MultisampleTexture::invalidateImage()
@fn_gl{InvalidateTexSubImage} | @ref Texture::invalidateSubImage(), \n @ref TextureArray::invalidateSubImage(), \n @ref CubeMapTexture::invalidateSubImage(), \n @ref CubeMapTextureArray::invalidateSubImage(), \n @ref MultisampleTexture::invalidateSubImage(), \n @ref RectangleTexture::invalidateSubImage() @fn_gl{InvalidateTexSubImage} | @ref Texture::invalidateSubImage(), \n @ref TextureArray::invalidateSubImage(), \n @ref CubeMapTexture::invalidateSubImage(), \n @ref CubeMapTextureArray::invalidateSubImage(), \n @ref RectangleTexture::invalidateSubImage(), \n @ref MultisampleTexture::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{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{IsEnabled} | not queryable, @ref Renderer::setFeature() setter only
@fn_gl{LineWidth} | @ref Renderer::setLineWidth() @fn_gl{LineWidth} | @ref Renderer::setLineWidth()
@ -236,12 +236,12 @@ OpenGL function | Matching API
@fn_gl{StencilMask}, \n @fn_gl{StencilMaskSeparate} | @ref Renderer::setStencilMask() @fn_gl{StencilMask}, \n @fn_gl{StencilMaskSeparate} | @ref Renderer::setStencilMask()
@fn_gl{StencilOp}, \n @fn_gl{StencilOpSeparate} | @ref Renderer::setStencilOperation() @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{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{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 TextureArray::setImage(), \n @ref CubeMapTexture::setImage(), \n @ref CubeMapTextureArray::setImage(), \n @ref RectangleTexture::setImage()
@fn_gl{TexImage2DMultisample}, \n @fn_gl{TexImage3DMultisample} | | @fn_gl{TexImage2DMultisample}, \n @fn_gl{TexImage3DMultisample} | @ref MultisampleTexture::setStorage()
@fn_gl{TexParameter}, \n @fn_gl_extension{TextureParameter,EXT,direct_state_access} | @ref Texture::setMinificationFilter(), \n @ref TextureArray::setMinificationFilter(), \n @ref CubeMapTexture::setMinificationFilter(), \n @ref CubeMapTextureArray::setMinificationFilter(), \n @ref RectangleTexture::setMinificationFilter(), \n @ref Texture::setMagnificationFilter(), \n @ref TextureArray::setMagnificationFilter(), \n @ref CubeMapTexture::setMagnificationFilter(), \n @ref CubeMapTextureArray::setMagnificationFilter(), \n @ref RectangleTexture::setMagnificationFilter(), \n @ref Texture::setBorderColor(), \n @ref TextureArray::setBorderColor(), \n @ref CubeMapTexture::setBorderColor(), \n @ref CubeMapTextureArray::setBorderColor(), \n @ref RectangleTexture::setBorderColor(), \n @ref Texture::setMaxAnisotropy(), \n @ref TextureArray::setMaxAnisotropy(), \n @ref CubeMapTexture::setMaxAnisotropy(), \n @ref CubeMapTextureArray::setMaxAnisotropy(), \n @ref RectangleTexture::setMaxAnisotropy(), \n @ref Texture::setWrapping(), \n @ref TextureArray::setWrapping(), \n @ref CubeMapTexture::setWrapping(), \n @ref CubeMapTextureArray::setWrapping(), \n @ref RectangleTexture::setWrapping() @fn_gl{TexParameter}, \n @fn_gl_extension{TextureParameter,EXT,direct_state_access} | @ref Texture::setBaseLevel() "*Texture::setBaseLevel()", \n @ref Texture::setMaxLevel() "*Texture::setMaxLevel()", \n @ref Texture::setMinificationFilter() "*Texture::setMinificationFilter()", \n @ref Texture::setMagnificationFilter() "*Texture::setMagnificationFilter()", \n @ref Texture::setWrapping() "*Texture::setWrapping()", \n @ref Texture::setBorderColor() "*Texture::setBorderColor()", \n @ref Texture::setMaxAnisotropy() "*Texture::setMaxAnisotropy()"
@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{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 TextureArray::setStorage(), \n @ref CubeMapTexture::setStorage(), \n @ref CubeMapTextureArray::setStorage(), \n @ref RectangleTexture::setStorage()
@fn_gl{TexStorage2DMultisample}, \n @fn_gl{TexStorage3DMultisample} | | @fn_gl{TexStorage2DMultisample}, \n @fn_gl_extension{TextureStorage2DMultisample,EXT,direct_state_access}, \n @fn_gl{TexStorage3DMultisample}, \n @fn_gl_extension{TextureStorage3DMultisample,EXT,direct_state_access} | @ref MultisampleTexture::setStorage()
@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{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 TextureArray::setSubImage(), \n @ref CubeMapTexture::setSubImage(), \n @ref CubeMapTextureArray::setSubImage(), \n @ref RectangleTexture::setSubImage()
@fn_gl{TextureView} | | @fn_gl{TextureView} | |
@fn_gl{TransformFeedbackVaryings} | | @fn_gl{TransformFeedbackVaryings} | |
@fn_gl{Uniform}, \n @fn_gl{ProgramUniform}, \n @fn_gl_extension{ProgramUniform,EXT,direct_state_access} | @ref AbstractShaderProgram::setUniform() @fn_gl{Uniform}, \n @fn_gl{ProgramUniform}, \n @fn_gl_extension{ProgramUniform,EXT,direct_state_access} | @ref AbstractShaderProgram::setUniform()

7
src/Magnum/AbstractTexture.h

@ -39,9 +39,10 @@ namespace Implementation { struct TextureState; }
/** /**
@brief Base for textures @brief Base for textures
Encapsulates one OpenGL texture object. See @ref Texture, @ref CubeMapTexture Encapsulates one OpenGL texture object. See @ref Texture, @ref TextureArray,
and @ref CubeMapTextureArray documentation for more information and usage @ref CubeMapTexture, @ref CubeMapTextureArray, @ref RectangleTexture,
examples. @ref BufferTexture and @ref MultisampleTexture documentation for more
information and usage examples.
@section AbstractTexture-webgl-restrictions WebGL restrictions @section AbstractTexture-webgl-restrictions WebGL restrictions

7
src/Magnum/BufferTexture.h

@ -154,9 +154,8 @@ enum class BufferTextureFormat: GLenum {
/** /**
@brief %Buffer texture @brief %Buffer texture
This texture is, unlike classic textures such as @ref Texture or This texture is, unlike classic textures such as @ref Texture used as simple
@ref CubeMapTexture, used as simple data source, without any unnecessary data source, without any unnecessary interpolation and wrapping methods.
interpolation and wrapping methods.
@section BufferTexture-usage Usage @section BufferTexture-usage Usage
@ -195,7 +194,7 @@ functions use DSA to avoid unnecessary calls to @fn_gl{ActiveTexture} and
and respective function documentation for more information. and respective function documentation for more information.
@see @ref Texture, @ref TextureArray, @ref CubeMapTexture, @see @ref Texture, @ref TextureArray, @ref CubeMapTexture,
@ref CubeMapTextureArray, @ref MultisampleTexture, @ref RectangleTexture @ref CubeMapTextureArray, @ref RectangleTexture, @ref MultisampleTexture
@requires_gl31 %Extension @extension{ARB,texture_buffer_object} @requires_gl31 %Extension @extension{ARB,texture_buffer_object}
@requires_gl Texture buffers are not available in OpenGL ES. @requires_gl Texture buffers are not available in OpenGL ES.
*/ */

3
src/Magnum/CubeMapTexture.h

@ -76,7 +76,8 @@ which intersects one of the six sides of the cube map. See
@ref AbstractShaderProgram for more information about usage in shaders. @ref AbstractShaderProgram for more information about usage in shaders.
@see @ref Renderer::Feature::SeamlessCubeMapTexture, @ref CubeMapTextureArray, @see @ref Renderer::Feature::SeamlessCubeMapTexture, @ref CubeMapTextureArray,
@ref Texture, @ref BufferTexture @ref Texture, @ref TextureArray, @ref RectangleTexture, @ref BufferTexture,
@ref MultisampleTexture
*/ */
class CubeMapTexture: public AbstractTexture { class CubeMapTexture: public AbstractTexture {
public: public:

46
src/Magnum/CubeMapTextureArray.h

@ -45,6 +45,8 @@ See @ref CubeMapTexture documentation for introduction.
@section CubeMapTextureArray-usage Usage @section CubeMapTextureArray-usage Usage
See @ref Texture documentation for introduction.
Common usage is to specify each layer and face separately using @ref setSubImage(). Common usage is to specify each layer and face separately using @ref setSubImage().
You have to allocate the memory for all layers and faces first by calling You have to allocate the memory for all layers and faces first by calling
@ref setStorage(). Example: array with 4 layers of cube maps, each cube map @ref setStorage(). Example: array with 4 layers of cube maps, each cube map
@ -75,7 +77,8 @@ the six sides of the cube map, fourth part is layer in the array. See
@ref AbstractShaderProgram for more information about usage in shaders. @ref AbstractShaderProgram for more information about usage in shaders.
@see @ref Renderer::Feature::SeamlessCubeMapTexture, @ref CubeMapTexture, @see @ref Renderer::Feature::SeamlessCubeMapTexture, @ref CubeMapTexture,
@ref Texture, @ref BufferTexture @ref Texture, @ref TextureArray, @ref RectangleTexture, @ref BufferTexture,
@ref MultisampleTexture
@requires_gl40 %Extension @extension{ARB,texture_cube_map_array} @requires_gl40 %Extension @extension{ARB,texture_cube_map_array}
@requires_gl Cube map texture arrays are not available in OpenGL ES. @requires_gl Cube map texture arrays are not available in OpenGL ES.
*/ */
@ -93,13 +96,7 @@ class CubeMapTextureArray: public AbstractTexture {
* @brief Set base mip level * @brief Set base mip level
* @return Reference to self (for method chaining) * @return Reference to self (for method chaining)
* *
* Taken into account when generating mipmap using @ref generateMipmap() * See @ref Texture::setBaseLevel() for more information.
* and when considering texture completeness when using mipmap
* filtering. Initial value is `0`.
* @see @ref setMaxLevel(), @ref setMinificationFilter(),
* @fn_gl{ActiveTexture}, @fn_gl{BindTexture} and @fn_gl{TexParameter}
* or @fn_gl_extension{TextureParameter,EXT,direct_state_access}
* with @def_gl{TEXTURE_BASE_LEVEL}
*/ */
CubeMapTextureArray& setBaseLevel(Int level) { CubeMapTextureArray& setBaseLevel(Int level) {
AbstractTexture::setBaseLevel(level); AbstractTexture::setBaseLevel(level);
@ -110,14 +107,7 @@ class CubeMapTextureArray: public AbstractTexture {
* @brief Set max mip level * @brief Set max mip level
* @return Reference to self (for method chaining) * @return Reference to self (for method chaining)
* *
* Taken into account when generating mipmap using @ref generateMipmap() * See @ref Texture::setMaxLevel() for more information.
* and when considering texture completeness when using mipmap
* filtering. Initial value is `1000`, which is clamped to count of
* levels specified when using @ref setStorage().
* @see @ref setBaseLevel(), @ref setMinificationFilter(),
* @fn_gl{ActiveTexture}, @fn_gl{BindTexture} and @fn_gl{TexParameter}
* or @fn_gl_extension{TextureParameter,EXT,direct_state_access}
* with @def_gl{TEXTURE_MAX_LEVEL}
*/ */
CubeMapTextureArray& setMaxLevel(Int level) { CubeMapTextureArray& setMaxLevel(Int level) {
AbstractTexture::setMaxLevel(level); AbstractTexture::setMaxLevel(level);
@ -142,19 +132,37 @@ class CubeMapTextureArray: public AbstractTexture {
return *this; return *this;
} }
/** @copydoc RectangleTexture::setBorderColor(const Color4&) */ /**
* @brief Set border color
* @return Reference to self (for method chaining)
*
* See @ref Texture::setBorderColor(const Color4&) for more
* information.
*/
CubeMapTextureArray& setBorderColor(const Color4& color) { CubeMapTextureArray& setBorderColor(const Color4& color) {
AbstractTexture::setBorderColor(color); AbstractTexture::setBorderColor(color);
return *this; return *this;
} }
/** @copydoc RectangleTexture::setBorderColor(const Vector4ui&) */ /**
* @brief Set border color for integer texture
* @return Reference to self (for method chaining)
*
* See @ref Texture::setBorderColor(const Vector4ui&) for more
* information.
*/
CubeMapTextureArray& setBorderColor(const Vector4ui& color) { CubeMapTextureArray& setBorderColor(const Vector4ui& color) {
AbstractTexture::setBorderColor(color); AbstractTexture::setBorderColor(color);
return *this; return *this;
} }
/** @copydoc RectangleTexture::setBorderColor(const Vector4i&) */ /**
* @brief Set border color for integer texture
* @return Reference to self (for method chaining)
*
* See @ref Texture::setBorderColor(const Vector4i&) for more
* information.
*/
CubeMapTextureArray& setBorderColor(const Vector4i& color) { CubeMapTextureArray& setBorderColor(const Vector4i& color) {
AbstractTexture::setBorderColor(color); AbstractTexture::setBorderColor(color);
return *this; return *this;

19
src/Magnum/MultisampleTexture.h

@ -57,22 +57,29 @@ enum class MultisampleTextureSampleLocations: GLboolean {
/** /**
@brief Mulitsample texture @brief Mulitsample texture
Template class for 2D mulitsample texture and 2D multisample texture array. See Template class for 2D mulitsample texture and 2D multisample texture array.
Used only from shaders for manual multisample resolve and other operations. See
also @ref AbstractTexture documentation for more information. also @ref AbstractTexture documentation for more information.
@todoc Finish when fully implemented @section Texture-usage Usage
As multisample textures have no sampler state, the only thing you need is to
set storage:
@code
MultisampleTexture2D texture;
texture.setStorage(16, TextureFormat::RGBA8, {1024, 1024});
@endcode
In shader, the texture is used via `sampler2DMS`/`sampler2DMSArray`, In shader, the texture is used via `sampler2DMS`/`sampler2DMSArray`,
`isampler2DMS`/`isampler2DMSArray` or `usampler2DMS`/`usampler2DMSArray`. See `isampler2DMS`/`isampler2DMSArray` or `usampler2DMS`/`usampler2DMSArray`. See
@ref AbstractShaderProgram documentation for more information about usage in @ref AbstractShaderProgram documentation for more information about usage in
shaders. shaders.
@see @ref MultisampleTexture2D, @ref MultisampleTexture2DArray, @ref Texture,
@ref TextureArray, @ref CubeMapTexture, @ref CubeMapTextureArray,
@ref RectangleTexture, @ref BufferTexture
@requires_gl32 %Extension @extension{ARB,texture_multisample} @requires_gl32 %Extension @extension{ARB,texture_multisample}
@requires_gl Multisample textures are not available in OpenGL ES. @requires_gl Multisample textures are not available in OpenGL ES.
@see @ref MultisampleTexture2D, @ref MultisampleTexture2DArray, @ref Texture,
@ref TextureArray, @ref BufferTexture, @ref CubeMapTexture,
@ref CubeMapTextureArray, @ref RectangleTexture
*/ */
template<UnsignedInt dimensions> class MultisampleTexture: public AbstractTexture { template<UnsignedInt dimensions> class MultisampleTexture: public AbstractTexture {
public: public:

48
src/Magnum/RectangleTexture.h

@ -63,11 +63,10 @@ In shader, the texture is used via sampler2DRect`, `sampler2DRectShadow`,
`isampler2DRect` or `usampler2DRect`. See @ref AbstractShaderProgram `isampler2DRect` or `usampler2DRect`. See @ref AbstractShaderProgram
documentation for more information about usage in shaders. documentation for more information about usage in shaders.
@see @ref Texture, @ref TextureArray, @ref CubeMapTexture,
@ref CubeMapTextureArray, @ref BufferTexture, @ref MultisampleTexture
@requires_gl31 %Extension @extension{ARB,texture_rectangle} @requires_gl31 %Extension @extension{ARB,texture_rectangle}
@requires_gl Rectangle textures are not available in OpenGL ES. @requires_gl Rectangle textures are not available in OpenGL ES.
@see @ref Texture, @ref TextureArray, @ref BufferTexture, @ref CubeMapTexture,
@ref CubeMapTextureArray, @ref MultisampleTexture
*/ */
class RectangleTexture: public AbstractTexture { class RectangleTexture: public AbstractTexture {
public: public:
@ -88,8 +87,9 @@ class RectangleTexture: public AbstractTexture {
* texture size. If @extension{EXT,direct_state_access} is not * texture size. If @extension{EXT,direct_state_access} is not
* available, the texture is bound to some texture unit before the * available, the texture is bound to some texture unit before the
* operation. Initial value is @ref Sampler::Filter::Linear. * operation. Initial value is @ref Sampler::Filter::Linear.
* @see @fn_gl{ActiveTexture}, @fn_gl{BindTexture} and @fn_gl{TexParameter} * @see @ref setMagnificationFilter(), @fn_gl{ActiveTexture},
* or @fn_gl_extension{TextureParameter,EXT,direct_state_access} * @fn_gl{BindTexture} and @fn_gl{TexParameter} or
* @fn_gl_extension{TextureParameter,EXT,direct_state_access}
* with @def_gl{TEXTURE_MIN_FILTER} * with @def_gl{TEXTURE_MIN_FILTER}
*/ */
RectangleTexture& setMinificationFilter(Sampler::Filter filter) { RectangleTexture& setMinificationFilter(Sampler::Filter filter) {
@ -109,7 +109,7 @@ class RectangleTexture: public AbstractTexture {
* The result is not cached in any way. If * The result is not cached in any way. If
* @extension{EXT,direct_state_access} is not available, the texture * @extension{EXT,direct_state_access} is not available, the texture
* is bound to some texture unit before the operation. * is bound to some texture unit before the operation.
* @see @fn_gl{ActiveTexture}, @fn_gl{BindTexture} and * @see @ref image(), @fn_gl{ActiveTexture}, @fn_gl{BindTexture} and
* @fn_gl{GetTexLevelParameter} or @fn_gl_extension{GetTextureLevelParameter,EXT,direct_state_access} * @fn_gl{GetTexLevelParameter} or @fn_gl_extension{GetTextureLevelParameter,EXT,direct_state_access}
* with @def_gl{TEXTURE_WIDTH} and @def_gl{TEXTURE_HEIGHT} * with @def_gl{TEXTURE_WIDTH} and @def_gl{TEXTURE_HEIGHT}
*/ */
@ -120,16 +120,17 @@ class RectangleTexture: public AbstractTexture {
* @param wrapping Wrapping type for all texture dimensions * @param wrapping Wrapping type for all texture dimensions
* @return Reference to self (for method chaining) * @return Reference to self (for method chaining)
* *
* Sets wrapping type for coordinates out of (0, textureSizeInGivenDirection-1) * Sets wrapping type for coordinates out of @f$ [ 0, size - 1 ] @f$
* range. If @extension{EXT,direct_state_access} is not available, the * range. If @extension{EXT,direct_state_access} is not available, the
* texture is bound to some texture unit before the operation. Initial * texture is bound to some texture unit before the operation. Initial
* value is @ref Sampler::Wrapping::ClampToEdge. * value is @ref Sampler::Wrapping::ClampToEdge.
* @attention Only @ref Sampler::Wrapping::ClampToEdge and * @attention Only @ref Sampler::Wrapping::ClampToEdge and
* @ref Sampler::Wrapping::ClampToBorder is supported on this * @ref Sampler::Wrapping::ClampToBorder is supported on this
* texture type. * texture type.
* @see @fn_gl{ActiveTexture}, @fn_gl{BindTexture} and @fn_gl{TexParameter} * @see @ref setBorderColor(), @fn_gl{ActiveTexture},
* or @fn_gl_extension{TextureParameter,EXT,direct_state_access} * @fn_gl{BindTexture} and @fn_gl{TexParameter} or
* with @def_gl{TEXTURE_WRAP_S}, @def_gl{TEXTURE_WRAP_T}, * @fn_gl_extension{TextureParameter,EXT,direct_state_access} with
* @def_gl{TEXTURE_WRAP_S}, @def_gl{TEXTURE_WRAP_T},
* @def_gl{TEXTURE_WRAP_R} * @def_gl{TEXTURE_WRAP_R}
*/ */
RectangleTexture& setWrapping(const Array2D<Sampler::Wrapping>& wrapping) { RectangleTexture& setWrapping(const Array2D<Sampler::Wrapping>& wrapping) {
@ -141,13 +142,8 @@ class RectangleTexture: public AbstractTexture {
* @brief Set border color * @brief Set border color
* @return Reference to self (for method chaining) * @return Reference to self (for method chaining)
* *
* Border color when wrapping is set to @ref Sampler::Wrapping::ClampToBorder. * See @ref Texture::setBorderColor(const Color4&) for more
* If @extension{EXT,direct_state_access} is not available, the texture * information.
* is bound to some texture unit before the operation. Initial value is
* `{0.0f, 0.0f, 0.0f, 0.0f}`.
* @see @fn_gl{ActiveTexture}, @fn_gl{BindTexture} and @fn_gl{TexParameter}
* or @fn_gl_extension{TextureParameter,EXT,direct_state_access}
* with @def_gl{TEXTURE_BORDER_COLOR}
*/ */
RectangleTexture& setBorderColor(const Color4& color) { RectangleTexture& setBorderColor(const Color4& color) {
AbstractTexture::setBorderColor(color); AbstractTexture::setBorderColor(color);
@ -158,22 +154,20 @@ class RectangleTexture: public AbstractTexture {
* @brief Set border color for integer texture * @brief Set border color for integer texture
* @return Reference to self (for method chaining) * @return Reference to self (for method chaining)
* *
* Border color for integer textures when wrapping is set to * See @ref Texture::setBorderColor(const Vector4ui&) for more
* @ref Sampler::Wrapping::ClampToBorder. If @extension{EXT,direct_state_access} * information.
* is not available, the texture is bound to some texture unit before
* the operation. Initial value is `{0, 0, 0, 0}`.
* @see @fn_gl{ActiveTexture}, @fn_gl{BindTexture} and @fn_gl{TexParameter}
* or @fn_gl_extension{TextureParameter,EXT,direct_state_access}
* with @def_gl{TEXTURE_BORDER_COLOR}
* @requires_gl30 %Extension @extension{EXT,texture_integer}
*/ */
RectangleTexture& setBorderColor(const Vector4ui& color) { RectangleTexture& setBorderColor(const Vector4ui& color) {
AbstractTexture::setBorderColor(color); AbstractTexture::setBorderColor(color);
return *this; return *this;
} }
/** @overload /**
* @requires_gl30 %Extension @extension{EXT,texture_integer} * @brief Set border color for integer texture
* @return Reference to self (for method chaining)
*
* See @ref Texture::setBorderColor(const Vector4i&) for more
* information.
*/ */
RectangleTexture& setBorderColor(const Vector4i& color) { RectangleTexture& setBorderColor(const Vector4i& color) {
AbstractTexture::setBorderColor(color); AbstractTexture::setBorderColor(color);

41
src/Magnum/Texture.h

@ -90,13 +90,12 @@ In shader, the texture is used via `sampler1D`/`sampler2D`/`sampler3D`,
See @ref AbstractShaderProgram documentation for more information about usage See @ref AbstractShaderProgram documentation for more information about usage
in shaders. in shaders.
@see @ref Texture1D, @ref Texture2D, @ref Texture3D, @ref TextureArray,
@ref CubeMapTexture, @ref CubeMapTextureArray, @ref RectangleTexture,
@ref BufferTexture, @ref MultisampleTexture
@requires_gles30 %Extension @es_extension{OES,texture_3D} for 3D textures in @requires_gles30 %Extension @es_extension{OES,texture_3D} for 3D textures in
OpenGL ES 2.0 OpenGL ES 2.0
@requires_gl 1D textures are not available in OpenGL ES, only 2D and 3D ones. @requires_gl 1D textures are not available in OpenGL ES, only 2D and 3D ones.
@see @ref Texture1D, @ref Texture2D, @ref Texture3D, @ref TextureArray,
@ref BufferTexture, @ref CubeMapTexture, @ref CubeMapTextureArray,
@ref MultisampleTexture, @ref RectangleTexture
*/ */
template<UnsignedInt dimensions> class Texture: public AbstractTexture { template<UnsignedInt dimensions> class Texture: public AbstractTexture {
public: public:
@ -176,7 +175,7 @@ template<UnsignedInt dimensions> class Texture: public AbstractTexture {
* The result is not cached in any way. If * The result is not cached in any way. If
* @extension{EXT,direct_state_access} is not available, the texture * @extension{EXT,direct_state_access} is not available, the texture
* is bound to some texture unit before the operation. * is bound to some texture unit before the operation.
* @see @fn_gl{ActiveTexture}, @fn_gl{BindTexture} and * @see @ref image(), @fn_gl{ActiveTexture}, @fn_gl{BindTexture} and
* @fn_gl{GetTexLevelParameter} or @fn_gl_extension{GetTextureLevelParameter,EXT,direct_state_access} * @fn_gl{GetTexLevelParameter} or @fn_gl_extension{GetTextureLevelParameter,EXT,direct_state_access}
* with @def_gl{TEXTURE_WIDTH}, @def_gl{TEXTURE_HEIGHT} or * with @def_gl{TEXTURE_WIDTH}, @def_gl{TEXTURE_HEIGHT} or
* @def_gl{TEXTURE_DEPTH} * @def_gl{TEXTURE_DEPTH}
@ -241,8 +240,9 @@ template<UnsignedInt dimensions> class Texture: public AbstractTexture {
* available, the texture is bound to some texture unit before the * available, the texture is bound to some texture unit before the
* operation. Initial value is {@ref Sampler::Filter::Nearest, * operation. Initial value is {@ref Sampler::Filter::Nearest,
* @ref Sampler::Mipmap::Linear}. * @ref Sampler::Mipmap::Linear}.
* @see @ref setBaseLevel(), @ref setMaxLevel(), @fn_gl{ActiveTexture}, * @see @ref setMagnificationFilter(), @ref setBaseLevel(),
* @fn_gl{BindTexture} and @fn_gl{TexParameter} or * @ref setMaxLevel(), @fn_gl{ActiveTexture}, @fn_gl{BindTexture}
* and @fn_gl{TexParameter} or
* @fn_gl_extension{TextureParameter,EXT,direct_state_access} with * @fn_gl_extension{TextureParameter,EXT,direct_state_access} with
* @def_gl{TEXTURE_MIN_FILTER} * @def_gl{TEXTURE_MIN_FILTER}
*/ */
@ -260,9 +260,10 @@ template<UnsignedInt dimensions> class Texture: public AbstractTexture {
* texture size. If @extension{EXT,direct_state_access} is not * texture size. If @extension{EXT,direct_state_access} is not
* available, the texture is bound to some texture unit before the * available, the texture is bound to some texture unit before the
* operation. Initial value is @ref Sampler::Filter::Linear. * operation. Initial value is @ref Sampler::Filter::Linear.
* @see @fn_gl{ActiveTexture}, @fn_gl{BindTexture} and @fn_gl{TexParameter} * @see @ref setMinificationFilter(), @fn_gl{ActiveTexture},
* or @fn_gl_extension{TextureParameter,EXT,direct_state_access} * @fn_gl{BindTexture} and @fn_gl{TexParameter} or
* with @def_gl{TEXTURE_MAG_FILTER} * @fn_gl_extension{TextureParameter,EXT,direct_state_access} with
* @def_gl{TEXTURE_MAG_FILTER}
*/ */
Texture<dimensions>& setMagnificationFilter(Sampler::Filter filter) { Texture<dimensions>& setMagnificationFilter(Sampler::Filter filter) {
AbstractTexture::setMagnificationFilter(filter); AbstractTexture::setMagnificationFilter(filter);
@ -274,13 +275,14 @@ template<UnsignedInt dimensions> class Texture: public AbstractTexture {
* @param wrapping Wrapping type for all texture dimensions * @param wrapping Wrapping type for all texture dimensions
* @return Reference to self (for method chaining) * @return Reference to self (for method chaining)
* *
* Sets wrapping type for coordinates out of range (0.0f, 1.0f). If * Sets wrapping type for coordinates out of range @f$ [ 0.0, 1.0 ] @f$.
* @extension{EXT,direct_state_access} is not available, the texture is * If @extension{EXT,direct_state_access} is not available, the texture
* bound to some texture unit before the operation. Initial value is * is bound to some texture unit before the operation. Initial value is
* @ref Sampler::Wrapping::Repeat. * @ref Sampler::Wrapping::Repeat.
* @see @fn_gl{ActiveTexture}, @fn_gl{BindTexture} and @fn_gl{TexParameter} * @see @ref setBorderColor(), @fn_gl{ActiveTexture},
* or @fn_gl_extension{TextureParameter,EXT,direct_state_access} * @fn_gl{BindTexture} and @fn_gl{TexParameter} or
* with @def_gl{TEXTURE_WRAP_S}, @def_gl{TEXTURE_WRAP_T}, * @fn_gl_extension{TextureParameter,EXT,direct_state_access} with
* @def_gl{TEXTURE_WRAP_S}, @def_gl{TEXTURE_WRAP_T},
* @def_gl{TEXTURE_WRAP_R} * @def_gl{TEXTURE_WRAP_R}
*/ */
Texture<dimensions>& setWrapping(const Array<dimensions, Sampler::Wrapping>& wrapping) { Texture<dimensions>& setWrapping(const Array<dimensions, Sampler::Wrapping>& wrapping) {
@ -296,9 +298,10 @@ template<UnsignedInt dimensions> class Texture: public AbstractTexture {
* If @extension{EXT,direct_state_access} is not available, the texture * If @extension{EXT,direct_state_access} is not available, the texture
* is bound to some texture unit before the operation. Initial value is * is bound to some texture unit before the operation. Initial value is
* `{0.0f, 0.0f, 0.0f, 0.0f}`. * `{0.0f, 0.0f, 0.0f, 0.0f}`.
* @see @fn_gl{ActiveTexture}, @fn_gl{BindTexture} and @fn_gl{TexParameter} * @see @ref setWrapping(), @fn_gl{ActiveTexture}, @fn_gl{BindTexture}
* or @fn_gl_extension{TextureParameter,EXT,direct_state_access} * and @fn_gl{TexParameter} or
* with @def_gl{TEXTURE_BORDER_COLOR} * @fn_gl_extension{TextureParameter,EXT,direct_state_access} with
* @def_gl{TEXTURE_BORDER_COLOR}
* @requires_es_extension %Extension @es_extension{NV,texture_border_clamp} * @requires_es_extension %Extension @es_extension{NV,texture_border_clamp}
*/ */
Texture<dimensions>& setBorderColor(const Color4& color) { Texture<dimensions>& setBorderColor(const Color4& color) {

7
src/Magnum/TextureArray.h

@ -84,13 +84,12 @@ In shader, the texture is used via `sampler1DArray`/`sampler2DArray`,
or `usampler1DArray`/`usampler2DArray`. See @ref AbstractShaderProgram or `usampler1DArray`/`usampler2DArray`. See @ref AbstractShaderProgram
documentation for more information about usage in shaders. documentation for more information about usage in shaders.
@see @ref Texture1DArray, @ref Texture2DArray, @ref Texture,
@ref CubeMapTexture, @ref CubeMapTextureArray, @ref RectangleTexture,
@ref BufferTexture, @ref MultisampleTexture
@requires_gl30 %Extension @extension{EXT,texture_array} @requires_gl30 %Extension @extension{EXT,texture_array}
@requires_gles30 %Array textures are not available in OpenGL ES 2.0. @requires_gles30 %Array textures are not available in OpenGL ES 2.0.
@requires_gl 1D array textures are not available in OpenGL ES, only 2D ones. @requires_gl 1D array textures are not available in OpenGL ES, only 2D ones.
@see @ref Texture1DArray, @ref Texture2DArray, @ref Texture, @ref BufferTexture,
@ref CubeMapTexture, @ref CubeMapTextureArray, @ref MultisampleTexture,
@ref RectangleTexture
*/ */
template<UnsignedInt dimensions> class TextureArray: public AbstractTexture { template<UnsignedInt dimensions> class TextureArray: public AbstractTexture {
public: public:

Loading…
Cancel
Save