Texture

Types

struct Texture A 32 bit handle.

enum TextureFormat

typedef enum TextureFormat{
TextureFormatInvalid = 0,
/* Normal 8 bit formats */
TextureFormatA8Unorm      = 1,
TextureFormatR8Unorm                            = 10,
TextureFormatR8Unorm_sRGB = 11,
TextureFormatR8Snorm      = 12,
TextureFormatR8Uint       = 13,
TextureFormatR8Sint       = 14,
/* Normal 16 bit formats */
TextureFormatR16Unorm     = 20,
TextureFormatR16Snorm     = 22,
TextureFormatR16Uint      = 23,
TextureFormatR16Sint      = 24,
TextureFormatR16Float     = 25,
TextureFormatRG8Unorm                            = 30,
TextureFormatRG8Unorm_sRGB  = 31,
TextureFormatRG8Snorm                            = 32,
TextureFormatRG8Uint                             = 33,
TextureFormatRG8Sint                             = 34,
/* Packed 16 bit formats */
TextureFormatB5G6R5Unorm  = 40,
TextureFormatA1BGR5Unorm  = 41,
TextureFormatABGR4Unorm   = 42,
TextureFormatBGR5A1Unorm  = 43,
/* Normal 32 bit formats */
TextureFormatR32Uint  = 53,
TextureFormatR32Sint  = 54,
TextureFormatR32Float = 55,
TextureFormatRG16Unorm  = 60,
TextureFormatRG16Snorm  = 62,
TextureFormatRG16Uint   = 63,
TextureFormatRG16Sint   = 64,
TextureFormatRG16Float  = 65,
TextureFormatRGBA8Unorm      = 70,
TextureFormatRGBA8Unorm_sRGB = 71,
TextureFormatRGBA8Snorm      = 72,
TextureFormatRGBA8Uint       = 73,
TextureFormatRGBA8Sint       = 74, 
TextureFormatBGRA8Unorm      = 80,
TextureFormatBGRA8Unorm_sRGB = 81,
/* Packed 32 bit formats */
TextureFormatRGB10A2Unorm = 90,
TextureFormatRGB10A2Uint  = 91,
TextureFormatRG11B10Float = 92,
TextureFormatRGB9E5Float = 93,
TextureFormatBGR10A2Unorm   = 94,
TextureFormatBGR10_XR       = 554,
TextureFormatBGR10_XR_sRGB  = 555,
/* Normal 64 bit formats */
TextureFormatRG32Uint  = 103,
TextureFormatRG32Sint  = 104,
TextureFormatRG32Float = 105,
TextureFormatRGBA16Unorm  = 110,
TextureFormatRGBA16Snorm  = 112,
TextureFormatRGBA16Uint   = 113,
TextureFormatRGBA16Sint   = 114,
TextureFormatRGBA16Float  = 115,
TextureFormatBGRA10_XR       = 552,
TextureFormatBGRA10_XR_sRGB  = 553,
/* Normal 128 bit formats */
TextureFormatRGBA32Uint  = 123,
TextureFormatRGBA32Sint  = 124,
TextureFormatRGBA32Float = 125,
/* Compressed formats. */
/* S3TC/DXT */
TextureFormatBC1_RGBA               = 130,
TextureFormatBC1_RGBA_sRGB          = 131,
TextureFormatBC2_RGBA               = 132,
TextureFormatBC2_RGBA_sRGB          = 133,
TextureFormatBC3_RGBA               = 134,
TextureFormatBC3_RGBA_sRGB          = 135,
/* RGTC */
TextureFormatBC4_RUnorm             = 140,
TextureFormatBC4_RSnorm             = 141,
TextureFormatBC5_RGUnorm            = 142,
TextureFormatBC5_RGSnorm            = 143,
/* BPTC */
TextureFormatBC6H_RGBFloat          = 150,
TextureFormatBC6H_RGBUfloat         = 151,
TextureFormatBC7_RGBAUnorm         = 152,
TextureFormatBC7_RGBAUnorm_sRGB     = 153,
/* ASTC */
TextureFormatASTC_4x4_sRGB          = 186,
TextureFormatASTC_5x4_sRGB          = 187,
TextureFormatASTC_5x5_sRGB          = 188,
TextureFormatASTC_6x5_sRGB          = 189,
TextureFormatASTC_6x6_sRGB          = 190,
TextureFormatASTC_8x5_sRGB          = 192,
TextureFormatASTC_8x6_sRGB          = 193,
TextureFormatASTC_8x8_sRGB          = 194,
TextureFormatASTC_10x5_sRGB         = 195,
TextureFormatASTC_10x6_sRGB         = 196,
TextureFormatASTC_10x8_sRGB         = 197,
TextureFormatASTC_10x10_sRGB        = 198,
TextureFormatASTC_12x10_sRGB        = 199,
TextureFormatASTC_12x12_sRGB        = 200,
TextureFormatASTC_4x4_LDR           = 204,
TextureFormatASTC_5x4_LDR           = 205,
TextureFormatASTC_5x5_LDR           = 206,
TextureFormatASTC_6x5_LDR           = 207,
TextureFormatASTC_6x6_LDR           = 208,
TextureFormatASTC_8x5_LDR           = 210,
TextureFormatASTC_8x6_LDR           = 211,
TextureFormatASTC_8x8_LDR           = 212,
TextureFormatASTC_10x5_LDR          = 213,
TextureFormatASTC_10x6_LDR          = 214,
TextureFormatASTC_10x8_LDR          = 215,
TextureFormatASTC_10x10_LDR         = 216,
TextureFormatASTC_12x10_LDR         = 217,
TextureFormatASTC_12x12_LDR         = 218, 
// ASTC HDR (High Dynamic Range) Formats
TextureFormatASTC_4x4_HDR           = 222,
TextureFormatASTC_5x4_HDR           = 223,
TextureFormatASTC_5x5_HDR           = 224,
TextureFormatASTC_6x5_HDR           = 225,
TextureFormatASTC_6x6_HDR           = 226,
TextureFormatASTC_8x5_HDR           = 228,
TextureFormatASTC_8x6_HDR           = 229,
TextureFormatASTC_8x8_HDR           = 230,
TextureFormatASTC_10x5_HDR          = 231,
TextureFormatASTC_10x6_HDR          = 232,
TextureFormatASTC_10x8_HDR          = 233,
TextureFormatASTC_10x10_HDR         = 234,
TextureFormatASTC_12x10_HDR         = 235,
TextureFormatASTC_12x12_HDR         = 236,  
TextureFormatDepth16Unorm  = 250,
TextureFormatDepth32Float  = 252,
/* Stencil */
TextureFormatStencil8        = 253,
TextureFormatDepth32Float_Stencil8  = 260,
TextureFormatX32_Stencil8  = 261,
}TextureFormat;

enum TextureWrap

typedef enum TextureWrap{
TextureWrap_Clamp = 0,
TextureWrap_WrapX = 1,
TextureWrap_WrapY = 2,
TextureWrap_WrapBoth = 3
} TextureWrap;

enum TextureFilter

typedef enum TextureFilter{
TextureFilter_Nearest = 0,
TextureFilter_Bilinear = 1,
TextureFilter_LinearMip = 2,
TextureFilter_Trilinear = 3
} TextureFilter;

enum TextureAniso

typedef enum TextureAniso {
AnisoOff = 1,
Aniso2 = 2,
Aniso3 = 3,
Aniso4 = 4,
Aniso5 = 5,
Aniso6 = 6,
Aniso7 = 7,
Aniso8 = 8,
Aniso9 = 9,
Aniso10 = 10,
Aniso11 = 11,
Aniso12 = 12,
Aniso13= 13,
Aniso14 = 14,
Aniso15 = 15,
Aniso16 = 16,
}TextureAniso;

Creation & Destruction

Texture_Create( void ) : Texture Creates a new empty texture.

Texture_Destroy( Texture texture ) : void
Destroys the texture and associated buffers. The buffer memory may not be available for up to 3 frames.

Functions

Texture_Exists( Texture texture ) : bool
Returns true if the Texture is non-null.

Texture_Width( Texture texture ) : uint32_t

Texture_Height( Texture texture ) : uint32_t

Texture_TexelSize( Texture texture ) : Float4

Texture_AspectRatio( Texture texture ) : float

Texture_InvAspectRatio( Texture texture ) : float

Texture_MipMapCount( Texture texture ) : uint32_t

Texture_WrapMode( Texture texture ) : TextureWrap

Texture_FilterMode( Texture texture ) : TextureFilter

Texture_Anisotropy( Texture texture ) : TextureAniso

Methods

Texture_SetWrapMode( Texture texture, TextureWrap wrap_mode ) : void

Texture_SetFilterMode( Texture texture, TextureFilter filter_mode ) : void

Texture_SetAnisotropy( Texture texture, TextureAniso aniso ) : void