#include
<oglplus/texture.hpp>
template <> struct ObjectSubtype<tag::Texture> { typedef TextureTarget Type; };
template <> class ObjCommonOps<tag::Texture> : public TextureName { public: typedef TextureTarget Target;static TextureName Binding(TextureTarget target);
static void Bind(TextureTarget target, TextureName texture);
void Bind(TextureTarget target) const;
#if GL_VERSION_4_2 ||GL_ARB_shader_image_load_store static void BindImage( ImageUnitSelector unit, TextureName texture, GLint level, Boolean layered, GLint layer, AccessSpecifier access, ImageUnitFormat format );
#endif #if GL_VERSION_4_4 || GL_ARB_multi_bind static void Bind( GLuint first, const Sequence<TextureName>& textures );
static void BindImage( GLuint first, const Sequence<TextureName>& textures );
#endif static void Active(TextureUnitSelector index);
static GLint Active(void);
static TextureTarget CubeMapFace(GLuint face);
#if GL_VERSION_4_3 void InvalidateImage(SizeType level);
void InvalidateSubImage( SizeType level, GLint xoffs, GLint yoffs, GLint zoffs, SizeType width, SizeType height, SizeType depth );
#endif #if GL_VERSION_4_4 template <typename GLtype> void ClearImage( SizeType level, PixelDataFormat format, const GLtype* data );
template <typename GLtype> void ClearSubImage( SizeType level, GLint xoffs, GLint yoffs, GLint zoffs, SizeType width, SizeType height, SizeType depth, PixelDataFormat format, const GLtype* data );
#endif #if GL_VERSION_4_3 || GL_ARB_texture_view void View( TextureTarget target, TextureName orig_texture, PixelDataInternalFormat internal_format, GLuint min_level, GLuint num_levels, GLuint min_layer, GLuint num_layers );
#endif };
Texture bind target. |
|
Returns the texture currently bound to the specified |
|
Binds the specified |
|
Binds |
|
Binds a |
|
Sequentially binds |
|
Sequentially binds |
|
Specifies active texture unit for subsequent commands. See |
|
Returns the currently active texture unit. See |
|
Returns one of the values for cube map faces from the TextureTarget
enumeration. The value of
|
|
Invalidates the specified |
|
Invalidates the specified part of texture image. See |
|
Clears the specified |
|
Clears the specified part of texture image. See |
|
References and reinteprets a subset of the data of another texture.
See |
template <> class ObjectOps<tag::ExplicitSel, tag::Texture> : public ObjZeroOps<tag::ExplicitSel, tag::Texture>{ public: struct Property { typedef TextureCompareMode CompareMode; typedef TextureFilter Filter; typedef TextureMagFilter MagFilter; typedef TextureMinFilter MinFilter; typedef TextureSwizzleCoord SwizzleCoord; typedef TextureSwizzle Swizzle; #if GL_VERSION_3_3 || GL_ARB_texture_swizzle typedef TextureSwizzleTuple SwizzleTuple; #endif typedef TextureWrapCoord WrapCoord; typedef TextureWrap Wrap; typedef OneOf< DataType, PixelDataType > PixDataType; }; #if GL_VERSION_3_0 static SizeType Width(TextureTarget target, GLint level = 0);
static SizeType Height(TextureTarget target, GLint level = 0);
static SizeType Depth(TextureTarget target, GLint level = 0);
static PixelDataType RedType(TextureTarget target, GLint level = 0);
static PixelDataType GreenType(TextureTarget target, GLint level = 0);
static PixelDataType BlueType(TextureTarget target, GLint level = 0);
static PixelDataType AlphaType(TextureTarget target, GLint level = 0);
static PixelDataType DepthType(TextureTarget target, GLint level = 0);
static SizeType RedSize(TextureTarget target, GLint level = 0);
static SizeType GreenSize(TextureTarget target, GLint level = 0);
static SizeType BlueSize(TextureTarget target, GLint level = 0);
static SizeType AlphaSize(TextureTarget target, GLint level = 0);
static SizeType DepthSize(TextureTarget target, GLint level = 0);
static SizeType StencilSize(TextureTarget target, GLint level = 0);
static SizeType SharedSize(TextureTarget target, GLint level = 0); (16)
Indirectly inherits from ObjCommonOps<tag::Texture>. |
|
Returns the width of the texture image on the specified |
|
Returns the height of the texture image on the specified |
|
Returns the depth of the texture image on the specified |
|
Returns the data type used to store the RED component. See |
|
Returns the data type used to store the GREEN component. See |
|
Returns the data type used to store the BLUE component. See |
|
Returns the data type used to store the ALPHA component. See |
|
Returns the data type used to store the DEPTH component. See |
|
Returns the actual resolution of the RED component. See |
|
Returns the actual resolution of the GREEN component. See |
|
Returns the actual resolution of the BLUE component. See |
|
Returns the actual resolution of the ALPHA component. See |
|
Returns the actual resolution of the DEPTH component. See |
|
Returns the actual resolution of the STENCIL component. See |
|
Returns the actual resolution of all texture components. See |
static SizeType CompressedImageSize(TextureTarget target, GLint level = 0);static PixelDataInternalFormat InternalFormat(TextureTarget target, GLint level = 0);
static void GetImage( TextureTarget target, GLint level, PixelDataFormat format, const OutputData& dest );
static void GetImage( TextureTarget target, GLint level, PixelDataFormat format, Property::PixDataType type, SizeType size, GLvoid* buffer ); static void GetCompressedImage( TextureTarget target, GLint level, const OutputData& dest );
static void GetCompressedImage( TextureTarget target, GLint level, std::vector<GLubyte>& dest ); static void GetCompressedImage( TextureTarget target, GLint level, SizeType size, GLubyte* buffer ); #endif static void Image3D( TextureTarget target, GLint level, PixelDataInternalFormat internal_format, SizeType width, SizeType height, SizeType depth, GLint border, PixelDataFormat format, Property::PixDataType type, const void* data );
static void Image3D( TextureTarget target, const images::Image& image, GLint level = 0, GLint border = 0 ); static void SubImage3D( TextureTarget target, GLint level, GLint xoffs, GLint yoffs, GLint zoffs, SizeType width, SizeType height, SizeType depth, PixelDataFormat format, Property::PixDataType type, const void* data );
static void SubImage3D( TextureTarget target, const images::Image& image, GLint xoffs, GLint yoffs, GLint zoffs, GLint level = 0 ); static void Image2D( TextureTarget target, GLint level, PixelDataInternalFormat internal_format, SizeType width, SizeType height, GLint border, PixelDataFormat format, Property::PixDataType type, const void* data );
static void Image2D( TextureTarget target, const images::Image& image, GLint level = 0, GLint border = 0 ); static void ImageCM( GLuint face, GLint level, PixelDataInternalFormat internal_format, SizeType width, SizeType height, GLint border, PixelDataFormat format, Property::PixDataType type, const void* data );
static void ImageCM( GLuint face, const images::Image& image, GLint level = 0, GLint border = 0 ); static void SubImage2D( TextureTarget target, GLint level, GLint xoffs, GLint yoffs, SizeType width, SizeType height, PixelDataFormat format, Property::PixDataType type, const void* data );
static void SubImage2D( TextureTarget target, const images::Image& image, GLint xoffs, GLint yoffs, GLint level = 0 ); #if GL_VERSION_3_0 static void Image1D( TextureTarget target, GLint level, PixelDataInternalFormat internal_format, SizeType width, GLint border, PixelDataFormat format, Property::PixDataType type, const void* data );
static void Image1D( TextureTarget target, const images::Image& image, GLint level = 0, GLint border = 0 ); static void SubImage1D( TextureTarget target, GLint level, GLint xoffs, SizeType width, PixelDataFormat format, Property::PixDataType type, const void* data );
static void SubImage1D( TextureTarget target, const images::Image& image, GLint xoffs, GLint level = 0 ); #endif static void Image( TextureTarget target, const images::Image& image, GLint level = 0, GLint border = 0 );
static void Image( TextureTarget target, const images::ImageSpec& image_spec, GLint level = 0, GLint border = 0 );
Returns the size (in bytes) of the image array if it is compressed.
See |
||||
Returns the internal data format of the image array. See |
||||
Stores the image of the texture bound to the specified texture
|
||||
Stores the image of the texture bound to the specified texture |
||||
Specifies a three dimensional texture image. See |
||||
Specifies a three dimensional texture subimage. See |
||||
Specifies a two dimensional texture image. See |
||||
Specifies the image of the selected cube-map face. See |
||||
Specifies a two dimensional texture subimage. See |
||||
Specifies a one dimensional texture image. See |
||||
Specifies a one dimensional texture subimage. See |
||||
Specifies one, two or three dimensional texture image. |
static void CopyImage2D( TextureTarget target, GLint level, PixelDataInternalFormat internal_format, GLint x, GLint y, SizeType width, SizeType height, GLint border );#if GL_VERSION_3_0 static void CopyImage1D( TextureTarget target, GLint level, PixelDataInternalFormat internal_format, GLint x, GLint y, SizeType width, GLint border );
#endif static void CopySubImage3D( TextureTarget target, GLint level, GLint xoffs, GLint yoffs, GLint zoffs, GLint x, GLint y, SizeType width, SizeType height );
static void CopySubImage2D( TextureTarget target, GLint level, GLint xoffs, GLint yoffs, GLint x, GLint y, SizeType width, SizeType height );
#if GL_VERSION_3_0 static void CopySubImage1D( TextureTarget target, GLint level, GLint xoffs, GLint x, GLint y, SizeType width );
#endif static void CompressedImage3D( TextureTarget target, GLint level, PixelDataInternalFormat internal_format, SizeType width, SizeType height, SizeType depth, GLint border, SizeType image_size, const void* data );
static void CompressedImage2D( TextureTarget target, GLint level, PixelDataInternalFormat internal_format, SizeType width, SizeType height, GLint border, SizeType image_size, const void* data );
#if GL_VERSION_3_0 static void CompressedImage1D( TextureTarget target, GLint level, PixelDataInternalFormat internal_format, SizeType width, GLint border, SizeType image_size, const void* data );
#endif static void CompressedSubImage3D( TextureTarget target, GLint level, GLint xoffs, GLint yoffs, GLint zoffs, SizeType width, SizeType height, SizeType depth, PixelDataFormat format, SizeType image_size, const void* data );
static void CompressedSubImage2D( TextureTarget target, GLint level, GLint xoffs, GLint yoffs, SizeType width, SizeType height, PixelDataFormat format, SizeType image_size, const void* data );
#if GL_VERSION_3_0 static void CompressedSubImage1D( TextureTarget target, GLint level, GLint xoffs, SizeType width, PixelDataFormat format, SizeType image_size, const void* data );
#endif
Copies a two dimensional texture image from the current framebuffer.
See |
|
Copies a one dimensional texture image from the current framebuffer.
See |
|
Copies a three dimensional texture subimage from the current framebuffer.
See |
|
Copies a two dimensional texture subimage from the current framebuffer.
See |
|
Copies a one dimensional texture subimage from the current framebuffer.
See |
|
Specifies a three dimensional compressed texture image. See |
|
Specifies a two dimensional compressed texture image. See |
|
Specifies a one dimensional compressed texture image. See |
|
Specifies a three dimensional compressed texture subimage. See |
|
Specifies a two dimensional compressed texture subimage. See |
|
Specifies a one dimensional compressed texture subimage. See |
#if GL_VERSION_3_2 || GL_ARB_texture_multisample static void Image3DMultisample( TextureTarget target, SizeType samples, PixelDataInternalFormat internal_format, SizeType width, SizeType height, SizeType depth, Boolean fixed_sample_locations );static void Image2DMultisample( TextureTarget target, SizeType samples, PixelDataInternalFormat internal_format, SizeType width, SizeType height, Boolean fixed_sample_locations );
#endif #if GL_VERSION_3_1 static void Buffer( TextureTarget target, PixelDataInternalFormat internal_format, BufferName buffer );
#endif #if GL_VERSION_4_3 static void BufferRange( TextureTarget target, PixelDataInternalFormat internal_format, BufferName buffer, GLintptr offset, BigSizeType size );
#endif #if GL_VERSION_4_2 || GL_ARB_texture_storage static void Storage3D( TextureTarget target, SizeType levels, PixelDataInternalFormat internal_format, SizeType width, SizeType height, SizeType depth );
static void Storage2D( TextureTarget target, SizeType levels, PixelDataInternalFormat internal_format, SizeType width, SizeType height );
static void Storage1D( TextureTarget target, SizeType levels, PixelDataInternalFormat internal_format, SizeType width );
#endif static GLuint BaseLevel(TextureTarget target);
static void BaseLevel(TextureTarget target, GLuint level);
#if GL_VERSION_3_0 static Vector<GLfloat, 4> BorderColor( TextureTarget target, TypeTag<GLfloat> );
static Vector<GLint, 4> BorderColor( TextureTarget target, TypeTag<GLint> ); static Vector<GLuint, 4> BorderColor( TextureTarget target, TypeTag<GLuint> ); static void BorderColor( TextureTarget target, Vector<GLfloat, 4> color );
static void BorderColor( TextureTarget target, Vector<GLint, 4> color ); static void BorderColor( TextureTarget target, Vector<GLuint, 4> color ); #endif static TextureCompareMode CompareMode(TextureTarget target);
static void CompareMode( TextureTarget target, TextureCompareMode mode );
static CompareFunction CompareFunc(TextureTarget target);
static void CompareFunc( TextureTarget target, CompareFunction func );
![]()
Sets-up a three dimensional multisample texture. See |
|
Sets-up a two dimensional multisample texture. See |
|
Assigns a buffer storing the texel data to the texture. See |
|
Assigns a buffer range storing the texel data to the texture. See
|
|
Specifies all levels of 3D texture at the same time. See |
|
Specifies all levels of 2D texture at the same time. See |
|
Specifies all levels of 1D texture at the same time. See |
|
Returns the texture base level. See |
|
Sets the texture base level. See |
|
Gets the texture border color. See |
|
Sets the texture border color. See |
|
Gets the texture compare mode. See |
|
Sets the texture compare mode. See |
|
Gets the texture compare function. See |
|
Sets the texture compare function. See |
#if GL_VERSION_3_0 static GLfloat LODBias(TextureTarget target);static void LODBias(TextureTarget target, GLfloat value);
#endif // GL_VERSION_3_0 static void Filter( TextureTarget target, TextureFilter filter );
static TextureMagFilter MagFilter(TextureTarget target);
static void MagFilter( TextureTarget target, TextureMagFilter filter );
static TextureMinFilter MinFilter(TextureTarget target);
static void MinFilter( TextureTarget target, TextureMinFilter filter );
static GLfloat MinLOD(TextureTarget target);
static void MinLOD(TextureTarget target, GLfloat value);
static GLfloat MaxLOD(TextureTarget target);
static void MaxLOD(TextureTarget target, GLfloat value);
static GLint MaxLevel(TextureTarget target);
static void MaxLevel(TextureTarget target, GLint value);
![]()
Gets the level-of-detail bias value. See |
|
Sets the level-of-detail bias value. See |
|
Sets both the minification and magnification filter. See |
|
Gets the magnification filter. See |
|
Sets the magnification filter. See |
|
Gets the minification filter. See |
|
Sets the minification filter. See |
|
Gets minimal level-of-detail value. See |
|
Sets minimal level-of-detail value. See |
|
Gets maximal level-of-detail value. See |
|
Sets maximal level-of-detail value. See |
|
Gets the maximum level value. See |
|
Sets the maximum level value. See |
static GLfloat MaxAnisotropy(TextureTarget target);static GLfloat Anisotropy(TextureTarget target);
static void Anisotropy(TextureTarget target, GLfloat value);
#if GL_VERSION_3_3 || GL_ARB_texture_swizzle static TextureSwizzle Swizzle( TextureTarget target, TextureSwizzleCoord coord );
static TextureSwizzle SwizzleR(TextureTarget target); static TextureSwizzle SwizzleG(TextureTarget target); static TextureSwizzle SwizzleB(TextureTarget target); static TextureSwizzle SwizzleA(TextureTarget target); static TextureSwizzleTuple SwizzleRGBA(TextureTarget target); static void Swizzle( TextureTarget target, TextureSwizzleCoord coord, TextureSwizzle mode );
static void SwizzleR(TextureTarget target, TextureSwizzle mode); static void SwizzleG(TextureTarget target, TextureSwizzle mode); static void SwizzleB(TextureTarget target, TextureSwizzle mode); static void SwizzleA(TextureTarget target, TextureSwizzle mode); static void SwizzleRGBA( TextureTarget target, TextureSwizzle mode ); static void SwizzleRGBA( TextureTarget target, TextureSwizzle mode_r, TextureSwizzle mode_g, TextureSwizzle mode_b, TextureSwizzle mode_a ); static void SwizzleRGBA( TextureTarget target, const TextureSwizzleTuple& modes ); #endif static TextureWrap Wrap( TextureTarget target, TextureWrapCoord coord );
static TextureWrap WrapS(TextureTarget target); static TextureWrap WrapT(TextureTarget target); static TextureWrap WrapR(TextureTarget target); static void Wrap( TextureTarget target, TextureWrapCoord coord, TextureWrap mode );
static void WrapS(TextureTarget target, TextureWrap mode); static void WrapT(TextureTarget target, TextureWrap mode); static void WrapR(TextureTarget target, TextureWrap mode); static void Wrap(TextureTarget target, TextureWrap mode);
#if GL_VERSION_4_3 static PixelDataFormat DepthStencilMode(TextureTarget target);
static void DepthStencilMode( TextureTarget target, PixelDataFormat mode );
#endif #if GL_ARB_seamless_cubemap_per_texture static Boolean Seamless(TextureTarget target);
static void Seamless(TextureTarget target, Boolean enable);
#endif #if GL_VERSION_4_5 || GL_ARB_texture_barrier || GL_NV_texture_barrier static void Barrier(void);
#endif static void GenerateMipmap(TextureTarget target)
};
Gets the maximum anisotropy value. See |
|
Gets the current anisotropy level. See |
|
Sets the anisotropy level. See |
|
Gets the swizzle parameter. See |
|
Sets the swizzle parameter. See |
|
Gets the texture wrap parameter. See |
|
Sets the texture wrap |
|
Sets the texture wrap |
|
Gets the depth stencil mode parameter. See |
|
Sets the depth stencil mode parameter. See |
|
Gets the seamless cubemap setting value. See |
|
Changes the seamless cubemap setting value. See |
|
Ensures that texture writes have been completed. See |
|
Generates mipmap for the texture bound to the specified target. See
|
typedef ObjectOps<tag::ExplicitSel, tag::Texture> TextureOps; typedef Object<TextureOps> Texture; typedef ObjectZero<ObjZeroOps<tag::ExplicitSel, tag::Texture>>DefaultTexture;
Indirectly inherits from ObjCommonOps<tag::Texture>. |
struct TextureTargetAndSlot { };TextureTargetAndSlot operator | ( TextureTarget target, GLuint slot ); struct TextureUnitAndTarget { };
TextureUnitAndTarget operator | ( TextureUnitSelector unit, TextureTarget tex ); TextureTarget operator << ( const TextureOps& tex, TextureTarget target );
TextureTarget operator << ( TextureTarget target, TextureFilter filter );
TextureTarget operator << ( TextureTarget target, TextureMinFilter filter );
TextureTarget operator << ( TextureTarget target, TextureMagFilter filter );
TextureTarget operator << ( TextureTarget target, TextureCompareMode mode );
TextureTarget operator << ( TextureTarget target, CompareFunction func );
![]()
Helper class used with syntax-sugar operators. Stores a texture target and an integer slot number. Depending on the context the slot may be interpreted as the swizzle or wrap coordinate or image level number. |
|
Helper class used with syntax-sugar operators. Stores a texture unit number and a texture target. |
|
Binds a texture object to the specified |
|
Sets texture minification and magnification filter on the texture currently
bound to |
|
Sets a texture minification filter on the texture currently bound to
|
|
Sets a texture magification filter on the texture currently bound to
|
|
Sets a texture compare mode on the texture currently bound to |
|
Sets a texture compare function on the texture currently bound to
|
TextureTarget operator << ( TextureTarget target, TextureWrap wrap );TextureTargetAndSlot operator << ( TextureTargetAndSlot tas, TextureWrap wrap );
#if GL_VERSION_3_3 || GL_ARB_texture_swizzle TextureTarget operator << ( TextureTarget target, TextureSwizzle swizzle );
TextureTargetAndSlot operator << ( TextureTargetAndSlot tas, TextureSwizzle swizzle );
#endif #if GL_VERSION_3_0 template <typename T> TextureTarget operator << ( TextureTarget target, const Vector<T, 4>& col );
#endif TextureTarget operator << ( TextureTarget target, const images::Image& image );
TextureTarget operator << ( TextureTarget target, const images::ImageSpec& image_spec ); TextureTarget operator << ( TextureTargetAndSlot tas, const images::Image& image );
TextureTarget operator << ( TextureTargetAndSlot tas, const images::ImageSpec& image_spec ); struct TextureMipmap { };
TextureTarget operator << ( TextureTarget target, TextureMipmap );
![]()
Sets a texture wrap mode on the texture currently bound to |
|
Sets a texture wrap mode on the texture currently bound to target on
the dimension specified by the slot number in |
|
Sets a texture swizzle mode on the texture currently bound to |
|
Sets a texture swizzle mode on the texture currently bound to target
on the dimension specified by the slot number in |
|
Sets a texture border color on the texture currently bound to |
|
Specifies the level 0 texture image on the texture currently bound
to |
|
Specifies the texture image on the level specified by the slot number
in |
|
Helper class used with syntax-sugar operators. Selects the GenerateMipmap member function. |
|
Generates mipmap on the texture currently bound to |
#include
<oglplus/texture_target.hpp>
enum class TextureTarget : GLenum { _1D = GL_TEXTURE_1D, _2D = GL_TEXTURE_2D, _3D = GL_TEXTURE_3D, _1DArray = GL_TEXTURE_1D_ARRAY, _2DArray = GL_TEXTURE_2D_ARRAY, Rectangle = GL_TEXTURE_RECTANGLE, Buffer = GL_TEXTURE_BUFFER, CubeMap = GL_TEXTURE_CUBE_MAP, CubeMapArray = GL_TEXTURE_CUBE_MAP_ARRAY, _2DMultisample = GL_TEXTURE_2D_MULTISAMPLE, _2DMultisampleArray = GL_TEXTURE_2D_MULTISAMPLE_ARRAY, CubeMapPositiveX = GL_TEXTURE_CUBE_MAP_POSITIVE_X, CubeMapNegativeX = GL_TEXTURE_CUBE_MAP_NEGATIVE_X, CubeMapPositiveY = GL_TEXTURE_CUBE_MAP_POSITIVE_Y, CubeMapNegativeY = GL_TEXTURE_CUBE_MAP_NEGATIVE_Y, CubeMapPositiveZ = GL_TEXTURE_CUBE_MAP_POSITIVE_Z, CubeMapNegativeZ = GL_TEXTURE_CUBE_MAP_NEGATIVE_Z }; template <> Range<TextureTarget> EnumValueRange<TextureTarget>(void); StrCRef EnumValueName(TextureTarget);
#if !OGLPLUS_NO_ENUM_VALUE_CLASSES
namespace enums { template <typename Base, template<TextureTarget> class Transform> class EnumToClass<Base, TextureTarget, Transform>: public Base { public: EnumToClass(void); EnumToClass(Base&& base); Transform<TextureTarget::_1D> _1D; Transform<TextureTarget::_2D> _2D; Transform<TextureTarget::_3D> _3D; Transform<TextureTarget::_1DArray> _1DArray; Transform<TextureTarget::_2DArray> _2DArray; Transform<TextureTarget::Rectangle> Rectangle; Transform<TextureTarget::Buffer> Buffer; Transform<TextureTarget::CubeMap> CubeMap; Transform<TextureTarget::CubeMapArray> CubeMapArray; Transform<TextureTarget::_2DMultisample> _2DMultisample; Transform<TextureTarget::_2DMultisampleArray> _2DMultisampleArray; Transform<TextureTarget::CubeMapPositiveX> CubeMapPositiveX; Transform<TextureTarget::CubeMapNegativeX> CubeMapNegativeX; Transform<TextureTarget::CubeMapPositiveY> CubeMapPositiveY; Transform<TextureTarget::CubeMapNegativeY> CubeMapNegativeY; Transform<TextureTarget::CubeMapPositiveZ> CubeMapPositiveZ; Transform<TextureTarget::CubeMapNegativeZ> CubeMapNegativeZ; }; } // namespace enums #endif
Specialization of EnumToClass for the TextureTarget enumeration. |
#include
<oglplus/texture_compare.hpp>
enum class TextureCompareMode : GLenum { None = GL_NONE, CompareRefToTexture = GL_COMPARE_REF_TO_TEXTURE }; template <> Range<TextureCompareMode> EnumValueRange<TextureCompareMode>(void); StrCRef EnumValueName(TextureCompareMode);
#include
<oglplus/texture_filter.hpp>
enum class TextureFilter : GLenum { Nearest = GL_NEAREST, Linear = GL_LINEAR }; template <> Range<TextureFilter> EnumValueRange<TextureFilter>(void); StrCRef EnumValueName(TextureFilter);
enum class TextureMinFilter : GLenum { Nearest = GL_NEAREST, Linear = GL_LINEAR, NearestMipmapNearest = GL_NEAREST_MIPMAP_NEAREST, NearestMipmapLinear = GL_NEAREST_MIPMAP_LINEAR, LinearMipmapNearest = GL_LINEAR_MIPMAP_NEAREST, LinearMipmapLinear = GL_LINEAR_MIPMAP_LINEAR }; template <> Range<TextureMinFilter> EnumValueRange<TextureMinFilter>(void); StrCRef EnumValueName(TextureMinFilter);
enum class TextureMagFilter : GLenum { Nearest = GL_NEAREST, Linear = GL_LINEAR }; template <> Range<TextureMagFilter> EnumValueRange<TextureMagFilter>(void); StrCRef EnumValueName(TextureMagFilter);
#include
<oglplus/texture_swizzle.hpp>
enum class TextureSwizzleCoord : GLenum { R = GL_TEXTURE_SWIZZLE_R, G = GL_TEXTURE_SWIZZLE_G, B = GL_TEXTURE_SWIZZLE_B, A = GL_TEXTURE_SWIZZLE_A, RGBA = GL_TEXTURE_SWIZZLE_RGBA }; template <> Range<TextureSwizzleCoord> EnumValueRange<TextureSwizzleCoord>(void); StrCRef EnumValueName(TextureSwizzleCoord);
#include
<oglplus/texture_swizzle.hpp>
enum class TextureSwizzle : GLenum { Red = GL_RED, Green = GL_GREEN, Blue = GL_BLUE, Alpha = GL_ALPHA, Zero = GL_ZERO, One = GL_ONE }; template <> Range<TextureSwizzle> EnumValueRange<TextureSwizzle>(void); StrCRef EnumValueName(TextureSwizzle);
#include
<oglplus/texture_swizzle.hpp>
#if GL_VERSION_3_3 || GL_ARB_texture_swizzle class TextureSwizzleTuple { public: TextureSwizzleTuple(void);TextureSwizzleTuple( TextureSwizzle mode_r, TextureSwizzle mode_g, TextureSwizzle mode_b, TextureSwizzle mode_a );
TextureSwizzleTuple& SwizzleR(TextureSwizzle mode);
TextureSwizzleTuple& Red(TextureSwizzle mode); TextureSwizzle SwizzleR(void) const;
TextureSwizzle Red(void) const; TextureSwizzleTuple& SwizzleG(TextureSwizzle mode);
TextureSwizzleTuple& Green(TextureSwizzle mode); TextureSwizzle SwizzleG(void) const;
TextureSwizzle Green(void) const; TextureSwizzleTuple& SwizzleB(TextureSwizzle mode);
TextureSwizzleTuple& Blue(TextureSwizzle mode); TextureSwizzle SwizzleB(void) const;
TextureSwizzle Blue(void) const; TextureSwizzleTuple& SwizzleA(TextureSwizzle mode);
TextureSwizzleTuple& Alpha(TextureSwizzle mode); TextureSwizzle SwizzleA(void) const;
TextureSwizzle Alpha(void) const; TextureSwizzleTuple& Swizzle( TextureSwizzleCoord coordinate, TextureSwizzle mode );
TextureSwizzle Swizzle(TextureSwizzleCoord coordinate) const;
}; #endif
No swizzling. |
|
Specifies modes for all texture components/coordinates. |
|
Sets the swizzle value for the red component. |
|
Returns the swizzle value for the red component. |
|
Sets the swizzle value for the green component. |
|
Returns the swizzle value for the green component. |
|
Sets the swizzle value for the blue component. |
|
Returns the swizzle value for the blue component. |
|
Sets the swizzle value for the alpha component. |
|
Returns the swizzle value for the alpha component. |
|
Sets the swizzle |
|
Returns the swizzle mode for the specified |
#include
<oglplus/texture_wrap.hpp>
enum class TextureWrapCoord : GLenum { S = GL_TEXTURE_WRAP_S, T = GL_TEXTURE_WRAP_T, R = GL_TEXTURE_WRAP_R }; template <> Range<TextureWrapCoord> EnumValueRange<TextureWrapCoord>(void); StrCRef EnumValueName(TextureWrapCoord);
#include
<oglplus/texture_wrap.hpp>
enum class TextureWrap : GLenum { ClampToEdge = GL_CLAMP_TO_EDGE, Repeat = GL_REPEAT, ClampToBorder = GL_CLAMP_TO_BORDER, MirroredRepeat = GL_MIRRORED_REPEAT, MirrorClampToEdge = GL_MIRROR_CLAMP_TO_EDGE }; template <> Range<TextureWrap> EnumValueRange<TextureWrap>(void); StrCRef EnumValueName(TextureWrap);
#include
<oglplus/texture_unit.hpp>
class TextureUnitSelector : public LimitedCount<GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS> { public: TextureUnitSelector(GLuint number);}; #if GL_VERSION_4_2 || GL_ARB_shader_image_load_store class ImageUnitSelector : public LimitedCount<GL_MAX_IMAGE_UNITS> { public: ImageUnitSelector(GLuint number);
}; #endif
Throws LimitError
if |
|
Throws LimitError
if |
This code snippet shows a typical setup for a 2D texture. See also a more convenient way how to setup textures by using the currently bound objects.
using namespace oglplus; Texture tex;TextureUnitSelector tex_unit = /* ... */;
Texture::Active(tex_unit);
TextureTarget tex_tgt = Texture::Target::_2D;
tex.Bind(tex_tgt);
Texture::MinFilter(tex_tgt, TextureMinFilter::Linear);
Texture::MagFilter(tex_tgt, TextureMagFilter::Nearest); Texture::WrapS(tex_tgt, TextureWrap::ClampToEdge); Texture::WrapT(tex_tgt, TextureWrap::ClampToEdge); Texture::CompareMode(tex_tgt, TextureCompareMode::CompareRefToTexture); std::vector<GLfloat> image = /* ... */;
GLsizei width = /* ... */, height = /* ... */; Texture::Image2D(
tex_tgt, 0, PixelDataInternalFormat::DepthComponent32, width, height, 0, PixelDataFormat::DepthComponent, PixelDataType::Float, image.data()
);
Create a texture object. |
|
Choose a texture unit for the texture. |
|
Make the texture unit current (active). |
|
Choose binding point for the texture. |
|
Bind the texture object to the texture target. |
|
Setup various texture parameters for the texture currently bound to the specified texture target on the currenly active texture unit. |
|
Obtain the texture image data. |
|
Setup the texture image data. |
|
The buffer pointed-to by this parameter must hold enough data to be consumed, depending on the width, height, data type and other parameters. Optionally this pointer can be null, which causes a blank texture to be created. |
The syntax sugar operators provide another convenient alternative for setting up texture parameters and image data.
Texture tex;TextureUnitSelector tex_unit = /* ... */;
Texture::Active(tex_unit); std::vector<GLubyte> image = /* ... */; GLsizei width = /* ... */, height = /* ... */; tex << TextureTarget::_2D
<< TextureMinFilter::Linear
<< TextureMagFilter::Nearest
<< TextureWrap::ClampToEdge
<< images::ImageSpec(
width, height, PixelDataFormat::RGBA, image.data() );
Create a texture object. |
|
Choose a texture unit for the texture and make it current. |
|
This expression creates a pair of a texture object and a texture target which allows to chain the other operands which in turn call various Texture's functions. |
|
|
|
|
|
|
|
|