#include <Images.h>
Inheritance diagram for TGraphicTexture:
Public Member Functions | |
TGraphicTexture (void) | |
Constructor. | |
~TGraphicTexture (void) | |
Destructor. | |
TGraphicTexture (const TGraphicTexture &orig) | |
fake copy constructor | |
void | operator= (const TGraphicTexture &orig) |
fake assignment operator | |
BOOL | Create (const TSurfaceDesc &desc, DWORD mipmaps) |
Creates texture. | |
BOOL | Create (DWORD width, DWORD height, EnumGraphicFormat format, DWORD mipmaps) |
Creates texture. | |
void | Unload (void) |
Release all resources in this object. | |
void | Clone (TGraphicTexture **dest) const |
Copy this texture to new one. | |
void | Set (const TGraphicTexture &orig) |
Set(copy) texture in parameter to this texture. | |
const TGraphicSurface * | GetMipMap (DWORD index) const |
Returns pointer to one of texture mipmaps or NULL if this mipmap doesnt exists. | |
TGraphicSurface * | GetMipMap (DWORD index) |
Returns pointer to one of texture mmipmaps or NULL if this mipmap doesnt exists. | |
BOOL | IsLoaded (void) const |
Determines whether texture is loaded. | |
BOOL | IsCompressed (void) const |
Determines whether texture has compressed device format (e.g. | |
BOOL | IsRGB (void) const |
Determines whether texture has RGB-type device format (e.g. | |
EnumGraphicFormat | GetPixelFormat (void) const |
Returns pixel format of texture. | |
DWORD | GetNumberMipMaps (void) const |
Returns number of mipmaps in texture. | |
DWORD | GetWidth (void) const |
Returns width of main surface (first mipmap). | |
DWORD | GetHeight (void) const |
Returns height of main surface (first mipmap). | |
TSurfaceDesc | GetSurfDesc (void) const |
Return surface description. | |
BOOL | LoadDDS (const TString &filename) |
Load texture from specified DDS file. | |
Classes | |
struct | DDS_FLAGS |
Struct with basic informations about DDS file. |
Software texture consists at least from one TGraphicSurface surface. As well as TGraphicSurface is software equivalent for TRendererSurface as well TGraphicTexture is equivalent for TRendererTexture.
Texture must be loaded before you use it - see IsLoaded() method. You may load texture by creating it or loading from file.
Actually supports only these formats: GRAPH_FMT_X8R8G8B8 GRAPH_FMT_A8R8G8B8 GRAPH_FMT_L8 GRAPH_FMT_A8 GRAPH_FMT_R5G6B5 GRAPH_FMT_X1R5G5B5
GRAPH_FMT_DXT1 GRAPH_FMT_DXT2 GRAPH_FMT_DXT3 GRAPH_FMT_DXT4 GRAPH_FMT_DXT5
Definition at line 167 of file Images.h.
|
Constructor. Creates empty, uninitialized (unloaded) texture. Before using you must create or load texture. Definition at line 297 of file Images.cpp. References FALSE, GRAPH_FMT_UNKNOWN, TSurfaceDesc::m_height, TSurfaceDesc::m_pixelFormat, and TSurfaceDesc::m_width. |
|
Destructor. Destroy this texture and also all surfaces stored inside!!! Definition at line 312 of file Images.cpp. References Unload(). Here is the call graph for this function: ![]() |
|
fake copy constructor
|
|
Copy this texture to new one.
Definition at line 420 of file Images.cpp. References DBGASSERT, and Set(). Here is the call graph for this function: ![]() |
|
Creates texture. This method always destroys previous texture thus if creating fails, texture become into unloaded state. Mipmaps are created from previous texture size by dividing of 2. Number of created mipmaps may be less than desired because last mipmap must have size equal to 1x1.
Definition at line 342 of file Images.cpp. References TArrayPtrs< T, size, step >::AddItem(), TGraphicSurface::Create(), DBGTEXTF, FALSE, GRAPH_FMT_UNKNOWN, TRUE, and Unload(). Here is the call graph for this function: ![]() |
|
Creates texture. Old texture is destroyed.
Definition at line 192 of file Images.h. References TSurfaceDesc::m_height, TSurfaceDesc::m_pixelFormat, and TSurfaceDesc::m_width. |
|
Returns height of main surface (first mipmap).
Definition at line 232 of file Images.h. References TSurfaceDesc::m_height. |
|
Returns pointer to one of texture mmipmaps or NULL if this mipmap doesnt exists. Mipmaps are indexed from zero, so range is <0,GetNumberMipMaps()>.
Definition at line 484 of file Images.cpp. References DBGASSERT, and TArrayPtrs< T, size, step >::GetItem(). Here is the call graph for this function: ![]() |
|
Returns pointer to one of texture mipmaps or NULL if this mipmap doesnt exists. Mipmaps are indexed from zero, so range is <0,GetNumberMipMaps()>.
Definition at line 465 of file Images.cpp. References DBGASSERT, and TArrayPtrs< T, size, step >::GetItem(). Here is the call graph for this function: ![]() |
|
Returns number of mipmaps in texture. Value 0 means there is no texture loaded!!! |
|
Returns pixel format of texture.
Definition at line 219 of file Images.h. References TSurfaceDesc::m_pixelFormat. |
|
Return surface description.
|
|
Returns width of main surface (first mipmap).
Definition at line 228 of file Images.h. References TSurfaceDesc::m_width. |
|
Determines whether texture has compressed device format (e.g. DXTn) |
|
Determines whether texture is loaded.
Definition at line 207 of file Images.h. Referenced by Set(). |
|
Determines whether texture has RGB-type device format (e.g. X8R8G8B8) |
|
Load texture from specified DDS file. Specified file is from virtual file system!!! Thus VFS must set properly in TGlobalsSystem!!!
Definition at line 504 of file Images.cpp. References DBGTEXTF, FALSE, TString::Length(), and Unload(). Here is the call graph for this function: ![]() |
|
fake assignment operator
|
|
Set(copy) texture in parameter to this texture.
Definition at line 432 of file Images.cpp. References IsLoaded(), and Unload(). Referenced by Clone(). Here is the call graph for this function: ![]() |
|
Release all resources in this object. After calling this method texture is unloaded and therefore unusable!!!. Definition at line 320 of file Images.cpp. References FALSE, GRAPH_FMT_UNKNOWN, TSurfaceDesc::m_height, TSurfaceDesc::m_pixelFormat, and TSurfaceDesc::m_width. Referenced by Create(), LoadDDS(), Set(), and ~TGraphicTexture(). |