Browse Source

Support for ES2 extension NV_texture_border_clamp.

pull/278/head
Vladimír Vondruš 13 years ago
parent
commit
b9cee8e014
  1. 17
      src/AbstractTexture.h
  2. 1
      src/Context.cpp
  3. 1
      src/Extensions.h

17
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

1
src/Context.cpp

@ -212,6 +212,7 @@ const std::vector<Extension>& 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),

1
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

Loading…
Cancel
Save