Back to class index

Class Texture

Summary

Stores a CPU or GPU side image. (1D, 2D, 3D or Cube)

Member Reference

TextureStores a CPU or GPU side image. (1D, 2D, 3D or Cube)
textureHandleThe OpenGL GPU texture handle.
currentActiveSampler[const]Specifies the sampler settings that are currently activated for this texture.
ctorCreates an empty texture.
~dtor
Deinit()Frees up all resources associated with this texture and makes it null.
CreateNew(...) (+2 overloads)Initializes this texture object to a new texture.
RecreateToNewUsage(...)Reallocates this texture and creates it to a new usage pool. The contents and format of the texture will remain identical.
ConvertToFormat(...)Returns true on success.
Resize(...)Resizes a 1D, 2D or a cube texture.
LoadFromFile(...) (+1 overload)Resizes a 3D texture. TODO: Implement.
LoadFromBMPFile(...)Loads this texture from a .bmp file.
LoadFromDDSFile(...)Loads this texture from a .dds file.
LoadFromPKMFile(...)Loads this texture from a .pkm file (content in ETC1 format)
ReloadFromFile()
Width()[const]Returns the pixel width of the topmost mip level of this texture.
Height()[const]Returns the pixel height of the topmost mip level of this texture.
Depth()[const]Returns the depth of the topmost mip level of this texture, in pixels. If this texture is not a 3D texture, this function always returns 1.
Format()[const]
Name()[const]Returns the name of this texture, or "(untracked)" if TRACK_RESOURCES is not #defined.
BitsPerPixel()[const]Returns bits per pixel in this texture.
NumMipmaps()[const]Returns the number of mip levels in this texture. The topmost level counts as one, so if no mip chains are created, this function returns 1.
SetNumMipmaps(...)Specifies a new desired number of mip levels for this texture.
MipLevelWidth(mipLevel)[const]Computes the pixel width of the given mip level surface. mipLevel == 0 is the topmost level, 1 is the second-to-top and so on, until level NumMipmaps()-1.
MipLevelHeight(mipLevel)[const]Computes the pixel height of the given mip level surface. mipLevel == 0 is the topmost level, 1 is the second-to-top and so on, until level NumMipmaps()-1.
GPUSizeBytes()[const]Returns the number of bytes that have been allocated to the GPU for the texture data of this resource.
CPUSizeBytes()[const]Returns the number of bytes that have been allocated to the CPU for the texture data of this resource.
SizeBytes()[const]Returns the total number of bytes required by the pixel data of this texture, EVEN IF THE PIXEL DATA has not been allocated, i.e.
BeginDraw(...)Begins a CPU-side access operation on the given mip level of this texture.
EndDraw(subResourceIndex)Ends a CPU-side access operation on the given mip level of this texture.
ReadPixels(subResourceIndex)Fetches a copy of the surface pixel data for the given subresource index to main RAM.
Clone(...) (+1 overload)
SaveToFile(filename)Saves this texture to a file.
DisableMipmaps()Deletes all mip levels from this texture and keeps only the topmost surface.
MaxMipLevelCount(width,height)[static]Computes the maximum number of mip levels a texture of the given size can have.
MipLevelLength(length,mipLevel)[static]
SizeBytes(...)[static]
CopyRegion2D(...)[static]Performs a GPU-side blit of a subregion of one 2D texture to another.
CopyRegion(...)[static]Performs a GPU-side blit of a subregion of one 3D texture to another.
Back to class index