![]() |
PURE API 0.5
PR00F's Ultimate Rendering Engine full documentation
|
Texture-representing class. More...
Texture-representing class.
Definition at line 113 of file PureTextureManager.h.
#include <PureTextureManager.h>
Classes | |
class | PureTextureImpl |
Public Member Functions | |
virtual | ~PureTexture () |
CConsole & | getManagedConsole () const |
Returns access to console preset with logger module name as this class. | |
TPURE_TEX_FORMAT | getInternalFormat () const |
Gets the internal texture format, including compression mode. | |
TPureUInt | getInternalNum () const |
Gets the internal texture ID. | |
TPURE_ISO_TEX_FILTERING | getMinFilteringMode () const |
Gets the isotropic filtering mode when zooming out (1 texel < 1 pixel). | |
TPURE_ISO_TEX_FILTERING | getMagFilteringMode () const |
Gets the isotropic filtering mode when zooming in (1 texel > 1 pixel). | |
TPureBool | setMinFilteringMode (TPURE_ISO_TEX_FILTERING filtering) |
Sets the isotropic filtering mode when zooming out (1 texel < 1 pixel). | |
TPureBool | setMagFilteringMode (TPURE_ISO_TEX_FILTERING filtering) |
Sets the isotropic filtering mode when zooming in (1 texel > 1 pixel). | |
TPureBool | setIsoFilteringMode (TPURE_ISO_TEX_FILTERING minfilter, TPURE_ISO_TEX_FILTERING magfilter) |
Sets the isotropic filtering modes. | |
TPureUInt | getMIPmapCount () const |
Gets the number of MIP maps. | |
TPURE_ANISO_TEX_FILTERING | getAnisoFilteringMode () const |
Gets the anisotropic filtering mode. | |
TPureBool | setAnisoFilteringMode (TPURE_ANISO_TEX_FILTERING filtering) |
Sets the anisotropic filtering mode. | |
TPURE_TEX_WRAPPING | getTextureWrappingModeS () const |
Gets the texture wrapping mode for S coordinates. | |
TPURE_TEX_WRAPPING | getTextureWrappingModeT () const |
Gets the texture wrapping mode for T coordinates. | |
TPureBool | setTextureWrappingMode (TPURE_TEX_WRAPPING tw_s, TPURE_TEX_WRAPPING tw_t) |
Sets the texture wrapping mode. | |
TPureBool | getBorder () const |
Gets the border state. | |
TPureBool | setBorder (TPureBool state) |
Sets the border state. | |
const PureColor & | getBorderColor () const |
Gets color of the border. | |
TPureBool | setBorderColor (const PureColor &clr) |
Sets color of the border. | |
TPureBool | uploadPixels () |
Uploads pixels in system memory to video memory. | |
virtual TPureUInt | getUsedSystemMemory () const |
Gets the amount of allocated system memory for the texture (VRAM not included). | |
TPureUInt | getUsedTextureMemory () const |
Gets the amount of VRAM allocated (considering compression, MIP mapping, etc...). | |
![]() | |
virtual | ~PureImage () |
CConsole & | getManagedConsole () const |
Returns access to console preset with logger module name as this class. | |
TPureUInt | getWidth () const |
Gets the width of the image. | |
TPureUInt | getHeight () const |
Gets the height of the image. | |
TPureUInt | getBitsPerPixels () const |
Gets the bit depth of the image. | |
TPURE_PIXEL_COMPONENT_ORDER | getPixelComponentOrder () const |
Gets the actual color component order. | |
TPURE_PIXEL_COMPONENT_ORDER | getOriginalPixelComponentOrder () const |
Gets the original color component order. | |
TPureBool | setPixelComponentOrder (TPURE_PIXEL_COMPONENT_ORDER corder) |
Transforms the color component order of the image to the given color component order. | |
PureColor | getPixel (TPureUInt x, TPureUInt y) |
Gets the color of the pixel at the given (x,y) coordinate. | |
PureColor | getPixel (TPureUInt x, TPureUInt y) const |
Gets the color of the pixel at the given (x,y) coordinate. | |
TPureBool | setPixel (TPureUInt x, TPureUInt y, TPureUByte r, TPureUByte g, TPureUByte b, TPureUByte a=0) |
Sets the color of the pixel at the given (x,y) coordinate. | |
TPureBool | setPixel (TPureUInt x, TPureUInt y, PureColor clr) |
Sets the color of the pixel at the given (x,y) coordinate. | |
TPureBool | isChanged () const |
True if the pixel data has been changed since loading it from file. | |
const TPureUByte * | getPixels () const |
Gets the pointer to the array of pixels, giving direct access to pixels. | |
TPureUByte * | getPixels () |
Gets the pointer to the array of pixels, giving direct access to pixels. | |
TPureUInt | getPixelsSize () const |
Gets the size of the array of pixels. | |
virtual void | FlushResources () |
This can be used if you don't need the pixels of the image to be in the system memory anymore. | |
![]() | |
PureFiledManaged () | |
virtual | ~PureFiledManaged () |
CConsole & | getManagedConsole () const |
Returns access to console preset with logger module name as this class. | |
const std::string & | getFilename () const |
Gets the filename. | |
![]() | |
PureManaged () | |
virtual | ~PureManaged () |
CConsole & | getManagedConsole () const |
Returns access to console preset with logger module name as this class. | |
const PureManaged * | getUtiliser () const |
Returns the managed that utilizes this managed. | |
PureManaged * | getUtiliser () |
Returns the managed that utilizes this managed. | |
void | SetUtiliser (PureManaged *pUtiliser) |
Sets the managed that utilizes this managed. | |
void | DetachFrom () |
Removes the managed from its manager. | |
PureManager * | getManager () const |
Gets the manager of the managed. | |
const std::string & | getName () const |
Gets the name. | |
void | SetName (const std::string &name) |
Sets the name. | |
Static Public Member Functions | |
static const char * | getLoggerModuleName () |
Returns the logger module name of this class. | |
![]() | |
static const char * | getLoggerModuleName () |
Returns the logger module name of this class. | |
![]() | |
static const char * | getLoggerModuleName () |
Returns the logger module name of this class. | |
![]() | |
static const char * | getLoggerModuleName () |
Returns the logger module name of this class. | |
Protected Member Functions | |
PureTexture () | |
Only PureTextureManager creates it. | |
PureTexture (const PureImage &img) | |
Only PureTextureManager creates it this way. | |
PureTexture (const PureTexture &) | |
PureTexture & | operator= (const PureTexture &) |
![]() | |
PureImage () | |
Only ImageManager can create it. | |
PureImage (const PureImage &) | |
PureImage & | operator= (const PureImage &) |
![]() | |
PureFiledManaged (const PureFiledManaged &other) | |
PureFiledManaged & | operator= (const PureFiledManaged &other) |
void | SetFilename (const std::string &filename) |
Sets the filename. | |
![]() | |
PureManaged (const PureManaged &other) | |
PureManaged & | operator= (const PureManaged &other) |
Private Attributes | |
PureTextureImpl * | pImpl |
Friends | |
class | PureTextureManager |
|
virtual |
Definition at line 749 of file PureTexture.cpp.
|
protected |
Only PureTextureManager creates it.
std::bad_alloc | - This class or its ancestor dynamically allocates memory with operator new, in case of failure the exception is not handled but propagated to caller. |
Definition at line 1016 of file PureTexture.cpp.
|
explicitprotected |
Only PureTextureManager creates it this way.
std::bad_alloc | - This class or its ancestor dynamically allocates memory with operator new, in case of failure the exception is not handled but propagated to caller. |
Definition at line 1029 of file PureTexture.cpp.
|
protected |
Definition at line 1038 of file PureTexture.cpp.
TPURE_ANISO_TEX_FILTERING PureTexture::getAnisoFilteringMode | ( | ) | const |
Gets the anisotropic filtering mode.
Definition at line 869 of file PureTexture.cpp.
TPureBool PureTexture::getBorder | ( | ) | const |
Gets the border state.
Definition at line 923 of file PureTexture.cpp.
const PureColor & PureTexture::getBorderColor | ( | ) | const |
Gets color of the border.
Texture border color is by default black.
Definition at line 946 of file PureTexture.cpp.
TPURE_TEX_FORMAT PureTexture::getInternalFormat | ( | ) | const |
Gets the internal texture format, including compression mode.
Gets the internal texture format.
Definition at line 785 of file PureTexture.cpp.
TPureUInt PureTexture::getInternalNum | ( | ) | const |
Gets the internal texture ID.
Definition at line 795 of file PureTexture.cpp.
|
static |
Returns the logger module name of this class.
Intentionally not virtual, so derived class should hide this instead of overriding. Not even private, so user can also access this from outside, for any reason like controlling log filtering per logger module name.
Definition at line 775 of file PureTexture.cpp.
TPURE_ISO_TEX_FILTERING PureTexture::getMagFilteringMode | ( | ) | const |
Gets the isotropic filtering mode when zooming in (1 texel > 1 pixel).
Definition at line 816 of file PureTexture.cpp.
CConsole & PureTexture::getManagedConsole | ( | ) | const |
Returns access to console preset with logger module name as this class.
Intentionally not virtual, so the getConsole() in derived class should hide this instead of overriding.
Definition at line 762 of file PureTexture.cpp.
TPURE_ISO_TEX_FILTERING PureTexture::getMinFilteringMode | ( | ) | const |
Gets the isotropic filtering mode when zooming out (1 texel < 1 pixel).
Definition at line 806 of file PureTexture.cpp.
TPureUInt PureTexture::getMIPmapCount | ( | ) | const |
Gets the number of MIP maps.
Definition at line 859 of file PureTexture.cpp.
TPURE_TEX_WRAPPING PureTexture::getTextureWrappingModeS | ( | ) | const |
Gets the texture wrapping mode for S coordinates.
Definition at line 891 of file PureTexture.cpp.
TPURE_TEX_WRAPPING PureTexture::getTextureWrappingModeT | ( | ) | const |
Gets the texture wrapping mode for T coordinates.
Definition at line 901 of file PureTexture.cpp.
|
virtual |
Gets the amount of allocated system memory for the texture (VRAM not included).
VRAM usage can be retrieved by getUsedTextureMemory().
Reimplemented from PureImage.
Definition at line 990 of file PureTexture.cpp.
TPureUInt PureTexture::getUsedTextureMemory | ( | ) | const |
Gets the amount of VRAM allocated (considering compression, MIP mapping, etc...).
This does not include used system memory by the object itself, including possible cached pixel data. Used system memory can be retrieved by getUsedSystemMemory().
Definition at line 1002 of file PureTexture.cpp.
|
protected |
Definition at line 1044 of file PureTexture.cpp.
TPureBool PureTexture::setAnisoFilteringMode | ( | TPURE_ANISO_TEX_FILTERING | filtering | ) |
Sets the anisotropic filtering mode.
Note that if anisotropic filtering is supported but on a lower filtering mode, that will be set and considered as success. Obviously if anisotropic filtering is not supported, this function will fail.
Definition at line 881 of file PureTexture.cpp.
Sets the border state.
No effect until uploadPixels() is called. Please note that texture borders are not supported with compressed textures.
Definition at line 935 of file PureTexture.cpp.
Sets color of the border.
Texture border color is by default black. No effect until uploadPixels() is called. Please note that texture borders are not supported with compressed textures.
Definition at line 959 of file PureTexture.cpp.
TPureBool PureTexture::setIsoFilteringMode | ( | TPURE_ISO_TEX_FILTERING | minfilter, |
TPURE_ISO_TEX_FILTERING | magfilter ) |
Sets the isotropic filtering modes.
Equivalent to calling setMinFilteringMode(minfilter) && setMagFilteringMode(magfilter).
Definition at line 849 of file PureTexture.cpp.
TPureBool PureTexture::setMagFilteringMode | ( | TPURE_ISO_TEX_FILTERING | filtering | ) |
Sets the isotropic filtering mode when zooming in (1 texel > 1 pixel).
Only the following 2 values are accepted: PURE_ISO_NEAREST and PURE_ISO_LINEAR.
Definition at line 838 of file PureTexture.cpp.
TPureBool PureTexture::setMinFilteringMode | ( | TPURE_ISO_TEX_FILTERING | filtering | ) |
Sets the isotropic filtering mode when zooming out (1 texel < 1 pixel).
If the texture has been created without MIP maps, only PURE_ISO_NEAREST and PURE_ISO_LINEAR are acceptable.
Definition at line 827 of file PureTexture.cpp.
TPureBool PureTexture::setTextureWrappingMode | ( | TPURE_TEX_WRAPPING | tw_s, |
TPURE_TEX_WRAPPING | tw_t ) |
Sets the texture wrapping mode.
tw_s | Specifies wrapping mode for S texture coordinates. |
tw_t | Specifies wrapping mode for T texture coordinates. |
Definition at line 913 of file PureTexture.cpp.
TPureBool PureTexture::uploadPixels | ( | ) |
Uploads pixels in system memory to video memory.
Should be used after directly modifying pixels or changing some of the properties like border. Has effect only if the Texture object is owned by a TextureManager and the Image part of the Texture object still has the pixels in system memory.
Internal format and used texture memory will be updated by this method so those should be queried again in case of interest.
The upload mechanism depends on the CURRENT settings of the owner TextureManager: for example, if the texture compression was set to off by default when the texture was created, the texture may still become compressed if the compression setting has been altered already when calling this method.
This method may change the color component order of the given image temporarily but restores it after creating the texture.
Definition at line 979 of file PureTexture.cpp.
|
friend |
Definition at line 184 of file PureTextureManager.h.
|
private |
Definition at line 182 of file PureTextureManager.h.