Browse Source

Support for ARB_texture_stencil8.

pull/278/head
Vladimír Vondruš 13 years ago
parent
commit
9f61c08e97
  1. 10
      src/AbstractTexture.cpp
  2. 7
      src/ImageFormat.h
  3. 9
      src/TextureFormat.h

10
src/AbstractTexture.cpp

@ -423,6 +423,11 @@ ImageFormat AbstractTexture::imageFormatForInternalFormat(const TextureFormat in
#endif
return ImageFormat::DepthComponent;
#ifndef MAGNUM_TARGET_GLES
case TextureFormat::StencilIndex8:
return ImageFormat::StencilIndex;
#endif
case TextureFormat::DepthStencil:
case TextureFormat::Depth24Stencil8:
#ifndef MAGNUM_TARGET_GLES2
@ -605,6 +610,11 @@ ImageType AbstractTexture::imageTypeForInternalFormat(const TextureFormat intern
return ImageType::Float;
#endif
#ifndef MAGNUM_TARGET_GLES
case TextureFormat::StencilIndex8:
return ImageType::UnsignedByte;
#endif
case TextureFormat::DepthStencil:
case TextureFormat::Depth24Stencil8:
return ImageType::UnsignedInt248;

7
src/ImageFormat.h

@ -223,8 +223,11 @@ enum class ImageFormat: GLenum {
#ifndef MAGNUM_TARGET_GLES3
/**
* Stencil index. For framebuffer reading only.
* @requires_es_extension %Extension @es_extension2{NV,read_stencil,GL_NV_read_depth_stencil}
* Stencil index.
* @requires_gl44 %Extension @extension{ARB,texture_stencil8} for texture
* data, otherwise for framebuffer reading only.
* @requires_es_extension %Extension @es_extension2{NV,read_stencil,GL_NV_read_depth_stencil},
* for framebuffer reading only.
* @todo Where to get GL_STENCIL_INDEX in ES?
*/
#ifndef MAGNUM_TARGET_GLES

9
src/TextureFormat.h

@ -809,6 +809,15 @@ enum class TextureFormat: GLenum {
DepthComponent32F = GL_DEPTH_COMPONENT32F,
#endif
#ifndef MAGNUM_TARGET_GLES
/**
* Stencil index, 8bit.
* @requires_gl44 %Extension @extension{ARB,texture_stencil8}
* @requires_gl Only available as renderbuffer format in OpenGL ES.
*/
StencilIndex8 = GL_STENCIL_INDEX8,
#endif
/**
* Depth and stencil component, size implementation-dependent.
* @deprecated Prefer to use exactly specified version of this format, e.g.

Loading…
Cancel
Save