diff --git a/src/AbstractTexture.h b/src/AbstractTexture.h index c20a4fc99..da7c8d3eb 100644 --- a/src/AbstractTexture.h +++ b/src/AbstractTexture.h @@ -150,16 +150,17 @@ class MAGNUM_EXPORT AbstractTexture { * Clamp to edge. Coordinates out of the range will be clamped to * first / last column / row in given direction. */ - ClampToEdge = GL_CLAMP_TO_EDGE + ClampToEdge = GL_CLAMP_TO_EDGE, - #ifndef MAGNUM_TARGET_GLES - , /** * Clamp to border color. Coordinates out of range will be clamped * to border color (set with setBorderColor()). - * @requires_gl Texture border is not available in OpenGL ES. + * @requires_es_extension %Extension @es_extension{NV,texture_border_clamp} */ + #ifndef MAGNUM_TARGET_GLES ClampToBorder = GL_CLAMP_TO_BORDER + #else + ClampToBorder = GL_CLAMP_TO_BORDER_NV #endif }; @@ -1074,7 +1075,6 @@ class MAGNUM_EXPORT AbstractTexture { return this; } - #ifndef MAGNUM_TARGET_GLES /** * @brief Set border color * @return Pointer to self (for method chaining) @@ -1086,13 +1086,16 @@ class MAGNUM_EXPORT AbstractTexture { * @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_gl Texture border is not available in OpenGL ES. + * @requires_es_extension %Extension @es_extension{NV,texture_border_clamp} */ inline AbstractTexture* setBorderColor(const Color4<>& color) { + #ifndef MAGNUM_TARGET_GLES (this->*parameterfvImplementation)(GL_TEXTURE_BORDER_COLOR, color.data()); + #else + (this->*parameterfvImplementation)(GL_TEXTURE_BORDER_COLOR_NV, color.data()); + #endif return this; } - #endif /** * @brief Set max anisotropy diff --git a/src/Context.cpp b/src/Context.cpp index 62201b919..4d0ed0e7c 100644 --- a/src/Context.cpp +++ b/src/Context.cpp @@ -212,6 +212,7 @@ const std::vector& Extension::extensions(Version version) { _extension(GL,EXT,sRGB), _extension(GL,NV,read_buffer_front), _extension(GL,NV,read_stencil), + _extension(GL,NV,texture_border_clamp), // done _extension(GL,OES,depth32), _extension(GL,OES,mapbuffer), _extension(GL,OES,stencil1), diff --git a/src/Extensions.h b/src/Extensions.h index 1f3480957..d1fdf312b 100644 --- a/src/Extensions.h +++ b/src/Extensions.h @@ -211,6 +211,7 @@ namespace GL { _extension(GL,NV,read_stencil, GLES200, None) // #94 _extension(GL,NV,read_depth_stencil, GLES200, GLES300) // #94 _extension(GL,NV,framebuffer_blit, GLES200, GLES300) // #142 + _extension(GL,NV,texture_border_clamp, GLES200, None) // #149 } namespace OES { _extension(GL,OES,depth24, GLES200, GLES300) // #24 _extension(GL,OES,depth32, GLES200, None) // #25