# Home    # nevrax.com   
Nevrax
Nevrax.org
#News
#Mailing-list
#Documentation
#CVS
#Bugs
#License
Docs
 
Documentation  
Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Related Pages   Search  

NL3D::CTextureMem Class Reference

CTextureMem. More...

#include <texture_mem.h>

Inheritance diagram for NL3D::CTextureMem:

NL3D::ITexture NLMISC::CBitmap NLMISC::CRefCount NLMISC::IStreamable NLMISC::IClassable List of all members.

Public Methods

 CTextureMem ()
 Default constructor. More...

virtual ~CTextureMem ()
 Destructor. More...

 CTextureMem (uint8 *data, uint32 length, bool _delete, bool isFile=true, uint width=0, uint height=0, CBitmap::TType texType=CBitmap::RGBA)
 constructor. More...

void setPointer (uint8 *data, uint32 length, bool _delete, bool isFile=true, uint width=0, uint height=0, CBitmap::TType texType=CBitmap::RGBA)
 Set the pointer of the mem file containing the texture. More...

uint8getPointer () const
 Get the Pointer of the memory file containing the texture. More...

uint32 getLength () const
 Get length of the memory file containing the texture. More...

bool isDeletable () const
 Return true if the class handle the delete of the pointer. More...

void doGenerate ()
 Generate the texture. More...

virtual bool supportSharing () const
 inherited from ITexture. More...

virtual std::string getShareName () const
 inherited from ITexture. More...

void setShareName (const std::string &shareName)
 Make this texture sharable by assigning it a share name. An empty share name means it is not sharable, which is the default. More...

virtual bool allowDegradation () const
 texture file may allow the driver to degrade (default is true). More...

void setAllowDegradation (bool allow)
 ===========================================================================. More...

virtual void serial (NLMISC::IStream &f) throw (NLMISC::EStream)
 Todo: serialize a mem texture. More...

 NLMISC_DECLARE_CLASS (CTextureMem)

Static Public Methods

ITextureCreate1x1WhiteTex ()
 ===========================================================================. More...


Private Attributes

uint8_Data
uint32 _Length
bool _Delete
bool _IsFile
bool _AllowDegradation
std::string _ShareName
NLMISC::CBitmap::TType _TexType
uint _TexWidth
 keep size for textures that aren't from a file. More...

uint _TexHeight
 keep size for textures that aren't from a file. More...


Detailed Description

CTextureMem.

Definition at line 42 of file texture_mem.h.


Constructor & Destructor Documentation

NL3D::CTextureMem::CTextureMem   [inline]
 

Default constructor.

Definition at line 59 of file texture_mem.h.

References _AllowDegradation, _Data, _Delete, _TexType, NLMISC::CBitmap::CBitmap, and NLMISC::CBitmap::RGBA.

Referenced by Create1x1WhiteTex.

virtual NL3D::CTextureMem::~CTextureMem   [inline, virtual]
 

Destructor.

Definition at line 70 of file texture_mem.h.

References _Data, and _Delete.

NL3D::CTextureMem::CTextureMem uint8   data,
uint32    length,
bool    _delete,
bool    isFile = true,
uint    width = 0,
uint    height = 0,
CBitmap::TType    texType = CBitmap::RGBA
[inline]
 

constructor.

Parameters:
data  Pointer of the file.
length  length, in bytes, of the datas.
_delete  Is true if the class must delete the pointer.
isFile  is true if the data must be interpreted as a texture file. Otherwise, it is interpreted as the raw datas of the texture, so the format and size of the texture must also have been set to match the raw datas
width  used only if isFile is set to false
height  used only if isFile is set to false
texType  relevant only when isFile is set to false. Gives the format to expand the texture to when it is generated.

Definition at line 89 of file texture_mem.h.

References _AllowDegradation, _Data, _Delete, data, height, setPointer, and width.


Member Function Documentation

virtual bool NL3D::CTextureMem::allowDegradation   const [inline, virtual]
 

texture file may allow the driver to degrade (default is true).

Reimplemented from NL3D::ITexture.

Definition at line 167 of file texture_mem.h.

References _AllowDegradation.

ITexture * NL3D::CTextureMem::Create1x1WhiteTex   [static]
 

===========================================================================.

Definition at line 72 of file texture_mem.cpp.

References CTextureMem.

void NL3D::CTextureMem::doGenerate   [virtual]
 

Generate the texture.

Implements NL3D::ITexture.

Definition at line 45 of file texture_mem.cpp.

References _Data, _Length, _TexHeight, _TexType, _TexWidth, NLMISC::CBitmap::buildMipMaps, NLMISC::CMemStream::fill, NLMISC::CBitmap::getPixels, NLMISC::CBitmap::load, NLMISC::CBitmap::makeDummy, and NLMISC::CBitmap::resize.

uint32 NL3D::CTextureMem::getLength   const [inline]
 

Get length of the memory file containing the texture.

Definition at line 133 of file texture_mem.h.

References _Length.

uint8* NL3D::CTextureMem::getPointer   const [inline]
 

Get the Pointer of the memory file containing the texture.

Definition at line 127 of file texture_mem.h.

References _Data.

virtual std::string NL3D::CTextureMem::getShareName   const [inline, virtual]
 

inherited from ITexture.

Reimplemented from NL3D::ITexture.

Definition at line 154 of file texture_mem.h.

References _ShareName, and nlassert.

bool NL3D::CTextureMem::isDeletable   const [inline]
 

Return true if the class handle the delete of the pointer.

Definition at line 139 of file texture_mem.h.

References _Delete.

NL3D::CTextureMem::NLMISC_DECLARE_CLASS CTextureMem   
 

virtual void NL3D::CTextureMem::serial NLMISC::IStream   f throw (NLMISC::EStream) [inline, virtual]
 

Todo: serialize a mem texture.

Reimplemented from NL3D::ITexture.

Definition at line 172 of file texture_mem.h.

References nlstop.

void NL3D::CTextureMem::setAllowDegradation bool    allow
 

===========================================================================.

Definition at line 85 of file texture_mem.cpp.

References _AllowDegradation.

void NL3D::CTextureMem::setPointer uint8   data,
uint32    length,
bool    _delete,
bool    isFile = true,
uint    width = 0,
uint    height = 0,
CBitmap::TType    texType = CBitmap::RGBA
[inline]
 

Set the pointer of the mem file containing the texture.

Parameters:
data  Pointer of the file.
length  length, in bytes, of the datas.
isFile  is true if the data must be interpreted as a texture file. Otherwise, it is interpreted as the raw datas of the texture, so the format and size of the texture must also have been set to match the raw datas
_delete  Is true if the class must delete the pointer.
texType  relevant only when isFile is set to false. Gives the format to expand the texture to when it is generated.

Definition at line 108 of file texture_mem.h.

References _Data, _Delete, _IsFile, _Length, _TexHeight, _TexType, _TexWidth, NL3D::ITexture::_Touched, data, height, and width.

Referenced by CTextureMem.

void NL3D::CTextureMem::setShareName const std::string &    shareName [inline]
 

Make this texture sharable by assigning it a share name. An empty share name means it is not sharable, which is the default.

Definition at line 161 of file texture_mem.h.

References _ShareName.

virtual bool NL3D::CTextureMem::supportSharing   const [inline, virtual]
 

inherited from ITexture.

Reimplemented from NL3D::ITexture.

Definition at line 148 of file texture_mem.h.

References _ShareName.


Member Data Documentation

bool NL3D::CTextureMem::_AllowDegradation [private]
 

Definition at line 48 of file texture_mem.h.

Referenced by allowDegradation, CTextureMem, and setAllowDegradation.

uint8* NL3D::CTextureMem::_Data [private]
 

Reimplemented from NLMISC::CBitmap.

Definition at line 44 of file texture_mem.h.

Referenced by CTextureMem, doGenerate, getPointer, setPointer, and ~CTextureMem.

bool NL3D::CTextureMem::_Delete [private]
 

Definition at line 46 of file texture_mem.h.

Referenced by CTextureMem, isDeletable, setPointer, and ~CTextureMem.

bool NL3D::CTextureMem::_IsFile [private]
 

Definition at line 47 of file texture_mem.h.

Referenced by setPointer.

uint32 NL3D::CTextureMem::_Length [private]
 

Definition at line 45 of file texture_mem.h.

Referenced by doGenerate, getLength, and setPointer.

std::string NL3D::CTextureMem::_ShareName [private]
 

Definition at line 49 of file texture_mem.h.

Referenced by getShareName, setShareName, and supportSharing.

uint NL3D::CTextureMem::_TexHeight [private]
 

keep size for textures that aren't from a file.

Definition at line 53 of file texture_mem.h.

Referenced by doGenerate, and setPointer.

NLMISC::CBitmap::TType NL3D::CTextureMem::_TexType [private]
 

Definition at line 50 of file texture_mem.h.

Referenced by CTextureMem, doGenerate, and setPointer.

uint NL3D::CTextureMem::_TexWidth [private]
 

keep size for textures that aren't from a file.

Definition at line 53 of file texture_mem.h.

Referenced by doGenerate, and setPointer.


The documentation for this class was generated from the following files: