NL3D::CTextureFileUser Class Reference

#include <texture_user.h>

Inheritance diagram for NL3D::CTextureFileUser:

NL3D::UTextureFile NL3D::CTextureUser NL3D::UTexture NL3D::UTexture

Detailed Description

UTextureFile implementation.
Author:
Lionel Berenguier

Nevrax France

Date:
2001

Definition at line 163 of file texture_user.h.

Public Types

enum  TMagFilter { Nearest = 0, Linear, MagFilterCount }
enum  TMinFilter {
  NearestMipMapOff = 0, NearestMipMapNearest, NearestMipMapLinear, LinearMipMapOff,
  LinearMipMapNearest, LinearMipMapLinear, MinFilterCount
}
enum  TUploadFormat {
  Auto = 0, RGBA8888, RGBA4444, RGBA5551,
  RGB888, RGB565, DXTC1, DXTC1Alpha,
  DXTC3, DXTC5, Luminance, Alpha,
  AlphaLuminance, DsDt, UploadFormatCount
}
enum  TWrapMode { Repeat = 0, Clamp, WrapModeCount }

Public Member Functions

virtual bool allowDegradation () const
 tells if this texture allow the driver to degrade it (default is false for UTextureFile).

virtual std::string getFileName () const
ITexturegetITexture ()
 Accessor for UMaterial imp.

virtual TMagFilter getMagFilter () const
virtual TMinFilter getMinFilter () const
virtual NLMISC::CRGBA getPixelColor (sint32 x, sint32 y) const
virtual NLMISC::CRGBA getPixelColor (sint32 x, sint32 y) const=0
virtual TUploadFormat getUploadFormat () const
virtual TWrapMode getWrapS () const
virtual TWrapMode getWrapT () const
virtual bool mipMapOff () const
virtual bool mipMapOn () const
virtual void setAllowDegradation (bool allow)
 Change the degradation mode. NB: this must be done before first render(), ie just after creation.

virtual void setFileName (std::string s)
virtual void setFilterMode (TMagFilter magf, TMinFilter minf)
virtual void setReleasable (bool bReleasable)
virtual void setReleasable (bool bReleasable)=0
virtual void setUploadFormat (TUploadFormat pf)
virtual void setWrapS (TWrapMode mode)
virtual void setWrapT (TWrapMode mode)
Object
 CTextureFileUser (std::string s)
 CTextureFileUser ()
virtual ~CTextureFileUser ()

Protected Attributes

CSmartPtr< ITexture_Texture


Member Enumeration Documentation

enum NL3D::UTexture::TMagFilter [inherited]
 

Magnification mode. Same behavior as OpenGL.

Enumeration values:
Nearest 
Linear 
MagFilterCount 

Definition at line 87 of file u_texture.h.

00088         {
00089                 Nearest=0,
00090                 Linear,
00091 
00092                 MagFilterCount
00093         };

enum NL3D::UTexture::TMinFilter [inherited]
 

Minifying mode. Same behavior as OpenGL. If the bitmap has no mipmap, and mipmap is required, then mipmaps are computed.

Enumeration values:
NearestMipMapOff 
NearestMipMapNearest 
NearestMipMapLinear 
LinearMipMapOff 
LinearMipMapNearest 
LinearMipMapLinear 
MinFilterCount 

Definition at line 98 of file u_texture.h.

enum NL3D::UTexture::TUploadFormat [inherited]
 

Enumeration values:
Auto 
RGBA8888 
RGBA4444 
RGBA5551 
RGB888 
RGB565 
DXTC1 
DXTC1Alpha 
DXTC3 
DXTC5 
Luminance 
Alpha 
AlphaLuminance 
DsDt 
UploadFormatCount 

Definition at line 64 of file u_texture.h.

00065         {
00066                 Auto= 0,
00067                 RGBA8888,
00068                 RGBA4444,
00069                 RGBA5551,
00070                 RGB888,
00071                 RGB565,
00072                 DXTC1,
00073                 DXTC1Alpha,
00074                 DXTC3,
00075                 DXTC5,
00076                 Luminance,
00077                 Alpha,
00078                 AlphaLuminance,
00079                 DsDt,
00080                 UploadFormatCount
00081         };

enum NL3D::UTexture::TWrapMode [inherited]
 

Enumeration values:
Repeat 
Clamp 
WrapModeCount 

Definition at line 56 of file u_texture.h.

00057         {
00058                 Repeat= 0,
00059                 Clamp,
00060 
00061                 WrapModeCount
00062         };


Constructor & Destructor Documentation

NL3D::CTextureFileUser::CTextureFileUser  )  [inline]
 

Definition at line 170 of file texture_user.h.

References new.

00170                            : CTextureUser(new CTextureFile)
00171         {
00172                 ((CTextureFile*)(ITexture*)_Texture)->setAllowDegradation(false);
00173         }

NL3D::CTextureFileUser::CTextureFileUser std::string  s  )  [inline]
 

Definition at line 174 of file texture_user.h.

References new, and s.

00174                                       : CTextureUser(new CTextureFile(s))
00175         {
00176                 ((CTextureFile*)(ITexture*)_Texture)->setAllowDegradation(false);
00177         }

virtual NL3D::CTextureFileUser::~CTextureFileUser  )  [inline, virtual]
 

Definition at line 178 of file texture_user.h.

00179         {
00180         }


Member Function Documentation

virtual bool NL3D::CTextureFileUser::allowDegradation  )  const [inline, virtual]
 

tells if this texture allow the driver to degrade it (default is false for UTextureFile).

Implements NL3D::UTextureFile.

Definition at line 194 of file texture_user.h.

00195         {
00196                 return _Texture->allowDegradation();
00197         }

virtual std::string NL3D::CTextureFileUser::getFileName  )  const [inline, virtual]
 

get the name of the file containing the texture

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

Implements NL3D::UTextureFile.

Definition at line 189 of file texture_user.h.

00190         {
00191                 return ((CTextureFile*)(ITexture*)_Texture)->getFileName();
00192         }

ITexture* NL3D::CTextureUser::getITexture  )  [inline, inherited]
 

Accessor for UMaterial imp.

Definition at line 147 of file texture_user.h.

References NL3D_MEM_TEXTURE.

00148         {
00149                 NL3D_MEM_TEXTURE
00150                 return _Texture;
00151         }

virtual TMagFilter NL3D::CTextureUser::getMagFilter  )  const [inline, virtual, inherited]
 

Implements NL3D::UTexture.

Definition at line 115 of file texture_user.h.

References NL3D_MEM_TEXTURE, and uint32.

00116         {
00117                 NL3D_MEM_TEXTURE
00118                 return (UTexture::TMagFilter)(uint32)_Texture->getMagFilter();
00119         }

virtual TMagFilter NL3D::UTexture::getMagFilter  )  const [pure virtual, inherited]
 

Implemented in NL3D::CTextureUser.

virtual TMinFilter NL3D::CTextureUser::getMinFilter  )  const [inline, virtual, inherited]
 

Implements NL3D::UTexture.

Definition at line 120 of file texture_user.h.

References NL3D_MEM_TEXTURE, and uint32.

00121         {
00122                 NL3D_MEM_TEXTURE
00123                 return (UTexture::TMinFilter)(uint32)_Texture->getMinFilter();
00124         }

virtual TMinFilter NL3D::UTexture::getMinFilter  )  const [pure virtual, inherited]
 

Implemented in NL3D::CTextureUser.

virtual NLMISC::CRGBA NL3D::CTextureUser::getPixelColor sint32  x,
sint32  y
const [inline, virtual, inherited]
 

Implements NL3D::UTexture.

Definition at line 135 of file texture_user.h.

References NL3D_MEM_TEXTURE, sint32, x, and y.

00136         {
00137                 NL3D_MEM_TEXTURE
00138                 return _Texture->getPixelColor(x,y);
00139         }

virtual NLMISC::CRGBA NL3D::UTexture::getPixelColor sint32  x,
sint32  y
const [pure virtual, inherited]
 

Implemented in NL3D::CTextureUser.

virtual TUploadFormat NL3D::CTextureUser::getUploadFormat  )  const [inline, virtual, inherited]
 

Implements NL3D::UTexture.

Definition at line 105 of file texture_user.h.

References NL3D_MEM_TEXTURE, and uint32.

00106         {
00107                 NL3D_MEM_TEXTURE
00108                 return (UTexture::TUploadFormat)(uint32)_Texture->getUploadFormat();
00109         }

virtual TUploadFormat NL3D::UTexture::getUploadFormat  )  const [pure virtual, inherited]
 

Implemented in NL3D::CTextureUser.

virtual TWrapMode NL3D::CTextureUser::getWrapS  )  const [inline, virtual, inherited]
 

Implements NL3D::UTexture.

Definition at line 90 of file texture_user.h.

References NL3D_MEM_TEXTURE, and uint32.

00091         {
00092                 NL3D_MEM_TEXTURE
00093                 return (UTexture::TWrapMode)(uint32)_Texture->getWrapS();
00094         }

virtual TWrapMode NL3D::UTexture::getWrapS  )  const [pure virtual, inherited]
 

Implemented in NL3D::CTextureUser.

virtual TWrapMode NL3D::CTextureUser::getWrapT  )  const [inline, virtual, inherited]
 

Implements NL3D::UTexture.

Definition at line 95 of file texture_user.h.

References NL3D_MEM_TEXTURE, and uint32.

00096         {
00097                 NL3D_MEM_TEXTURE
00098                 return (UTexture::TWrapMode)(uint32)_Texture->getWrapT();
00099         }

virtual TWrapMode NL3D::UTexture::getWrapT  )  const [pure virtual, inherited]
 

Implemented in NL3D::CTextureUser.

virtual bool NL3D::CTextureUser::mipMapOff  )  const [inline, virtual, inherited]
 

Set mipmap property to off If the texture is DXTC and has mipmap, the driver will NOT upload them in VRAM if the user dont want them.

Implements NL3D::UTexture.

Definition at line 125 of file texture_user.h.

References NL3D_MEM_TEXTURE.

00126         {
00127                 NL3D_MEM_TEXTURE
00128                 return _Texture->mipMapOff();
00129         }

virtual bool NL3D::UTexture::mipMapOff  )  const [pure virtual, inherited]
 

Set mipmap property to off If the texture is DXTC and has mipmap, the driver will NOT upload them in VRAM if the user dont want them.

Implemented in NL3D::CTextureUser.

virtual bool NL3D::CTextureUser::mipMapOn  )  const [inline, virtual, inherited]
 

Set mipmap property to on If the texture is DXTC and has no mipmap the driver will NOT create them. (This is due to performance: to create mipmap in DXTC the driver have to decompress the texture, create the mipmap and recompress the texture to upload it in VRAM. This is really time consuming and texture quality is altered, so the driver will not create them).

Implements NL3D::UTexture.

Definition at line 130 of file texture_user.h.

References NL3D_MEM_TEXTURE.

00131         {
00132                 NL3D_MEM_TEXTURE
00133                 return _Texture->mipMapOn();
00134         }

virtual bool NL3D::UTexture::mipMapOn  )  const [pure virtual, inherited]
 

Set mipmap property to on If the texture is DXTC and has no mipmap the driver will NOT create them. (This is due to performance: to create mipmap in DXTC the driver have to decompress the texture, create the mipmap and recompress the texture to upload it in VRAM. This is really time consuming and texture quality is altered, so the driver will not create them).

Implemented in NL3D::CTextureUser.

virtual void NL3D::CTextureFileUser::setAllowDegradation bool  allow  )  [inline, virtual]
 

Change the degradation mode. NB: this must be done before first render(), ie just after creation.

Implements NL3D::UTextureFile.

Definition at line 198 of file texture_user.h.

00199         {
00200                 ((CTextureFile*)(ITexture*)_Texture)->setAllowDegradation(allow);
00201         }

virtual void NL3D::CTextureFileUser::setFileName std::string  s  )  [inline, virtual]
 

Set the name of the file containing the texture

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

Implements NL3D::UTextureFile.

Definition at line 184 of file texture_user.h.

References s.

00185         {
00186                 ((CTextureFile*)(ITexture*)_Texture)->setFileName(s);
00187         }

virtual void NL3D::CTextureUser::setFilterMode TMagFilter  magf,
TMinFilter  minf
[inline, virtual, inherited]
 

Implements NL3D::UTexture.

Definition at line 110 of file texture_user.h.

References NL3D_MEM_TEXTURE, and uint32.

00111         {
00112                 NL3D_MEM_TEXTURE
00113                 _Texture->setFilterMode((ITexture::TMagFilter)(uint32)magf, (ITexture::TMinFilter)(uint32)minf);
00114         }

virtual void NL3D::UTexture::setFilterMode TMagFilter  magf,
TMinFilter  minf
[pure virtual, inherited]
 

Implemented in NL3D::CTextureUser.

virtual void NL3D::CTextureUser::setReleasable bool  bReleasable  )  [inline, virtual, inherited]
 

Implements NL3D::UTexture.

Definition at line 140 of file texture_user.h.

References NL3D_MEM_TEXTURE.

00141         {
00142                 NL3D_MEM_TEXTURE
00143                 _Texture->setReleasable(bReleasable);
00144         }

virtual void NL3D::UTexture::setReleasable bool  bReleasable  )  [pure virtual, inherited]
 

Implemented in NL3D::CTextureUser.

virtual void NL3D::CTextureUser::setUploadFormat TUploadFormat  pf  )  [inline, virtual, inherited]
 

Replace the uploaded format of the texture. If "Auto", the driver use CBitmap::getPixelFormat() to find the best associated pixelFormat. When no alpha is wanted (RGB, Luminance....), texture default output is 1.0. For "Alpha" mode, RGB output is (0,0,0).

Implements NL3D::UTexture.

Definition at line 100 of file texture_user.h.

References NL3D_MEM_TEXTURE, and uint32.

00101         {
00102                 NL3D_MEM_TEXTURE
00103                 _Texture->setUploadFormat((ITexture::TUploadFormat)(uint32)pf);
00104         }

virtual void NL3D::UTexture::setUploadFormat TUploadFormat  pf  )  [pure virtual, inherited]
 

Replace the uploaded format of the texture. If "Auto", the driver use CBitmap::getPixelFormat() to find the best associated pixelFormat. When no alpha is wanted (RGB, Luminance....), texture default output is 1.0. For "Alpha" mode, RGB output is (0,0,0).

Implemented in NL3D::CTextureUser.

virtual void NL3D::CTextureUser::setWrapS TWrapMode  mode  )  [inline, virtual, inherited]
 

By default, parameters are:

  • WrapS==Repeat
  • WrapT==Repeat
  • UploadFormat== Auto
  • MagFilter== Linear.
  • MinFilter= LinearMipMapLinear.

NB: if multiple ITexture acces the same data via the sharing system (such as a CTextureFile), then:

  • WrapS/WrapT is LOCAL for each ITexture (ie each ITexture will have his own Wrap mode) => no duplication is made.
  • UploadFormat may duplicate the texture in video memory. There is one texture per different UploadFormat.
  • MinFilter may duplicate the texture in video memory in the same way, wether the texture has mipmap or not.

Implements NL3D::UTexture.

Definition at line 80 of file texture_user.h.

References NL3D_MEM_TEXTURE, and uint32.

00081         {
00082                 NL3D_MEM_TEXTURE
00083                 _Texture->setWrapS((ITexture::TWrapMode)(uint32)mode);
00084         }

virtual void NL3D::UTexture::setWrapS TWrapMode  mode  )  [pure virtual, inherited]
 

By default, parameters are:

  • WrapS==Repeat
  • WrapT==Repeat
  • UploadFormat== Auto
  • MagFilter== Linear.
  • MinFilter= LinearMipMapLinear.

NB: if multiple ITexture acces the same data via the sharing system (such as a CTextureFile), then:

  • WrapS/WrapT is LOCAL for each ITexture (ie each ITexture will have his own Wrap mode) => no duplication is made.
  • UploadFormat may duplicate the texture in video memory. There is one texture per different UploadFormat.
  • MinFilter may duplicate the texture in video memory in the same way, wether the texture has mipmap or not.

Implemented in NL3D::CTextureUser.

virtual void NL3D::CTextureUser::setWrapT TWrapMode  mode  )  [inline, virtual, inherited]
 

Implements NL3D::UTexture.

Definition at line 85 of file texture_user.h.

References NL3D_MEM_TEXTURE, and uint32.

00086         {
00087                 NL3D_MEM_TEXTURE
00088                 _Texture->setWrapT((ITexture::TWrapMode)(uint32)mode);
00089         }

virtual void NL3D::UTexture::setWrapT TWrapMode  mode  )  [pure virtual, inherited]
 

Implemented in NL3D::CTextureUser.


Field Documentation

CSmartPtr<ITexture> NL3D::CTextureUser::_Texture [protected, inherited]
 

Definition at line 54 of file texture_user.h.


The documentation for this class was generated from the following file:
Generated on Tue Mar 16 07:58:15 2004 for NeL by doxygen 1.3.6