xoreos  0.0.5
Public Member Functions | Static Public Member Functions | Protected Member Functions | Static Protected Member Functions | Protected Attributes | List of all members
Graphics::Aurora::Texture Class Reference

A texture. More...

#include <texture.h>

Inheritance diagram for Graphics::Aurora::Texture:
Inheritance graph
[legend]
Collaboration diagram for Graphics::Aurora::Texture:
Collaboration graph
[legend]

Public Member Functions

virtual ~Texture ()
 
uint32 getWidth () const
 
uint32 getHeight () const
 
bool hasAlpha () const
 
virtual bool isDynamic () const
 Is this a dynamic texture, or a shared static one? More...
 
const TXIgetTXI () const
 Return the TXI. More...
 
const ImageDecodergetImage () const
 Return the image. More...
 
virtual bool reload ()
 Try to reload the texture. More...
 
bool dumpTGA (const Common::UString &fileName) const
 Dump the texture into a TGA. More...
 
- Public Member Functions inherited from Graphics::Texture
 Texture ()
 
 ~Texture ()
 
TextureID getID () const
 
- Public Member Functions inherited from Graphics::GLContainer
 GLContainer ()
 
 ~GLContainer ()
 
void rebuild ()
 
void destroy ()
 
- Public Member Functions inherited from Graphics::Queueable
 Queueable ()
 
virtual ~Queueable ()
 
virtual bool operator< (const Queueable &q) const
 

Static Public Member Functions

static ImageDecoderloadImage (const Common::UString &name, bool deswizzle=false)
 Load an image in any of the common texture formats. More...
 
static ImageDecoderloadImage (const Common::UString &name, ::Aurora::FileType &type, bool deswizzle=false)
 Load an image in any of the common texture formats. More...
 
static Texturecreate (const Common::UString &name, bool deswizzle=false)
 Create a texture from this image resource. More...
 
static Texturecreate (ImageDecoder *image, ::Aurora::FileType type=::Aurora::kFileTypeNone, TXI *txi=0, bool deswizzle=false)
 Take over the image and create a texture from it. More...
 

Protected Member Functions

 Texture ()
 
 Texture (const Common::UString &name, ImageDecoder *image, ::Aurora::FileType type, TXI *txi=0, bool deswizzle=false)
 
void set (const Common::UString &name, ImageDecoder *image, ::Aurora::FileType type, TXI *txi, bool deswizzle=false)
 
void addToQueues ()
 
void removeFromQueues ()
 
void refresh ()
 
void doRebuild ()
 
void doDestroy ()
 
void create2DTexture ()
 
void createCubeMapTexture ()
 
void setWrap (GLenum target, GLint wrapModeX, GLint wrapModeY)
 
void setAlign ()
 
void setFilter (GLenum target)
 
void setMipMaps (GLenum target)
 
void setMipMapData (GLenum target, size_t layer, size_t mipMap)
 
- Protected Member Functions inherited from Graphics::Queueable
bool isInQueue (QueueType queue) const
 
void addToQueue (QueueType queue)
 
void removeFromQueue (QueueType queue)
 
void lockQueue (QueueType queue)
 
void unlockQueue (QueueType queue)
 
void sortQueue (QueueType queue)
 

Static Protected Member Functions

static TXIloadTXI (const Common::UString &name)
 
static ImageDecoderloadImage (Common::SeekableReadStream *imageStream, ::Aurora::FileType type, TXI *txi=0, bool deswizzle=false)
 
static ImageDecoderloadImage (const Common::UString &name, ::Aurora::FileType &type, TXI *txi, bool deswizzle=false)
 
static TexturecreatePLT (const Common::UString &name, Common::SeekableReadStream *imageStream)
 

Protected Attributes

Common::UString _name
 The name of the texture's image's file. More...
 
::Aurora::FileType _type
 The type of the texture's image's file. More...
 
Common::ScopedPtr< ImageDecoder_image
 The actual image. More...
 
Common::ScopedPtr< TXI_txi
 The TXI. More...
 
uint32 _width
 
uint32 _height
 
bool _deswizzle
 
- Protected Attributes inherited from Graphics::Texture
TextureID _textureID
 OpenGL texture ID. More...
 

Detailed Description

A texture.

Definition at line 48 of file texture.h.

Constructor & Destructor Documentation

◆ ~Texture()

Graphics::Aurora::Texture::~Texture ( )
virtual

Definition at line 69 of file texture.cpp.

References Graphics::Texture::_textureID, GfxMan, and removeFromQueues().

Here is the call graph for this function:

◆ Texture() [1/2]

Graphics::Aurora::Texture::Texture ( )
protected

Definition at line 58 of file texture.cpp.

Referenced by create().

Here is the caller graph for this function:

◆ Texture() [2/2]

Graphics::Aurora::Texture::Texture ( const Common::UString name,
ImageDecoder image,
::Aurora::FileType  type,
TXI txi = 0,
bool  deswizzle = false 
)
protected

Definition at line 61 of file texture.cpp.

References addToQueues().

Here is the call graph for this function:

Member Function Documentation

◆ addToQueues()

void Graphics::Aurora::Texture::addToQueues ( )
protected

Definition at line 407 of file texture.cpp.

References Graphics::Queueable::addToQueue(), Graphics::kQueueNewTexture, and Graphics::kQueueTexture.

Referenced by Graphics::Aurora::PLTFile::load(), refresh(), reload(), and Texture().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ create() [1/2]

Texture * Graphics::Aurora::Texture::create ( const Common::UString name,
bool  deswizzle = false 
)
static

◆ create() [2/2]

Texture * Graphics::Aurora::Texture::create ( ImageDecoder image,
::Aurora::FileType  type = ::Aurora::kFileTypeNone,
TXI txi = 0,
bool  deswizzle = false 
)
static

Take over the image and create a texture from it.

Definition at line 376 of file texture.cpp.

References Graphics::ImageDecoder::getMipMapCount(), and Texture().

Here is the call graph for this function:

◆ create2DTexture()

void Graphics::Aurora::Texture::create2DTexture ( )
protected

Definition at line 256 of file texture.cpp.

References _image, Graphics::Texture::_textureID, setAlign(), setFilter(), setMipMapData(), setMipMaps(), and setWrap().

Referenced by doRebuild().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ createCubeMapTexture()

void Graphics::Aurora::Texture::createCubeMapTexture ( )
protected

Definition at line 277 of file texture.cpp.

References _image, Graphics::Texture::_textureID, setAlign(), setFilter(), setMipMapData(), setMipMaps(), and setWrap().

Referenced by doRebuild().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ createPLT()

Texture * Graphics::Aurora::Texture::createPLT ( const Common::UString name,
Common::SeekableReadStream imageStream 
)
staticprotected

Definition at line 310 of file texture.cpp.

Referenced by create().

Here is the caller graph for this function:

◆ doDestroy()

void Graphics::Aurora::Texture::doDestroy ( )
protectedvirtual

Implements Graphics::GLContainer.

Definition at line 146 of file texture.cpp.

References Graphics::Texture::_textureID.

◆ doRebuild()

void Graphics::Aurora::Texture::doRebuild ( )
protectedvirtual

Implements Graphics::GLContainer.

Definition at line 155 of file texture.cpp.

References _image, Graphics::Texture::_textureID, create2DTexture(), and createCubeMapTexture().

Here is the call graph for this function:

◆ dumpTGA()

bool Graphics::Aurora::Texture::dumpTGA ( const Common::UString fileName) const

Dump the texture into a TGA.

Definition at line 139 of file texture.cpp.

References _image.

◆ getHeight()

uint32 Graphics::Aurora::Texture::getHeight ( ) const

◆ getImage()

const ImageDecoder & Graphics::Aurora::Texture::getImage ( ) const

Return the image.

Definition at line 106 of file texture.cpp.

References _image.

Referenced by Graphics::Aurora::ModelNode_Witcher::buildMaterial(), and Graphics::Aurora::ModelNode::buildMaterial().

Here is the caller graph for this function:

◆ getTXI()

const TXI & Graphics::Aurora::Texture::getTXI ( ) const

Return the TXI.

Definition at line 96 of file texture.cpp.

References _image, _txi, and Graphics::Aurora::kEmptyTXI.

Referenced by Graphics::Aurora::GUIQuad::GUIQuad(), Graphics::Aurora::TextureFont::load(), and setFilter().

Here is the caller graph for this function:

◆ getWidth()

uint32 Graphics::Aurora::Texture::getWidth ( ) const

◆ hasAlpha()

bool Graphics::Aurora::Texture::hasAlpha ( ) const

Definition at line 84 of file texture.cpp.

References _image.

Referenced by Graphics::Aurora::BorderQuad::render(), Graphics::Aurora::CubeSide::render(), Engines::NWN::Portrait::render(), and Graphics::Aurora::GUIQuad::render().

Here is the caller graph for this function:

◆ isDynamic()

bool Graphics::Aurora::Texture::isDynamic ( ) const
virtual

Is this a dynamic texture, or a shared static one?

Reimplemented in Graphics::Aurora::PLTFile.

Definition at line 91 of file texture.cpp.

Referenced by Graphics::Aurora::TextureManager::get().

Here is the caller graph for this function:

◆ loadImage() [1/4]

ImageDecoder * Graphics::Aurora::Texture::loadImage ( const Common::UString name,
bool  deswizzle = false 
)
static

◆ loadImage() [2/4]

ImageDecoder * Graphics::Aurora::Texture::loadImage ( const Common::UString name,
::Aurora::FileType type,
bool  deswizzle = false 
)
static

Load an image in any of the common texture formats.

Definition at line 422 of file texture.cpp.

References loadImage().

Here is the call graph for this function:

◆ loadImage() [3/4]

ImageDecoder * Graphics::Aurora::Texture::loadImage ( Common::SeekableReadStream imageStream,
::Aurora::FileType  type,
TXI txi = 0,
bool  deswizzle = false 
)
staticprotected

◆ loadImage() [4/4]

ImageDecoder * Graphics::Aurora::Texture::loadImage ( const Common::UString name,
::Aurora::FileType type,
TXI txi,
bool  deswizzle = false 
)
staticprotected

◆ loadTXI()

TXI * Graphics::Aurora::Texture::loadTXI ( const Common::UString name)
staticprotected

Definition at line 502 of file texture.cpp.

References Common::UString::c_str(), Common::exceptionDispatcherWarning(), Aurora::kFileTypeTXI, and ResMan.

Referenced by create(), and reload().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ refresh()

void Graphics::Aurora::Texture::refresh ( )
protected

Definition at line 417 of file texture.cpp.

References addToQueues(), and removeFromQueues().

Referenced by Graphics::Aurora::PLTFile::rebuild().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ reload()

bool Graphics::Aurora::Texture::reload ( )
virtual

Try to reload the texture.

Reimplemented in Graphics::Aurora::PLTFile.

Definition at line 112 of file texture.cpp.

References _deswizzle, _name, Common::StackException::add(), addToQueues(), Common::UString::c_str(), Common::UString::empty(), Aurora::kFileTypeNone, loadImage(), loadTXI(), and removeFromQueues().

Here is the call graph for this function:

◆ removeFromQueues()

void Graphics::Aurora::Texture::removeFromQueues ( )
protected

Definition at line 412 of file texture.cpp.

References Graphics::kQueueNewTexture, Graphics::kQueueTexture, and Graphics::Queueable::removeFromQueue().

Referenced by refresh(), reload(), and ~Texture().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ set()

void Graphics::Aurora::Texture::set ( const Common::UString name,
ImageDecoder image,
::Aurora::FileType  type,
TXI txi,
bool  deswizzle = false 
)
protected

Definition at line 386 of file texture.cpp.

References _deswizzle, _height, _image, _name, _txi, _type, and _width.

◆ setAlign()

void Graphics::Aurora::Texture::setAlign ( )
protected

◆ setFilter()

void Graphics::Aurora::Texture::setFilter ( GLenum  target)
protected

Definition at line 216 of file texture.cpp.

References Graphics::TXI::Features::filter, Graphics::TXI::getFeatures(), and getTXI().

Referenced by create2DTexture(), and createCubeMapTexture().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ setMipMapData()

void Graphics::Aurora::Texture::setMipMapData ( GLenum  target,
size_t  layer,
size_t  mipMap 
)
protected

◆ setMipMaps()

void Graphics::Aurora::Texture::setMipMaps ( GLenum  target)
protected

Definition at line 228 of file texture.cpp.

References _image.

Referenced by create2DTexture(), and createCubeMapTexture().

Here is the caller graph for this function:

◆ setWrap()

void Graphics::Aurora::Texture::setWrap ( GLenum  target,
GLint  wrapModeX,
GLint  wrapModeY 
)
protected

Definition at line 172 of file texture.cpp.

Referenced by create2DTexture(), and createCubeMapTexture().

Here is the caller graph for this function:

Member Data Documentation

◆ _deswizzle

bool Graphics::Aurora::Texture::_deswizzle
protected

Definition at line 95 of file texture.h.

Referenced by reload(), and set().

◆ _height

uint32 Graphics::Aurora::Texture::_height
protected

Definition at line 93 of file texture.h.

Referenced by Graphics::Aurora::PLTFile::build(), getHeight(), and set().

◆ _image

Common::ScopedPtr<ImageDecoder> Graphics::Aurora::Texture::_image
protected

◆ _name

Common::UString Graphics::Aurora::Texture::_name
protected

The name of the texture's image's file.

Definition at line 86 of file texture.h.

Referenced by reload(), and set().

◆ _txi

Common::ScopedPtr<TXI> Graphics::Aurora::Texture::_txi
protected

The TXI.

Definition at line 90 of file texture.h.

Referenced by getTXI(), and set().

◆ _type

::Aurora::FileType Graphics::Aurora::Texture::_type
protected

The type of the texture's image's file.

Definition at line 87 of file texture.h.

Referenced by set().

◆ _width

uint32 Graphics::Aurora::Texture::_width
protected

Definition at line 92 of file texture.h.

Referenced by Graphics::Aurora::PLTFile::build(), getWidth(), and set().


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