@ -49,7 +49,7 @@ namespace Magnum {
# ifndef MAGNUM_TARGET_GLES2
# ifndef MAGNUM_TARGET_GLES2
Float AbstractTexture : : maxLodBias ( ) {
Float AbstractTexture : : maxLodBias ( ) {
GLfloat & value = Context : : current ( ) - > state ( ) . texture - > maxLodBias ;
GLfloat & value = Context : : current ( ) . state ( ) . texture - > maxLodBias ;
/* Get the value, if not already cached */
/* Get the value, if not already cached */
if ( value = = 0.0f )
if ( value = = 0.0f )
@ -62,13 +62,13 @@ Float AbstractTexture::maxLodBias() {
# if !defined(MAGNUM_TARGET_GLES2) && !defined(MAGNUM_TARGET_WEBGL)
# if !defined(MAGNUM_TARGET_GLES2) && !defined(MAGNUM_TARGET_WEBGL)
Int AbstractTexture : : maxColorSamples ( ) {
Int AbstractTexture : : maxColorSamples ( ) {
# ifndef MAGNUM_TARGET_GLES
# ifndef MAGNUM_TARGET_GLES
if ( ! Context : : current ( ) - > isExtensionSupported < Extensions : : GL : : ARB : : texture_multisample > ( ) )
if ( ! Context : : current ( ) . isExtensionSupported < Extensions : : GL : : ARB : : texture_multisample > ( ) )
# else
# else
if ( ! Context : : current ( ) - > isVersionSupported ( Version : : GLES310 ) )
if ( ! Context : : current ( ) . isVersionSupported ( Version : : GLES310 ) )
# endif
# endif
return 0 ;
return 0 ;
GLint & value = Context : : current ( ) - > state ( ) . texture - > maxColorSamples ;
GLint & value = Context : : current ( ) . state ( ) . texture - > maxColorSamples ;
/* Get the value, if not already cached */
/* Get the value, if not already cached */
if ( value = = 0 )
if ( value = = 0 )
@ -79,13 +79,13 @@ Int AbstractTexture::maxColorSamples() {
Int AbstractTexture : : maxDepthSamples ( ) {
Int AbstractTexture : : maxDepthSamples ( ) {
# ifndef MAGNUM_TARGET_GLES
# ifndef MAGNUM_TARGET_GLES
if ( ! Context : : current ( ) - > isExtensionSupported < Extensions : : GL : : ARB : : texture_multisample > ( ) )
if ( ! Context : : current ( ) . isExtensionSupported < Extensions : : GL : : ARB : : texture_multisample > ( ) )
# else
# else
if ( ! Context : : current ( ) - > isVersionSupported ( Version : : GLES310 ) )
if ( ! Context : : current ( ) . isVersionSupported ( Version : : GLES310 ) )
# endif
# endif
return 0 ;
return 0 ;
GLint & value = Context : : current ( ) - > state ( ) . texture - > maxDepthSamples ;
GLint & value = Context : : current ( ) . state ( ) . texture - > maxDepthSamples ;
/* Get the value, if not already cached */
/* Get the value, if not already cached */
if ( value = = 0 )
if ( value = = 0 )
@ -96,13 +96,13 @@ Int AbstractTexture::maxDepthSamples() {
Int AbstractTexture : : maxIntegerSamples ( ) {
Int AbstractTexture : : maxIntegerSamples ( ) {
# ifndef MAGNUM_TARGET_GLES
# ifndef MAGNUM_TARGET_GLES
if ( ! Context : : current ( ) - > isExtensionSupported < Extensions : : GL : : ARB : : texture_multisample > ( ) )
if ( ! Context : : current ( ) . isExtensionSupported < Extensions : : GL : : ARB : : texture_multisample > ( ) )
# else
# else
if ( ! Context : : current ( ) - > isVersionSupported ( Version : : GLES310 ) )
if ( ! Context : : current ( ) . isVersionSupported ( Version : : GLES310 ) )
# endif
# endif
return 0 ;
return 0 ;
GLint & value = Context : : current ( ) - > state ( ) . texture - > maxIntegerSamples ;
GLint & value = Context : : current ( ) . state ( ) . texture - > maxIntegerSamples ;
/* Get the value, if not already cached */
/* Get the value, if not already cached */
if ( value = = 0 )
if ( value = = 0 )
@ -113,18 +113,18 @@ Int AbstractTexture::maxIntegerSamples() {
# endif
# endif
void AbstractTexture : : unbind ( const Int textureUnit ) {
void AbstractTexture : : unbind ( const Int textureUnit ) {
Implementation : : TextureState & textureState = * Context : : current ( ) - > state ( ) . texture ;
Implementation : : TextureState & textureState = * Context : : current ( ) . state ( ) . texture ;
/* If given texture unit is already unbound, nothing to do */
/* If given texture unit is already unbound, nothing to do */
if ( textureState . bindings [ textureUnit ] . second = = 0 ) return ;
if ( textureState . bindings [ textureUnit ] . second = = 0 ) return ;
/* Unbind the texture, reset state tracker */
/* Unbind the texture, reset state tracker */
Context : : current ( ) - > state ( ) . texture - > unbindImplementation ( textureUnit ) ;
Context : : current ( ) . state ( ) . texture - > unbindImplementation ( textureUnit ) ;
textureState . bindings [ textureUnit ] = { } ;
textureState . bindings [ textureUnit ] = { } ;
}
}
void AbstractTexture : : unbindImplementationDefault ( const GLint textureUnit ) {
void AbstractTexture : : unbindImplementationDefault ( const GLint textureUnit ) {
Implementation : : TextureState & textureState = * Context : : current ( ) - > state ( ) . texture ;
Implementation : : TextureState & textureState = * Context : : current ( ) . state ( ) . texture ;
/* Activate given texture unit if not already active, update state tracker */
/* Activate given texture unit if not already active, update state tracker */
if ( textureState . currentTextureUnit ! = textureUnit )
if ( textureState . currentTextureUnit ! = textureUnit )
@ -141,12 +141,12 @@ void AbstractTexture::unbindImplementationMulti(const GLint textureUnit) {
}
}
void AbstractTexture : : unbindImplementationDSA ( const GLint textureUnit ) {
void AbstractTexture : : unbindImplementationDSA ( const GLint textureUnit ) {
CORRADE_INTERNAL_ASSERT ( Context : : current ( ) - > state ( ) . texture - > bindings [ textureUnit ] . first ! = 0 ) ;
CORRADE_INTERNAL_ASSERT ( Context : : current ( ) . state ( ) . texture - > bindings [ textureUnit ] . first ! = 0 ) ;
glBindTextureUnit ( textureUnit , 0 ) ;
glBindTextureUnit ( textureUnit , 0 ) ;
}
}
void AbstractTexture : : unbindImplementationDSAEXT ( const GLint textureUnit ) {
void AbstractTexture : : unbindImplementationDSAEXT ( const GLint textureUnit ) {
Implementation : : TextureState & textureState = * Context : : current ( ) - > state ( ) . texture ;
Implementation : : TextureState & textureState = * Context : : current ( ) . state ( ) . texture ;
CORRADE_INTERNAL_ASSERT ( textureState . bindings [ textureUnit ] . first ! = 0 ) ;
CORRADE_INTERNAL_ASSERT ( textureState . bindings [ textureUnit ] . first ! = 0 ) ;
glBindMultiTextureEXT ( GL_TEXTURE0 + textureUnit , textureState . bindings [ textureUnit ] . first , 0 ) ;
glBindMultiTextureEXT ( GL_TEXTURE0 + textureUnit , textureState . bindings [ textureUnit ] . first , 0 ) ;
@ -155,13 +155,13 @@ void AbstractTexture::unbindImplementationDSAEXT(const GLint textureUnit) {
void AbstractTexture : : unbind ( const Int firstTextureUnit , const std : : size_t count ) {
void AbstractTexture : : unbind ( const Int firstTextureUnit , const std : : size_t count ) {
/* State tracker is updated in the implementations */
/* State tracker is updated in the implementations */
Context : : current ( ) - > state ( ) . texture - > bindMultiImplementation ( firstTextureUnit , { nullptr , count } ) ;
Context : : current ( ) . state ( ) . texture - > bindMultiImplementation ( firstTextureUnit , { nullptr , count } ) ;
}
}
/** @todoc const std::initializer_list makes Doxygen grumpy */
/** @todoc const std::initializer_list makes Doxygen grumpy */
void AbstractTexture : : bind ( const Int firstTextureUnit , std : : initializer_list < AbstractTexture * > textures ) {
void AbstractTexture : : bind ( const Int firstTextureUnit , std : : initializer_list < AbstractTexture * > textures ) {
/* State tracker is updated in the implementations */
/* State tracker is updated in the implementations */
Context : : current ( ) - > state ( ) . texture - > bindMultiImplementation ( firstTextureUnit , { textures . begin ( ) , textures . size ( ) } ) ;
Context : : current ( ) . state ( ) . texture - > bindMultiImplementation ( firstTextureUnit , { textures . begin ( ) , textures . size ( ) } ) ;
}
}
void AbstractTexture : : bindImplementationFallback ( const GLint firstTextureUnit , const Containers : : ArrayView < AbstractTexture * const > textures ) {
void AbstractTexture : : bindImplementationFallback ( const GLint firstTextureUnit , const Containers : : ArrayView < AbstractTexture * const > textures ) {
@ -172,7 +172,7 @@ void AbstractTexture::bindImplementationFallback(const GLint firstTextureUnit, c
# ifndef MAGNUM_TARGET_GLES
# ifndef MAGNUM_TARGET_GLES
/** @todoc const Containers::ArrayView makes Doxygen grumpy */
/** @todoc const Containers::ArrayView makes Doxygen grumpy */
void AbstractTexture : : bindImplementationMulti ( const GLint firstTextureUnit , Containers : : ArrayView < AbstractTexture * const > textures ) {
void AbstractTexture : : bindImplementationMulti ( const GLint firstTextureUnit , Containers : : ArrayView < AbstractTexture * const > textures ) {
Implementation : : TextureState & textureState = * Context : : current ( ) - > state ( ) . texture ;
Implementation : : TextureState & textureState = * Context : : current ( ) . state ( ) . texture ;
/* Create array of IDs and also update bindings in state tracker */
/* Create array of IDs and also update bindings in state tracker */
/** @todo VLAs */
/** @todo VLAs */
@ -199,7 +199,7 @@ void AbstractTexture::bindImplementationMulti(const GLint firstTextureUnit, Cont
# ifndef MAGNUM_TARGET_GLES
# ifndef MAGNUM_TARGET_GLES
Int AbstractTexture : : compressedBlockDataSize ( const GLenum target , const TextureFormat format ) {
Int AbstractTexture : : compressedBlockDataSize ( const GLenum target , const TextureFormat format ) {
return ( Context : : current ( ) - > state ( ) . texture - > compressedBlockDataSizeImplementation ) ( target , format ) ;
return ( Context : : current ( ) . state ( ) . texture - > compressedBlockDataSizeImplementation ) ( target , format ) ;
}
}
Int AbstractTexture : : compressedBlockDataSizeImplementationDefault ( const GLenum target , const TextureFormat format ) {
Int AbstractTexture : : compressedBlockDataSizeImplementationDefault ( const GLenum target , const TextureFormat format ) {
@ -215,7 +215,7 @@ Int AbstractTexture::compressedBlockDataSizeImplementationBitsWorkaround(const G
# endif
# endif
AbstractTexture : : AbstractTexture ( GLenum target ) : _target { target } , _flags { ObjectFlag : : DeleteOnDestruction } {
AbstractTexture : : AbstractTexture ( GLenum target ) : _target { target } , _flags { ObjectFlag : : DeleteOnDestruction } {
( this - > * Context : : current ( ) - > state ( ) . texture - > createImplementation ) ( ) ;
( this - > * Context : : current ( ) . state ( ) . texture - > createImplementation ) ( ) ;
CORRADE_INTERNAL_ASSERT ( _id ! = Implementation : : State : : DisengagedBinding ) ;
CORRADE_INTERNAL_ASSERT ( _id ! = Implementation : : State : : DisengagedBinding ) ;
}
}
@ -235,7 +235,7 @@ AbstractTexture::~AbstractTexture() {
if ( ! _id | | ! ( _flags & ObjectFlag : : DeleteOnDestruction ) ) return ;
if ( ! _id | | ! ( _flags & ObjectFlag : : DeleteOnDestruction ) ) return ;
/* Remove all bindings */
/* Remove all bindings */
for ( auto & binding : Context : : current ( ) - > state ( ) . texture - > bindings )
for ( auto & binding : Context : : current ( ) . state ( ) . texture - > bindings )
{
{
/* MSVC 2015 needs the parentheses around */
/* MSVC 2015 needs the parentheses around */
if ( binding . second = = _id ) binding = { } ;
if ( binding . second = = _id ) binding = { } ;
@ -259,18 +259,18 @@ void AbstractTexture::createIfNotAlready() {
# ifndef MAGNUM_TARGET_WEBGL
# ifndef MAGNUM_TARGET_WEBGL
std : : string AbstractTexture : : label ( ) {
std : : string AbstractTexture : : label ( ) {
createIfNotAlready ( ) ;
createIfNotAlready ( ) ;
return Context : : current ( ) - > state ( ) . debug - > getLabelImplementation ( GL_TEXTURE , _id ) ;
return Context : : current ( ) . state ( ) . debug - > getLabelImplementation ( GL_TEXTURE , _id ) ;
}
}
AbstractTexture & AbstractTexture : : setLabelInternal ( const Containers : : ArrayView < const char > label ) {
AbstractTexture & AbstractTexture : : setLabelInternal ( const Containers : : ArrayView < const char > label ) {
createIfNotAlready ( ) ;
createIfNotAlready ( ) ;
Context : : current ( ) - > state ( ) . debug - > labelImplementation ( GL_TEXTURE , _id , label ) ;
Context : : current ( ) . state ( ) . debug - > labelImplementation ( GL_TEXTURE , _id , label ) ;
return * this ;
return * this ;
}
}
# endif
# endif
void AbstractTexture : : bind ( Int textureUnit ) {
void AbstractTexture : : bind ( Int textureUnit ) {
Implementation : : TextureState & textureState = * Context : : current ( ) - > state ( ) . texture ;
Implementation : : TextureState & textureState = * Context : : current ( ) . state ( ) . texture ;
/* If already bound in given texture unit, nothing to do */
/* If already bound in given texture unit, nothing to do */
if ( textureState . bindings [ textureUnit ] . second = = _id ) return ;
if ( textureState . bindings [ textureUnit ] . second = = _id ) return ;
@ -281,7 +281,7 @@ void AbstractTexture::bind(Int textureUnit) {
}
}
void AbstractTexture : : bindImplementationDefault ( GLint textureUnit ) {
void AbstractTexture : : bindImplementationDefault ( GLint textureUnit ) {
Implementation : : TextureState & textureState = * Context : : current ( ) - > state ( ) . texture ;
Implementation : : TextureState & textureState = * Context : : current ( ) . state ( ) . texture ;
/* Activate given texture unit if not already active, update state tracker */
/* Activate given texture unit if not already active, update state tracker */
if ( textureState . currentTextureUnit ! = textureUnit )
if ( textureState . currentTextureUnit ! = textureUnit )
@ -310,13 +310,13 @@ void AbstractTexture::bindImplementationDSAEXT(GLint textureUnit) {
# ifndef MAGNUM_TARGET_GLES2
# ifndef MAGNUM_TARGET_GLES2
void AbstractTexture : : setBaseLevel ( Int level ) {
void AbstractTexture : : setBaseLevel ( Int level ) {
( this - > * Context : : current ( ) - > state ( ) . texture - > parameteriImplementation ) ( GL_TEXTURE_BASE_LEVEL , level ) ;
( this - > * Context : : current ( ) . state ( ) . texture - > parameteriImplementation ) ( GL_TEXTURE_BASE_LEVEL , level ) ;
}
}
# endif
# endif
# if !(defined(MAGNUM_TARGET_WEBGL) && defined(MAGNUM_TARGET_GLES2))
# if !(defined(MAGNUM_TARGET_WEBGL) && defined(MAGNUM_TARGET_GLES2))
void AbstractTexture : : setMaxLevel ( Int level ) {
void AbstractTexture : : setMaxLevel ( Int level ) {
( this - > * Context : : current ( ) - > state ( ) . texture - > parameteriImplementation ) (
( this - > * Context : : current ( ) . state ( ) . texture - > parameteriImplementation ) (
# ifndef MAGNUM_TARGET_GLES2
# ifndef MAGNUM_TARGET_GLES2
GL_TEXTURE_MAX_LEVEL
GL_TEXTURE_MAX_LEVEL
# else
# else
@ -327,32 +327,32 @@ void AbstractTexture::setMaxLevel(Int level) {
# endif
# endif
void AbstractTexture : : setMinificationFilter ( Sampler : : Filter filter , Sampler : : Mipmap mipmap ) {
void AbstractTexture : : setMinificationFilter ( Sampler : : Filter filter , Sampler : : Mipmap mipmap ) {
( this - > * Context : : current ( ) - > state ( ) . texture - > parameteriImplementation ) ( GL_TEXTURE_MIN_FILTER , GLint ( filter ) | GLint ( mipmap ) ) ;
( this - > * Context : : current ( ) . state ( ) . texture - > parameteriImplementation ) ( GL_TEXTURE_MIN_FILTER , GLint ( filter ) | GLint ( mipmap ) ) ;
}
}
void AbstractTexture : : setMagnificationFilter ( const Sampler : : Filter filter ) {
void AbstractTexture : : setMagnificationFilter ( const Sampler : : Filter filter ) {
( this - > * Context : : current ( ) - > state ( ) . texture - > parameteriImplementation ) ( GL_TEXTURE_MAG_FILTER , GLint ( filter ) ) ;
( this - > * Context : : current ( ) . state ( ) . texture - > parameteriImplementation ) ( GL_TEXTURE_MAG_FILTER , GLint ( filter ) ) ;
}
}
# ifndef MAGNUM_TARGET_GLES2
# ifndef MAGNUM_TARGET_GLES2
void AbstractTexture : : setMinLod ( const Float lod ) {
void AbstractTexture : : setMinLod ( const Float lod ) {
( this - > * Context : : current ( ) - > state ( ) . texture - > parameterfImplementation ) ( GL_TEXTURE_MIN_LOD , lod ) ;
( this - > * Context : : current ( ) . state ( ) . texture - > parameterfImplementation ) ( GL_TEXTURE_MIN_LOD , lod ) ;
}
}
void AbstractTexture : : setMaxLod ( const Float lod ) {
void AbstractTexture : : setMaxLod ( const Float lod ) {
( this - > * Context : : current ( ) - > state ( ) . texture - > parameterfImplementation ) ( GL_TEXTURE_MAX_LOD , lod ) ;
( this - > * Context : : current ( ) . state ( ) . texture - > parameterfImplementation ) ( GL_TEXTURE_MAX_LOD , lod ) ;
}
}
# endif
# endif
# ifndef MAGNUM_TARGET_GLES
# ifndef MAGNUM_TARGET_GLES
void AbstractTexture : : setLodBias ( const Float bias ) {
void AbstractTexture : : setLodBias ( const Float bias ) {
( this - > * Context : : current ( ) - > state ( ) . texture - > parameterfImplementation ) ( GL_TEXTURE_LOD_BIAS , bias ) ;
( this - > * Context : : current ( ) . state ( ) . texture - > parameterfImplementation ) ( GL_TEXTURE_LOD_BIAS , bias ) ;
}
}
# endif
# endif
# ifndef MAGNUM_TARGET_WEBGL
# ifndef MAGNUM_TARGET_WEBGL
void AbstractTexture : : setBorderColor ( const Color4 & color ) {
void AbstractTexture : : setBorderColor ( const Color4 & color ) {
( this - > * Context : : current ( ) - > state ( ) . texture - > parameterfvImplementation ) (
( this - > * Context : : current ( ) . state ( ) . texture - > parameterfvImplementation ) (
# ifndef MAGNUM_TARGET_GLES
# ifndef MAGNUM_TARGET_GLES
GL_TEXTURE_BORDER_COLOR ,
GL_TEXTURE_BORDER_COLOR ,
# else
# else
@ -363,7 +363,7 @@ void AbstractTexture::setBorderColor(const Color4& color) {
# ifndef MAGNUM_TARGET_GLES2
# ifndef MAGNUM_TARGET_GLES2
void AbstractTexture : : setBorderColor ( const Vector4ui & color ) {
void AbstractTexture : : setBorderColor ( const Vector4ui & color ) {
( this - > * Context : : current ( ) - > state ( ) . texture - > parameterIuivImplementation ) (
( this - > * Context : : current ( ) . state ( ) . texture - > parameterIuivImplementation ) (
# ifndef MAGNUM_TARGET_GLES
# ifndef MAGNUM_TARGET_GLES
GL_TEXTURE_BORDER_COLOR ,
GL_TEXTURE_BORDER_COLOR ,
# else
# else
@ -373,7 +373,7 @@ void AbstractTexture::setBorderColor(const Vector4ui& color) {
}
}
void AbstractTexture : : setBorderColor ( const Vector4i & color ) {
void AbstractTexture : : setBorderColor ( const Vector4i & color ) {
( this - > * Context : : current ( ) - > state ( ) . texture - > parameterIivImplementation ) (
( this - > * Context : : current ( ) . state ( ) . texture - > parameterIivImplementation ) (
# ifndef MAGNUM_TARGET_GLES
# ifndef MAGNUM_TARGET_GLES
GL_TEXTURE_BORDER_COLOR ,
GL_TEXTURE_BORDER_COLOR ,
# else
# else
@ -385,12 +385,12 @@ void AbstractTexture::setBorderColor(const Vector4i& color) {
# endif
# endif
void AbstractTexture : : setMaxAnisotropy ( const Float anisotropy ) {
void AbstractTexture : : setMaxAnisotropy ( const Float anisotropy ) {
( this - > * Context : : current ( ) - > state ( ) . texture - > setMaxAnisotropyImplementation ) ( anisotropy ) ;
( this - > * Context : : current ( ) . state ( ) . texture - > setMaxAnisotropyImplementation ) ( anisotropy ) ;
}
}
# ifndef MAGNUM_TARGET_WEBGL
# ifndef MAGNUM_TARGET_WEBGL
void AbstractTexture : : setSRGBDecode ( bool decode ) {
void AbstractTexture : : setSRGBDecode ( bool decode ) {
( this - > * Context : : current ( ) - > state ( ) . texture - > parameteriImplementation ) ( GL_TEXTURE_SRGB_DECODE_EXT ,
( this - > * Context : : current ( ) . state ( ) . texture - > parameteriImplementation ) ( GL_TEXTURE_SRGB_DECODE_EXT ,
decode ? GL_DECODE_EXT : GL_SKIP_DECODE_EXT ) ;
decode ? GL_DECODE_EXT : GL_SKIP_DECODE_EXT ) ;
}
}
# endif
# endif
@ -399,19 +399,19 @@ void AbstractTexture::setSRGBDecode(bool decode) {
void AbstractTexture : : setSwizzleInternal ( const GLint r , const GLint g , const GLint b , const GLint a ) {
void AbstractTexture : : setSwizzleInternal ( const GLint r , const GLint g , const GLint b , const GLint a ) {
# ifndef MAGNUM_TARGET_GLES
# ifndef MAGNUM_TARGET_GLES
const GLint rgba [ ] = { r , g , b , a } ;
const GLint rgba [ ] = { r , g , b , a } ;
( this - > * Context : : current ( ) - > state ( ) . texture - > parameterivImplementation ) ( GL_TEXTURE_SWIZZLE_RGBA , rgba ) ;
( this - > * Context : : current ( ) . state ( ) . texture - > parameterivImplementation ) ( GL_TEXTURE_SWIZZLE_RGBA , rgba ) ;
# else
# else
( this - > * Context : : current ( ) - > state ( ) . texture - > parameteriImplementation ) ( GL_TEXTURE_SWIZZLE_R , r ) ;
( this - > * Context : : current ( ) . state ( ) . texture - > parameteriImplementation ) ( GL_TEXTURE_SWIZZLE_R , r ) ;
( this - > * Context : : current ( ) - > state ( ) . texture - > parameteriImplementation ) ( GL_TEXTURE_SWIZZLE_G , g ) ;
( this - > * Context : : current ( ) . state ( ) . texture - > parameteriImplementation ) ( GL_TEXTURE_SWIZZLE_G , g ) ;
( this - > * Context : : current ( ) - > state ( ) . texture - > parameteriImplementation ) ( GL_TEXTURE_SWIZZLE_B , b ) ;
( this - > * Context : : current ( ) . state ( ) . texture - > parameteriImplementation ) ( GL_TEXTURE_SWIZZLE_B , b ) ;
( this - > * Context : : current ( ) - > state ( ) . texture - > parameteriImplementation ) ( GL_TEXTURE_SWIZZLE_A , a ) ;
( this - > * Context : : current ( ) . state ( ) . texture - > parameteriImplementation ) ( GL_TEXTURE_SWIZZLE_A , a ) ;
# endif
# endif
}
}
# endif
# endif
# if !(defined(MAGNUM_TARGET_WEBGL) && defined(MAGNUM_TARGET_GLES2))
# if !(defined(MAGNUM_TARGET_WEBGL) && defined(MAGNUM_TARGET_GLES2))
void AbstractTexture : : setCompareMode ( const Sampler : : CompareMode mode ) {
void AbstractTexture : : setCompareMode ( const Sampler : : CompareMode mode ) {
( this - > * Context : : current ( ) - > state ( ) . texture - > parameteriImplementation ) (
( this - > * Context : : current ( ) . state ( ) . texture - > parameteriImplementation ) (
# ifndef MAGNUM_TARGET_GLES2
# ifndef MAGNUM_TARGET_GLES2
GL_TEXTURE_COMPARE_MODE
GL_TEXTURE_COMPARE_MODE
# else
# else
@ -421,7 +421,7 @@ void AbstractTexture::setCompareMode(const Sampler::CompareMode mode) {
}
}
void AbstractTexture : : setCompareFunction ( const Sampler : : CompareFunction function ) {
void AbstractTexture : : setCompareFunction ( const Sampler : : CompareFunction function ) {
( this - > * Context : : current ( ) - > state ( ) . texture - > parameteriImplementation ) (
( this - > * Context : : current ( ) . state ( ) . texture - > parameteriImplementation ) (
# ifndef MAGNUM_TARGET_GLES2
# ifndef MAGNUM_TARGET_GLES2
GL_TEXTURE_COMPARE_FUNC
GL_TEXTURE_COMPARE_FUNC
# else
# else
@ -433,16 +433,16 @@ void AbstractTexture::setCompareFunction(const Sampler::CompareFunction function
# if !defined(MAGNUM_TARGET_GLES2) && !defined(MAGNUM_TARGET_WEBGL)
# if !defined(MAGNUM_TARGET_GLES2) && !defined(MAGNUM_TARGET_WEBGL)
void AbstractTexture : : setDepthStencilMode ( const Sampler : : DepthStencilMode mode ) {
void AbstractTexture : : setDepthStencilMode ( const Sampler : : DepthStencilMode mode ) {
( this - > * Context : : current ( ) - > state ( ) . texture - > parameteriImplementation ) ( GL_DEPTH_STENCIL_TEXTURE_MODE , GLenum ( mode ) ) ;
( this - > * Context : : current ( ) . state ( ) . texture - > parameteriImplementation ) ( GL_DEPTH_STENCIL_TEXTURE_MODE , GLenum ( mode ) ) ;
}
}
# endif
# endif
void AbstractTexture : : invalidateImage ( const Int level ) {
void AbstractTexture : : invalidateImage ( const Int level ) {
( this - > * Context : : current ( ) - > state ( ) . texture - > invalidateImageImplementation ) ( level ) ;
( this - > * Context : : current ( ) . state ( ) . texture - > invalidateImageImplementation ) ( level ) ;
}
}
void AbstractTexture : : generateMipmap ( ) {
void AbstractTexture : : generateMipmap ( ) {
( this - > * Context : : current ( ) - > state ( ) . texture - > mipmapImplementation ) ( ) ;
( this - > * Context : : current ( ) . state ( ) . texture - > mipmapImplementation ) ( ) ;
}
}
void AbstractTexture : : mipmapImplementationDefault ( ) {
void AbstractTexture : : mipmapImplementationDefault ( ) {
@ -466,7 +466,7 @@ void AbstractTexture::bindInternal() {
functions need to have the texture bound in * currently active * unit ,
functions need to have the texture bound in * currently active * unit ,
so we would need to call glActiveTexture ( ) afterwards anyway . */
so we would need to call glActiveTexture ( ) afterwards anyway . */
Implementation : : TextureState & textureState = * Context : : current ( ) - > state ( ) . texture ;
Implementation : : TextureState & textureState = * Context : : current ( ) . state ( ) . texture ;
/* If the texture is already bound in current unit, nothing to do */
/* If the texture is already bound in current unit, nothing to do */
if ( textureState . bindings [ textureState . currentTextureUnit ] . second = = _id )
if ( textureState . bindings [ textureState . currentTextureUnit ] . second = = _id )
@ -1107,7 +1107,7 @@ void AbstractTexture::parameterIImplementationDSAEXT(GLenum parameter, const GLi
void AbstractTexture : : setMaxAnisotropyImplementationNoOp ( GLfloat ) { }
void AbstractTexture : : setMaxAnisotropyImplementationNoOp ( GLfloat ) { }
void AbstractTexture : : setMaxAnisotropyImplementationExt ( GLfloat anisotropy ) {
void AbstractTexture : : setMaxAnisotropyImplementationExt ( GLfloat anisotropy ) {
( this - > * Context : : current ( ) - > state ( ) . texture - > parameterfImplementation ) ( GL_TEXTURE_MAX_ANISOTROPY_EXT , anisotropy ) ;
( this - > * Context : : current ( ) . state ( ) . texture - > parameterfImplementation ) ( GL_TEXTURE_MAX_ANISOTROPY_EXT , anisotropy ) ;
}
}
# if !defined(MAGNUM_TARGET_GLES2) && !defined(MAGNUM_TARGET_WEBGL)
# if !defined(MAGNUM_TARGET_GLES2) && !defined(MAGNUM_TARGET_WEBGL)
@ -1520,7 +1520,7 @@ template<UnsignedInt dimensions> void AbstractTexture::image(GLint level, Image<
Buffer : : unbindInternal ( Buffer : : TargetHint : : PixelPack ) ;
Buffer : : unbindInternal ( Buffer : : TargetHint : : PixelPack ) ;
image . storage ( ) . applyPack ( ) ;
image . storage ( ) . applyPack ( ) ;
( this - > * Context : : current ( ) - > state ( ) . texture - > getImageImplementation ) ( level , image . format ( ) , image . type ( ) , data . size ( ) , data ) ;
( this - > * Context : : current ( ) . state ( ) . texture - > getImageImplementation ) ( level , image . format ( ) , image . type ( ) , data . size ( ) , data ) ;
image . setData ( image . storage ( ) , image . format ( ) , image . type ( ) , size , std : : move ( data ) ) ;
image . setData ( image . storage ( ) , image . format ( ) , image . type ( ) , size , std : : move ( data ) ) ;
}
}
@ -1540,7 +1540,7 @@ template<UnsignedInt dimensions> void AbstractTexture::image(GLint level, Buffer
image . buffer ( ) . bindInternal ( Buffer : : TargetHint : : PixelPack ) ;
image . buffer ( ) . bindInternal ( Buffer : : TargetHint : : PixelPack ) ;
image . storage ( ) . applyPack ( ) ;
image . storage ( ) . applyPack ( ) ;
( this - > * Context : : current ( ) - > state ( ) . texture - > getImageImplementation ) ( level , image . format ( ) , image . type ( ) , dataSize , nullptr ) ;
( this - > * Context : : current ( ) . state ( ) . texture - > getImageImplementation ) ( level , image . format ( ) , image . type ( ) , dataSize , nullptr ) ;
}
}
template void MAGNUM_EXPORT AbstractTexture : : image < 1 > ( GLint , BufferImage < 1 > & , BufferUsage ) ;
template void MAGNUM_EXPORT AbstractTexture : : image < 1 > ( GLint , BufferImage < 1 > & , BufferUsage ) ;
@ -1550,10 +1550,10 @@ template void MAGNUM_EXPORT AbstractTexture::image<3>(GLint, BufferImage<3>&, Bu
template < UnsignedInt dimensions > void AbstractTexture : : compressedImage ( const GLint level , CompressedImage < dimensions > & image ) {
template < UnsignedInt dimensions > void AbstractTexture : : compressedImage ( const GLint level , CompressedImage < dimensions > & image ) {
const Math : : Vector < dimensions , Int > size = DataHelper < dimensions > : : imageSize ( * this , level ) ;
const Math : : Vector < dimensions , Int > size = DataHelper < dimensions > : : imageSize ( * this , level ) ;
GLint textureDataSize ;
GLint textureDataSize ;
( this - > * Context : : current ( ) - > state ( ) . texture - > getLevelParameterivImplementation ) ( level , GL_TEXTURE_COMPRESSED_IMAGE_SIZE , & textureDataSize ) ;
( this - > * Context : : current ( ) . state ( ) . texture - > getLevelParameterivImplementation ) ( level , GL_TEXTURE_COMPRESSED_IMAGE_SIZE , & textureDataSize ) ;
const std : : size_t dataSize = Implementation : : compressedImageDataSizeFor ( image , size , textureDataSize ) ;
const std : : size_t dataSize = Implementation : : compressedImageDataSizeFor ( image , size , textureDataSize ) ;
GLint format ;
GLint format ;
( this - > * Context : : current ( ) - > state ( ) . texture - > getLevelParameterivImplementation ) ( level , GL_TEXTURE_INTERNAL_FORMAT , & format ) ;
( this - > * Context : : current ( ) . state ( ) . texture - > getLevelParameterivImplementation ) ( level , GL_TEXTURE_INTERNAL_FORMAT , & format ) ;
/* Reallocate only if needed */
/* Reallocate only if needed */
Containers : : Array < char > data { image . release ( ) } ;
Containers : : Array < char > data { image . release ( ) } ;
@ -1562,7 +1562,7 @@ template<UnsignedInt dimensions> void AbstractTexture::compressedImage(const GLi
Buffer : : unbindInternal ( Buffer : : TargetHint : : PixelPack ) ;
Buffer : : unbindInternal ( Buffer : : TargetHint : : PixelPack ) ;
image . storage ( ) . applyPack ( ) ;
image . storage ( ) . applyPack ( ) ;
( this - > * Context : : current ( ) - > state ( ) . texture - > getCompressedImageImplementation ) ( level , data . size ( ) , data ) ;
( this - > * Context : : current ( ) . state ( ) . texture - > getCompressedImageImplementation ) ( level , data . size ( ) , data ) ;
image . setData ( image . storage ( ) , CompressedPixelFormat ( format ) , size , std : : move ( data ) ) ;
image . setData ( image . storage ( ) , CompressedPixelFormat ( format ) , size , std : : move ( data ) ) ;
}
}
@ -1573,10 +1573,10 @@ template void MAGNUM_EXPORT AbstractTexture::compressedImage<3>(GLint, Compresse
template < UnsignedInt dimensions > void AbstractTexture : : compressedImage ( const GLint level , CompressedBufferImage < dimensions > & image , BufferUsage usage ) {
template < UnsignedInt dimensions > void AbstractTexture : : compressedImage ( const GLint level , CompressedBufferImage < dimensions > & image , BufferUsage usage ) {
const Math : : Vector < dimensions , Int > size = DataHelper < dimensions > : : imageSize ( * this , level ) ;
const Math : : Vector < dimensions , Int > size = DataHelper < dimensions > : : imageSize ( * this , level ) ;
GLint textureDataSize ;
GLint textureDataSize ;
( this - > * Context : : current ( ) - > state ( ) . texture - > getLevelParameterivImplementation ) ( level , GL_TEXTURE_COMPRESSED_IMAGE_SIZE , & textureDataSize ) ;
( this - > * Context : : current ( ) . state ( ) . texture - > getLevelParameterivImplementation ) ( level , GL_TEXTURE_COMPRESSED_IMAGE_SIZE , & textureDataSize ) ;
const std : : size_t dataSize = Implementation : : compressedImageDataSizeFor ( image , size , textureDataSize ) ;
const std : : size_t dataSize = Implementation : : compressedImageDataSizeFor ( image , size , textureDataSize ) ;
GLint format ;
GLint format ;
( this - > * Context : : current ( ) - > state ( ) . texture - > getLevelParameterivImplementation ) ( level , GL_TEXTURE_INTERNAL_FORMAT , & format ) ;
( this - > * Context : : current ( ) . state ( ) . texture - > getLevelParameterivImplementation ) ( level , GL_TEXTURE_INTERNAL_FORMAT , & format ) ;
/* Reallocate only if needed */
/* Reallocate only if needed */
if ( image . dataSize ( ) < dataSize )
if ( image . dataSize ( ) < dataSize )
@ -1586,7 +1586,7 @@ template<UnsignedInt dimensions> void AbstractTexture::compressedImage(const GLi
image . buffer ( ) . bindInternal ( Buffer : : TargetHint : : PixelPack ) ;
image . buffer ( ) . bindInternal ( Buffer : : TargetHint : : PixelPack ) ;
image . storage ( ) . applyPack ( ) ;
image . storage ( ) . applyPack ( ) ;
( this - > * Context : : current ( ) - > state ( ) . texture - > getCompressedImageImplementation ) ( level , dataSize , nullptr ) ;
( this - > * Context : : current ( ) . state ( ) . texture - > getCompressedImageImplementation ) ( level , dataSize , nullptr ) ;
}
}
template void MAGNUM_EXPORT AbstractTexture : : compressedImage < 1 > ( GLint , CompressedBufferImage < 1 > & , BufferUsage ) ;
template void MAGNUM_EXPORT AbstractTexture : : compressedImage < 1 > ( GLint , CompressedBufferImage < 1 > & , BufferUsage ) ;
@ -1654,7 +1654,7 @@ template<UnsignedInt dimensions> void AbstractTexture::compressedSubImage(const
const Vector3i paddedOffset = Vector3i : : pad ( range . min ( ) ) ;
const Vector3i paddedOffset = Vector3i : : pad ( range . min ( ) ) ;
const Vector3i paddedSize = Vector3i : : pad ( size , 1 ) ;
const Vector3i paddedSize = Vector3i : : pad ( size , 1 ) ;
GLint format ;
GLint format ;
( this - > * Context : : current ( ) - > state ( ) . texture - > getLevelParameterivImplementation ) ( level , GL_TEXTURE_INTERNAL_FORMAT , & format ) ;
( this - > * Context : : current ( ) . state ( ) . texture - > getLevelParameterivImplementation ) ( level , GL_TEXTURE_INTERNAL_FORMAT , & format ) ;
const std : : size_t dataSize = Implementation : : compressedImageDataSizeFor ( image , size , compressedSubImageSize < dimensions > ( TextureFormat ( format ) , size ) ) ;
const std : : size_t dataSize = Implementation : : compressedImageDataSizeFor ( image , size , compressedSubImageSize < dimensions > ( TextureFormat ( format ) , size ) ) ;
/* Reallocate only if needed */
/* Reallocate only if needed */
@ -1679,7 +1679,7 @@ template<UnsignedInt dimensions> void AbstractTexture::compressedSubImage(const
const Vector3i paddedOffset = Vector3i : : pad ( range . min ( ) ) ;
const Vector3i paddedOffset = Vector3i : : pad ( range . min ( ) ) ;
const Vector3i paddedSize = Vector3i : : pad ( size , 1 ) ;
const Vector3i paddedSize = Vector3i : : pad ( size , 1 ) ;
GLint format ;
GLint format ;
( this - > * Context : : current ( ) - > state ( ) . texture - > getLevelParameterivImplementation ) ( level , GL_TEXTURE_INTERNAL_FORMAT , & format ) ;
( this - > * Context : : current ( ) . state ( ) . texture - > getLevelParameterivImplementation ) ( level , GL_TEXTURE_INTERNAL_FORMAT , & format ) ;
const std : : size_t dataSize = Implementation : : compressedImageDataSizeFor ( image , size , compressedSubImageSize < dimensions > ( TextureFormat ( format ) , size ) ) ;
const std : : size_t dataSize = Implementation : : compressedImageDataSizeFor ( image , size , compressedSubImageSize < dimensions > ( TextureFormat ( format ) , size ) ) ;
/* Reallocate only if needed */
/* Reallocate only if needed */
@ -1723,14 +1723,14 @@ Vector3i AbstractTexture::DataHelper<3>::compressedBlockSize(const GLenum target
# ifndef MAGNUM_TARGET_GLES
# ifndef MAGNUM_TARGET_GLES
Math : : Vector < 1 , GLint > AbstractTexture : : DataHelper < 1 > : : imageSize ( AbstractTexture & texture , const GLint level ) {
Math : : Vector < 1 , GLint > AbstractTexture : : DataHelper < 1 > : : imageSize ( AbstractTexture & texture , const GLint level ) {
Math : : Vector < 1 , GLint > value ;
Math : : Vector < 1 , GLint > value ;
( texture . * Context : : current ( ) - > state ( ) . texture - > getLevelParameterivImplementation ) ( level , GL_TEXTURE_WIDTH , & value [ 0 ] ) ;
( texture . * Context : : current ( ) . state ( ) . texture - > getLevelParameterivImplementation ) ( level , GL_TEXTURE_WIDTH , & value [ 0 ] ) ;
return value ;
return value ;
}
}
# endif
# endif
# if !defined(MAGNUM_TARGET_GLES2) && !defined(MAGNUM_TARGET_WEBGL)
# if !defined(MAGNUM_TARGET_GLES2) && !defined(MAGNUM_TARGET_WEBGL)
Vector2i AbstractTexture : : DataHelper < 2 > : : imageSize ( AbstractTexture & texture , const GLint level ) {
Vector2i AbstractTexture : : DataHelper < 2 > : : imageSize ( AbstractTexture & texture , const GLint level ) {
const Implementation : : TextureState & state = * Context : : current ( ) - > state ( ) . texture ;
const Implementation : : TextureState & state = * Context : : current ( ) . state ( ) . texture ;
Vector2i value ;
Vector2i value ;
( texture . * state . getLevelParameterivImplementation ) ( level , GL_TEXTURE_WIDTH , & value [ 0 ] ) ;
( texture . * state . getLevelParameterivImplementation ) ( level , GL_TEXTURE_WIDTH , & value [ 0 ] ) ;
@ -1739,7 +1739,7 @@ Vector2i AbstractTexture::DataHelper<2>::imageSize(AbstractTexture& texture, con
}
}
Vector3i AbstractTexture : : DataHelper < 3 > : : imageSize ( AbstractTexture & texture , const GLint level ) {
Vector3i AbstractTexture : : DataHelper < 3 > : : imageSize ( AbstractTexture & texture , const GLint level ) {
const Implementation : : TextureState & state = * Context : : current ( ) - > state ( ) . texture ;
const Implementation : : TextureState & state = * Context : : current ( ) . state ( ) . texture ;
Vector3i value ;
Vector3i value ;
( texture . * state . getLevelParameterivImplementation ) ( level , GL_TEXTURE_WIDTH , & value [ 0 ] ) ;
( texture . * state . getLevelParameterivImplementation ) ( level , GL_TEXTURE_WIDTH , & value [ 0 ] ) ;
@ -1751,27 +1751,27 @@ Vector3i AbstractTexture::DataHelper<3>::imageSize(AbstractTexture& texture, con
# ifndef MAGNUM_TARGET_GLES
# ifndef MAGNUM_TARGET_GLES
void AbstractTexture : : DataHelper < 1 > : : setStorage ( AbstractTexture & texture , const GLsizei levels , const TextureFormat internalFormat , const Math : : Vector < 1 , GLsizei > & size ) {
void AbstractTexture : : DataHelper < 1 > : : setStorage ( AbstractTexture & texture , const GLsizei levels , const TextureFormat internalFormat , const Math : : Vector < 1 , GLsizei > & size ) {
( texture . * Context : : current ( ) - > state ( ) . texture - > storage1DImplementation ) ( levels , internalFormat , size ) ;
( texture . * Context : : current ( ) . state ( ) . texture - > storage1DImplementation ) ( levels , internalFormat , size ) ;
}
}
# endif
# endif
void AbstractTexture : : DataHelper < 2 > : : setStorage ( AbstractTexture & texture , const GLsizei levels , const TextureFormat internalFormat , const Vector2i & size ) {
void AbstractTexture : : DataHelper < 2 > : : setStorage ( AbstractTexture & texture , const GLsizei levels , const TextureFormat internalFormat , const Vector2i & size ) {
( texture . * Context : : current ( ) - > state ( ) . texture - > storage2DImplementation ) ( levels , internalFormat , size ) ;
( texture . * Context : : current ( ) . state ( ) . texture - > storage2DImplementation ) ( levels , internalFormat , size ) ;
}
}
# if !(defined(MAGNUM_TARGET_WEBGL) && defined(MAGNUM_TARGET_GLES2))
# if !(defined(MAGNUM_TARGET_WEBGL) && defined(MAGNUM_TARGET_GLES2))
void AbstractTexture : : DataHelper < 3 > : : setStorage ( AbstractTexture & texture , const GLsizei levels , const TextureFormat internalFormat , const Vector3i & size ) {
void AbstractTexture : : DataHelper < 3 > : : setStorage ( AbstractTexture & texture , const GLsizei levels , const TextureFormat internalFormat , const Vector3i & size ) {
( texture . * Context : : current ( ) - > state ( ) . texture - > storage3DImplementation ) ( levels , internalFormat , size ) ;
( texture . * Context : : current ( ) . state ( ) . texture - > storage3DImplementation ) ( levels , internalFormat , size ) ;
}
}
# endif
# endif
# if !defined(MAGNUM_TARGET_GLES2) && !defined(MAGNUM_TARGET_WEBGL)
# if !defined(MAGNUM_TARGET_GLES2) && !defined(MAGNUM_TARGET_WEBGL)
void AbstractTexture : : DataHelper < 2 > : : setStorageMultisample ( AbstractTexture & texture , const GLsizei samples , const TextureFormat internalFormat , const Vector2i & size , const GLboolean fixedSampleLocations ) {
void AbstractTexture : : DataHelper < 2 > : : setStorageMultisample ( AbstractTexture & texture , const GLsizei samples , const TextureFormat internalFormat , const Vector2i & size , const GLboolean fixedSampleLocations ) {
( texture . * Context : : current ( ) - > state ( ) . texture - > storage2DMultisampleImplementation ) ( samples , internalFormat , size , fixedSampleLocations ) ;
( texture . * Context : : current ( ) . state ( ) . texture - > storage2DMultisampleImplementation ) ( samples , internalFormat , size , fixedSampleLocations ) ;
}
}
void AbstractTexture : : DataHelper < 3 > : : setStorageMultisample ( AbstractTexture & texture , const GLsizei samples , const TextureFormat internalFormat , const Vector3i & size , const GLboolean fixedSampleLocations ) {
void AbstractTexture : : DataHelper < 3 > : : setStorageMultisample ( AbstractTexture & texture , const GLsizei samples , const TextureFormat internalFormat , const Vector3i & size , const GLboolean fixedSampleLocations ) {
( texture . * Context : : current ( ) - > state ( ) . texture - > storage3DMultisampleImplementation ) ( samples , internalFormat , size , fixedSampleLocations ) ;
( texture . * Context : : current ( ) . state ( ) . texture - > storage3DMultisampleImplementation ) ( samples , internalFormat , size , fixedSampleLocations ) ;
}
}
# endif
# endif
@ -1807,25 +1807,25 @@ void AbstractTexture::DataHelper<1>::setCompressedImage(AbstractTexture& texture
void AbstractTexture : : DataHelper < 1 > : : setSubImage ( AbstractTexture & texture , const GLint level , const Math : : Vector < 1 , GLint > & offset , const ImageView1D & image ) {
void AbstractTexture : : DataHelper < 1 > : : setSubImage ( AbstractTexture & texture , const GLint level , const Math : : Vector < 1 , GLint > & offset , const ImageView1D & image ) {
Buffer : : unbindInternal ( Buffer : : TargetHint : : PixelUnpack ) ;
Buffer : : unbindInternal ( Buffer : : TargetHint : : PixelUnpack ) ;
image . storage ( ) . applyUnpack ( ) ;
image . storage ( ) . applyUnpack ( ) ;
( texture . * Context : : current ( ) - > state ( ) . texture - > subImage1DImplementation ) ( level , offset , image . size ( ) , image . format ( ) , image . type ( ) , image . data ( ) ) ;
( texture . * Context : : current ( ) . state ( ) . texture - > subImage1DImplementation ) ( level , offset , image . size ( ) , image . format ( ) , image . type ( ) , image . data ( ) ) ;
}
}
void AbstractTexture : : DataHelper < 1 > : : setCompressedSubImage ( AbstractTexture & texture , const GLint level , const Math : : Vector < 1 , GLint > & offset , const CompressedImageView1D & image ) {
void AbstractTexture : : DataHelper < 1 > : : setCompressedSubImage ( AbstractTexture & texture , const GLint level , const Math : : Vector < 1 , GLint > & offset , const CompressedImageView1D & image ) {
Buffer : : unbindInternal ( Buffer : : TargetHint : : PixelUnpack ) ;
Buffer : : unbindInternal ( Buffer : : TargetHint : : PixelUnpack ) ;
image . storage ( ) . applyUnpack ( ) ;
image . storage ( ) . applyUnpack ( ) ;
( texture . * Context : : current ( ) - > state ( ) . texture - > compressedSubImage1DImplementation ) ( level , offset , image . size ( ) , image . format ( ) , image . data ( ) , Implementation : : occupiedCompressedImageDataSize ( image , image . data ( ) . size ( ) ) ) ;
( texture . * Context : : current ( ) . state ( ) . texture - > compressedSubImage1DImplementation ) ( level , offset , image . size ( ) , image . format ( ) , image . data ( ) , Implementation : : occupiedCompressedImageDataSize ( image , image . data ( ) . size ( ) ) ) ;
}
}
void AbstractTexture : : DataHelper < 1 > : : setSubImage ( AbstractTexture & texture , const GLint level , const Math : : Vector < 1 , GLint > & offset , BufferImage1D & image ) {
void AbstractTexture : : DataHelper < 1 > : : setSubImage ( AbstractTexture & texture , const GLint level , const Math : : Vector < 1 , GLint > & offset , BufferImage1D & image ) {
image . buffer ( ) . bindInternal ( Buffer : : TargetHint : : PixelUnpack ) ;
image . buffer ( ) . bindInternal ( Buffer : : TargetHint : : PixelUnpack ) ;
image . storage ( ) . applyUnpack ( ) ;
image . storage ( ) . applyUnpack ( ) ;
( texture . * Context : : current ( ) - > state ( ) . texture - > subImage1DImplementation ) ( level , offset , image . size ( ) , image . format ( ) , image . type ( ) , nullptr ) ;
( texture . * Context : : current ( ) . state ( ) . texture - > subImage1DImplementation ) ( level , offset , image . size ( ) , image . format ( ) , image . type ( ) , nullptr ) ;
}
}
void AbstractTexture : : DataHelper < 1 > : : setCompressedSubImage ( AbstractTexture & texture , const GLint level , const Math : : Vector < 1 , GLint > & offset , CompressedBufferImage1D & image ) {
void AbstractTexture : : DataHelper < 1 > : : setCompressedSubImage ( AbstractTexture & texture , const GLint level , const Math : : Vector < 1 , GLint > & offset , CompressedBufferImage1D & image ) {
image . buffer ( ) . bindInternal ( Buffer : : TargetHint : : PixelUnpack ) ;
image . buffer ( ) . bindInternal ( Buffer : : TargetHint : : PixelUnpack ) ;
image . storage ( ) . applyUnpack ( ) ;
image . storage ( ) . applyUnpack ( ) ;
( texture . * Context : : current ( ) - > state ( ) . texture - > compressedSubImage1DImplementation ) ( level , offset , image . size ( ) , image . format ( ) , nullptr , Implementation : : occupiedCompressedImageDataSize ( image , image . dataSize ( ) ) ) ;
( texture . * Context : : current ( ) . state ( ) . texture - > compressedSubImage1DImplementation ) ( level , offset , image . size ( ) , image . format ( ) , nullptr , Implementation : : occupiedCompressedImageDataSize ( image , image . dataSize ( ) ) ) ;
}
}
# endif
# endif
@ -1880,7 +1880,7 @@ void AbstractTexture::DataHelper<2>::setSubImage(AbstractTexture& texture, const
Buffer : : unbindInternal ( Buffer : : TargetHint : : PixelUnpack ) ;
Buffer : : unbindInternal ( Buffer : : TargetHint : : PixelUnpack ) ;
# endif
# endif
image . storage ( ) . applyUnpack ( ) ;
image . storage ( ) . applyUnpack ( ) ;
( texture . * Context : : current ( ) - > state ( ) . texture - > subImage2DImplementation ) ( level , offset , image . size ( ) , image . format ( ) , image . type ( ) , image . data ( )
( texture . * Context : : current ( ) . state ( ) . texture - > subImage2DImplementation ) ( level , offset , image . size ( ) , image . format ( ) , image . type ( ) , image . data ( )
# ifdef MAGNUM_TARGET_GLES2
# ifdef MAGNUM_TARGET_GLES2
+ Implementation : : pixelStorageSkipOffset ( image )
+ Implementation : : pixelStorageSkipOffset ( image )
# endif
# endif
@ -1896,14 +1896,14 @@ void AbstractTexture::DataHelper<2>::setCompressedSubImage(AbstractTexture& text
to reset anything */
to reset anything */
image . storage ( ) . applyUnpack ( ) ;
image . storage ( ) . applyUnpack ( ) ;
# endif
# endif
( texture . * Context : : current ( ) - > state ( ) . texture - > compressedSubImage2DImplementation ) ( level , offset , image . size ( ) , image . format ( ) , image . data ( ) , Implementation : : occupiedCompressedImageDataSize ( image , image . data ( ) . size ( ) ) ) ;
( texture . * Context : : current ( ) . state ( ) . texture - > compressedSubImage2DImplementation ) ( level , offset , image . size ( ) , image . format ( ) , image . data ( ) , Implementation : : occupiedCompressedImageDataSize ( image , image . data ( ) . size ( ) ) ) ;
}
}
# ifndef MAGNUM_TARGET_GLES2
# ifndef MAGNUM_TARGET_GLES2
void AbstractTexture : : DataHelper < 2 > : : setSubImage ( AbstractTexture & texture , const GLint level , const Vector2i & offset , BufferImage2D & image ) {
void AbstractTexture : : DataHelper < 2 > : : setSubImage ( AbstractTexture & texture , const GLint level , const Vector2i & offset , BufferImage2D & image ) {
image . buffer ( ) . bindInternal ( Buffer : : TargetHint : : PixelUnpack ) ;
image . buffer ( ) . bindInternal ( Buffer : : TargetHint : : PixelUnpack ) ;
image . storage ( ) . applyUnpack ( ) ;
image . storage ( ) . applyUnpack ( ) ;
( texture . * Context : : current ( ) - > state ( ) . texture - > subImage2DImplementation ) ( level , offset , image . size ( ) , image . format ( ) , image . type ( ) , nullptr ) ;
( texture . * Context : : current ( ) . state ( ) . texture - > subImage2DImplementation ) ( level , offset , image . size ( ) , image . format ( ) , image . type ( ) , nullptr ) ;
}
}
void AbstractTexture : : DataHelper < 2 > : : setCompressedSubImage ( AbstractTexture & texture , const GLint level , const Vector2i & offset , CompressedBufferImage2D & image ) {
void AbstractTexture : : DataHelper < 2 > : : setCompressedSubImage ( AbstractTexture & texture , const GLint level , const Vector2i & offset , CompressedBufferImage2D & image ) {
@ -1913,7 +1913,7 @@ void AbstractTexture::DataHelper<2>::setCompressedSubImage(AbstractTexture& text
to reset anything */
to reset anything */
image . storage ( ) . applyUnpack ( ) ;
image . storage ( ) . applyUnpack ( ) ;
# endif
# endif
( texture . * Context : : current ( ) - > state ( ) . texture - > compressedSubImage2DImplementation ) ( level , offset , image . size ( ) , image . format ( ) , nullptr , Implementation : : occupiedCompressedImageDataSize ( image , image . dataSize ( ) ) ) ;
( texture . * Context : : current ( ) . state ( ) . texture - > compressedSubImage2DImplementation ) ( level , offset , image . size ( ) , image . format ( ) , nullptr , Implementation : : occupiedCompressedImageDataSize ( image , image . dataSize ( ) ) ) ;
}
}
# endif
# endif
@ -1984,7 +1984,7 @@ void AbstractTexture::DataHelper<3>::setSubImage(AbstractTexture& texture, const
Buffer : : unbindInternal ( Buffer : : TargetHint : : PixelUnpack ) ;
Buffer : : unbindInternal ( Buffer : : TargetHint : : PixelUnpack ) ;
# endif
# endif
image . storage ( ) . applyUnpack ( ) ;
image . storage ( ) . applyUnpack ( ) ;
( texture . * Context : : current ( ) - > state ( ) . texture - > subImage3DImplementation ) ( level , offset , image . size ( ) , image . format ( ) , image . type ( ) , image . data ( )
( texture . * Context : : current ( ) . state ( ) . texture - > subImage3DImplementation ) ( level , offset , image . size ( ) , image . format ( ) , image . type ( ) , image . data ( )
# ifdef MAGNUM_TARGET_GLES2
# ifdef MAGNUM_TARGET_GLES2
+ Implementation : : pixelStorageSkipOffset ( image )
+ Implementation : : pixelStorageSkipOffset ( image )
# endif
# endif
@ -2000,7 +2000,7 @@ void AbstractTexture::DataHelper<3>::setCompressedSubImage(AbstractTexture& text
to reset anything */
to reset anything */
image . storage ( ) . applyUnpack ( ) ;
image . storage ( ) . applyUnpack ( ) ;
# endif
# endif
( texture . * Context : : current ( ) - > state ( ) . texture - > compressedSubImage3DImplementation ) ( level , offset , image . size ( ) , image . format ( ) , image . data ( ) , Implementation : : occupiedCompressedImageDataSize ( image , image . data ( ) . size ( ) ) ) ;
( texture . * Context : : current ( ) . state ( ) . texture - > compressedSubImage3DImplementation ) ( level , offset , image . size ( ) , image . format ( ) , image . data ( ) , Implementation : : occupiedCompressedImageDataSize ( image , image . data ( ) . size ( ) ) ) ;
}
}
# endif
# endif
@ -2008,7 +2008,7 @@ void AbstractTexture::DataHelper<3>::setCompressedSubImage(AbstractTexture& text
void AbstractTexture : : DataHelper < 3 > : : setSubImage ( AbstractTexture & texture , const GLint level , const Vector3i & offset , BufferImage3D & image ) {
void AbstractTexture : : DataHelper < 3 > : : setSubImage ( AbstractTexture & texture , const GLint level , const Vector3i & offset , BufferImage3D & image ) {
image . buffer ( ) . bindInternal ( Buffer : : TargetHint : : PixelUnpack ) ;
image . buffer ( ) . bindInternal ( Buffer : : TargetHint : : PixelUnpack ) ;
image . storage ( ) . applyUnpack ( ) ;
image . storage ( ) . applyUnpack ( ) ;
( texture . * Context : : current ( ) - > state ( ) . texture - > subImage3DImplementation ) ( level , offset , image . size ( ) , image . format ( ) , image . type ( ) , nullptr ) ;
( texture . * Context : : current ( ) . state ( ) . texture - > subImage3DImplementation ) ( level , offset , image . size ( ) , image . format ( ) , image . type ( ) , nullptr ) ;
}
}
void AbstractTexture : : DataHelper < 3 > : : setCompressedSubImage ( AbstractTexture & texture , const GLint level , const Vector3i & offset , CompressedBufferImage3D & image ) {
void AbstractTexture : : DataHelper < 3 > : : setCompressedSubImage ( AbstractTexture & texture , const GLint level , const Vector3i & offset , CompressedBufferImage3D & image ) {
@ -2018,32 +2018,32 @@ void AbstractTexture::DataHelper<3>::setCompressedSubImage(AbstractTexture& text
to reset anything */
to reset anything */
image . storage ( ) . applyUnpack ( ) ;
image . storage ( ) . applyUnpack ( ) ;
# endif
# endif
( texture . * Context : : current ( ) - > state ( ) . texture - > compressedSubImage3DImplementation ) ( level , offset , image . size ( ) , image . format ( ) , nullptr , Implementation : : occupiedCompressedImageDataSize ( image , image . dataSize ( ) ) ) ;
( texture . * Context : : current ( ) . state ( ) . texture - > compressedSubImage3DImplementation ) ( level , offset , image . size ( ) , image . format ( ) , nullptr , Implementation : : occupiedCompressedImageDataSize ( image , image . dataSize ( ) ) ) ;
}
}
# endif
# endif
# ifndef MAGNUM_TARGET_GLES
# ifndef MAGNUM_TARGET_GLES
void AbstractTexture : : DataHelper < 1 > : : invalidateSubImage ( AbstractTexture & texture , const GLint level , const Math : : Vector < 1 , GLint > & offset , const Math : : Vector < 1 , GLint > & size ) {
void AbstractTexture : : DataHelper < 1 > : : invalidateSubImage ( AbstractTexture & texture , const GLint level , const Math : : Vector < 1 , GLint > & offset , const Math : : Vector < 1 , GLint > & size ) {
( texture . * Context : : current ( ) - > state ( ) . texture - > invalidateSubImageImplementation ) ( level , { offset [ 0 ] , 0 , 0 } , { size [ 0 ] , 1 , 1 } ) ;
( texture . * Context : : current ( ) . state ( ) . texture - > invalidateSubImageImplementation ) ( level , { offset [ 0 ] , 0 , 0 } , { size [ 0 ] , 1 , 1 } ) ;
}
}
# endif
# endif
void AbstractTexture : : DataHelper < 2 > : : invalidateSubImage ( AbstractTexture & texture , const GLint level , const Vector2i & offset , const Vector2i & size ) {
void AbstractTexture : : DataHelper < 2 > : : invalidateSubImage ( AbstractTexture & texture , const GLint level , const Vector2i & offset , const Vector2i & size ) {
( texture . * Context : : current ( ) - > state ( ) . texture - > invalidateSubImageImplementation ) ( level , { offset , 0 } , { size , 1 } ) ;
( texture . * Context : : current ( ) . state ( ) . texture - > invalidateSubImageImplementation ) ( level , { offset , 0 } , { size , 1 } ) ;
}
}
void AbstractTexture : : DataHelper < 3 > : : invalidateSubImage ( AbstractTexture & texture , const GLint level , const Vector3i & offset , const Vector3i & size ) {
void AbstractTexture : : DataHelper < 3 > : : invalidateSubImage ( AbstractTexture & texture , const GLint level , const Vector3i & offset , const Vector3i & size ) {
( texture . * Context : : current ( ) - > state ( ) . texture - > invalidateSubImageImplementation ) ( level , offset , size ) ;
( texture . * Context : : current ( ) . state ( ) . texture - > invalidateSubImageImplementation ) ( level , offset , size ) ;
}
}
# ifndef MAGNUM_TARGET_GLES
# ifndef MAGNUM_TARGET_GLES
void AbstractTexture : : DataHelper < 1 > : : setWrapping ( AbstractTexture & texture , const Array1D < Sampler : : Wrapping > & wrapping ) {
void AbstractTexture : : DataHelper < 1 > : : setWrapping ( AbstractTexture & texture , const Array1D < Sampler : : Wrapping > & wrapping ) {
( texture . * Context : : current ( ) - > state ( ) . texture - > parameteriImplementation ) ( GL_TEXTURE_WRAP_S , GLint ( wrapping . x ( ) ) ) ;
( texture . * Context : : current ( ) . state ( ) . texture - > parameteriImplementation ) ( GL_TEXTURE_WRAP_S , GLint ( wrapping . x ( ) ) ) ;
}
}
# endif
# endif
void AbstractTexture : : DataHelper < 2 > : : setWrapping ( AbstractTexture & texture , const Array2D < Sampler : : Wrapping > & wrapping ) {
void AbstractTexture : : DataHelper < 2 > : : setWrapping ( AbstractTexture & texture , const Array2D < Sampler : : Wrapping > & wrapping ) {
const Implementation : : TextureState & state = * Context : : current ( ) - > state ( ) . texture ;
const Implementation : : TextureState & state = * Context : : current ( ) . state ( ) . texture ;
( texture . * state . parameteriImplementation ) ( GL_TEXTURE_WRAP_S , GLint ( wrapping . x ( ) ) ) ;
( texture . * state . parameteriImplementation ) ( GL_TEXTURE_WRAP_S , GLint ( wrapping . x ( ) ) ) ;
( texture . * state . parameteriImplementation ) ( GL_TEXTURE_WRAP_T , GLint ( wrapping . y ( ) ) ) ;
( texture . * state . parameteriImplementation ) ( GL_TEXTURE_WRAP_T , GLint ( wrapping . y ( ) ) ) ;
@ -2051,7 +2051,7 @@ void AbstractTexture::DataHelper<2>::setWrapping(AbstractTexture& texture, const
# if !(defined(MAGNUM_TARGET_WEBGL) && defined(MAGNUM_TARGET_GLES2))
# if !(defined(MAGNUM_TARGET_WEBGL) && defined(MAGNUM_TARGET_GLES2))
void AbstractTexture : : DataHelper < 3 > : : setWrapping ( AbstractTexture & texture , const Array3D < Sampler : : Wrapping > & wrapping ) {
void AbstractTexture : : DataHelper < 3 > : : setWrapping ( AbstractTexture & texture , const Array3D < Sampler : : Wrapping > & wrapping ) {
const Implementation : : TextureState & state = * Context : : current ( ) - > state ( ) . texture ;
const Implementation : : TextureState & state = * Context : : current ( ) . state ( ) . texture ;
( texture . * state . parameteriImplementation ) ( GL_TEXTURE_WRAP_S , GLint ( wrapping . x ( ) ) ) ;
( texture . * state . parameteriImplementation ) ( GL_TEXTURE_WRAP_S , GLint ( wrapping . x ( ) ) ) ;
( texture . * state . parameteriImplementation ) ( GL_TEXTURE_WRAP_T , GLint ( wrapping . y ( ) ) ) ;
( texture . * state . parameteriImplementation ) ( GL_TEXTURE_WRAP_T , GLint ( wrapping . y ( ) ) ) ;