# 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::CTextureFile Class Reference

CTextureFile. More...

#include <texture_file.h>

Inheritance diagram for NL3D::CTextureFile:

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

Public Methods

 CTextureFile ()
 Default constructor. More...

 CTextureFile (const CTextureFile &other)
CTextureFile & operator= (const CTextureFile &other)
 CTextureFile (const std::string &s)
 constructor. More...

void setFileName (const std::string &s)
 Set the name of the file containing the texture. More...

const std::string & getFileName () const
 get the name of the file containing the texture. More...

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

void setAllowDegradation (bool allow)
 Change the degradation mode. NB: this does not touch() the ITexture... This state is serialized. More...

virtual bool supportSharing () const
 sharing system. More...

virtual std::string getShareName () const
 Return the Unique ident/name of the texture, used for Driver sharing caps. More...

void enableSharing (bool enable)
void doGenerate ()
 Generate the texture, looking in CPath if necessary. More...

void setAsyncLoading (bool isAsync)
 Async loadingg system. More...

virtual void serial (NLMISC::IStream &f) throw (NLMISC::EStream)
 Save the texture file name. More...

 NLMISC_DECLARE_CLASS (CTextureFile)
void setMipMapSkipAtLoad (uint8 level)
 If the file is a DDS texture with mipmap, skip the first skipLod mipmaps (0 by default) at loading. More...

uint8 getMipMapSkipAtLoad () const

Static Public Methods

void buildBitmapFromFile (NLMISC::CBitmap &dest, const std::string &fileName, bool asyncload, uint8 mipMapSkip=0)
 ==================================================================. More...


Private Methods

void dupInfo (const CTextureFile &other)

Private Attributes

std::string _FileName
bool _AllowDegradation
bool _AsyncLoading
bool _SupportSharing
uint8 _MipMapSkipAtLoad

Detailed Description

CTextureFile.

Author:
Stephane Coutelas , Nevrax France
Date:
2000

Definition at line 44 of file texture_file.h.


Constructor & Destructor Documentation

NL3D::CTextureFile::CTextureFile   [inline]
 

Default constructor.

Author:
Stephane Coutelas
Date:
2000

Definition at line 53 of file texture_file.h.

References _AllowDegradation, _AsyncLoading, _MipMapSkipAtLoad, and _SupportSharing.

NL3D::CTextureFile::CTextureFile const CTextureFile &    other
 

Definition at line 230 of file texture_file.cpp.

References dupInfo.

NL3D::CTextureFile::CTextureFile const std::string &    s [inline]
 

constructor.

Author:
Stephane Coutelas
Date:
2000

Definition at line 66 of file texture_file.h.

References _AllowDegradation, _AsyncLoading, _FileName, _MipMapSkipAtLoad, _SupportSharing, s, and NL3D::ITexture::touch.


Member Function Documentation

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

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

Reimplemented from NL3D::ITexture.

Definition at line 93 of file texture_file.h.

References _AllowDegradation.

void NL3D::CTextureFile::buildBitmapFromFile NLMISC::CBitmap   dest,
const std::string &    fileName,
bool    asyncload,
uint8    mipMapSkip = 0
[static]
 

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

Definition at line 41 of file texture_file.cpp.

References NLMISC::CIFile::allowBNPCacheFileOnOpen, NLMISC::CBitmap::CBitmap, NLMISC::clamp, file, NLMISC::CBitmap::getHeight, NLMISC::CBitmap::getPixels, NLMISC::CBitmap::getWidth, NLMISC::CBitmap::load, NLMISC::CBitmap::makeDummy, nlinfo, nlwarning, NLMISC::CIFile::open, NLMISC::CBitmap::PixelFormat, r, NLMISC::CBitmap::RGBA, NLMISC::CIFile::setAsyncLoading, and NLMISC::CIFile::setCacheFileOnOpen.

Referenced by doGenerate.

void NL3D::CTextureFile::doGenerate   [virtual]
 

Generate the texture, looking in CPath if necessary.

Author:
Stephane Coutelas
Date:
2000

Implements NL3D::ITexture.

Definition at line 186 of file texture_file.cpp.

References _AsyncLoading, _FileName, _MipMapSkipAtLoad, and buildBitmapFromFile.

void NL3D::CTextureFile::dupInfo const CTextureFile &    other [private]
 

Definition at line 245 of file texture_file.cpp.

References _AllowDegradation, _AsyncLoading, _FileName, _MipMapSkipAtLoad, and _SupportSharing.

Referenced by CTextureFile, and operator=.

void NL3D::CTextureFile::enableSharing bool    enable
 

Definition at line 256 of file texture_file.cpp.

References _SupportSharing.

const std::string& NL3D::CTextureFile::getFileName   const [inline]
 

get the name of the file containing the texture.

Returns:
name of the file
Author:
Stephane Coutelas
Date:
2000

Definition at line 89 of file texture_file.h.

References _FileName.

uint8 NL3D::CTextureFile::getMipMapSkipAtLoad   const [inline]
 

Definition at line 131 of file texture_file.h.

References _MipMapSkipAtLoad.

std::string NL3D::CTextureFile::getShareName   const [virtual]
 

Return the Unique ident/name of the texture, used for Driver sharing caps.

Deriver should add a prefix for their texture type. eg "file::pipoland", "noise::4-4-2" etc....

Reimplemented from NL3D::ITexture.

Definition at line 268 of file texture_file.cpp.

References _FileName.

NL3D::CTextureFile::NLMISC_DECLARE_CLASS CTextureFile   
 

CTextureFile & NL3D::CTextureFile::operator= const CTextureFile &    other
 

Definition at line 236 of file texture_file.cpp.

References dupInfo, and NL3D::ITexture::ITexture.

void NL3D::CTextureFile::serial NLMISC::IStream   f throw (NLMISC::EStream) [virtual]
 

Save the texture file name.

Reimplemented from NL3D::ITexture.

Definition at line 199 of file texture_file.cpp.

void NL3D::CTextureFile::setAllowDegradation bool    allow
 

Change the degradation mode. NB: this does not touch() the ITexture... This state is serialized.

Definition at line 224 of file texture_file.cpp.

References _AllowDegradation.

void NL3D::CTextureFile::setAsyncLoading bool    isAsync
 

Async loadingg system.

Definition at line 192 of file texture_file.cpp.

References _AsyncLoading.

void NL3D::CTextureFile::setFileName const std::string &    s [inline]
 

Set the name of the file containing the texture.

Parameters:
name  of the file
Author:
Stephane Coutelas
Date:
2000

Definition at line 80 of file texture_file.h.

References _FileName, s, and NL3D::ITexture::touch.

void NL3D::CTextureFile::setMipMapSkipAtLoad uint8    level
 

If the file is a DDS texture with mipmap, skip the first skipLod mipmaps (0 by default) at loading.

Definition at line 262 of file texture_file.cpp.

References _MipMapSkipAtLoad, and level.

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

sharing system.

Author:
Lionel Berenguier
Date:
2000

Reimplemented from NL3D::ITexture.

Definition at line 103 of file texture_file.h.

References _SupportSharing.


Member Data Documentation

bool NL3D::CTextureFile::_AllowDegradation [private]
 

Definition at line 136 of file texture_file.h.

Referenced by allowDegradation, CTextureFile, dupInfo, and setAllowDegradation.

bool NL3D::CTextureFile::_AsyncLoading [private]
 

Definition at line 137 of file texture_file.h.

Referenced by CTextureFile, doGenerate, dupInfo, and setAsyncLoading.

std::string NL3D::CTextureFile::_FileName [private]
 

Definition at line 135 of file texture_file.h.

Referenced by CTextureFile, doGenerate, dupInfo, getFileName, getShareName, and setFileName.

uint8 NL3D::CTextureFile::_MipMapSkipAtLoad [private]
 

Definition at line 139 of file texture_file.h.

Referenced by CTextureFile, doGenerate, dupInfo, getMipMapSkipAtLoad, and setMipMapSkipAtLoad.

bool NL3D::CTextureFile::_SupportSharing [private]
 

Definition at line 138 of file texture_file.h.

Referenced by CTextureFile, dupInfo, enableSharing, and supportSharing.


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