TTexture Class Reference

This class defines texture loaded from file. More...

#include <Images.h>

Inheritance diagram for TTexture:

Inheritance graph
[legend]
Collaboration diagram for TTexture:

Collaboration graph
[legend]
List of all members.

Public Member Functions

const TStringGetName (void) const
 Returns texture name - name of file from which texture was loaded.
TTextureCopyShallow (void)
 Creates shallow copy of this texture.
void Release (void)
 Release texture.
TRendererTextureImageGetDeviceTexture (void)
 Return device texture stored inside this object.
TTextureManagerGetTextureManager (void)
 Returns texture manager where texture was created.

Friends

class TTextureManager
class TArrayPtrs< TTexture >

Detailed Description

This class defines texture loaded from file.

Texture contains its TRendererTexture for using in renderer and also contains name of file from which it was loaded.

This class has no public constructor - may be created only from texture manaager. Also can be destroyed only via texture manager.

When TTexture is created TRendererTexture is stored inside. Number of references to this device texture is always 1 - only number of references to TTexture is changing in application.

You get TTexture from TTextureManager - it find or load texture from file, increase number of references and return pointer to texture. After this you may use this texture. When you finish work with texture you call Release method that decrease number of references and destroy texture.

USING: You get texture from TTextureManager::GetTexture After work is finished call TTexture::Release.

Todo:
add method for reloading, unloading etc.

Definition at line 301 of file Images.h.


Member Function Documentation

TTexture* TTexture::CopyShallow void   )  [inline]
 

Creates shallow copy of this texture.

This means number of references is increased and pointer to this object is returned. This has the same effect as call method TTextureManager::GetTexture with name of this texture.

Definition at line 337 of file Images.h.

TRendererTextureImage* TTexture::GetDeviceTexture void   )  [inline]
 

Return device texture stored inside this object.

This method DO NOT increase number of references to device texture. You should use this method only when you can set texture to device - e.g. SetTexture(tex->GetDeviceTexture()). If you can use texture for long term then you must call AddRefs and manage texture resource properly.

Definition at line 346 of file Images.h.

const TString& TTexture::GetName void   )  const [inline]
 

Returns texture name - name of file from which texture was loaded.

Definition at line 331 of file Images.h.

TTextureManager* TTexture::GetTextureManager void   )  [inline]
 

Returns texture manager where texture was created.

Definition at line 350 of file Images.h.

void TTexture::Release void   ) 
 

Release texture.

After calling this method texture pointer is invalid!!!

Definition at line 1707 of file Images.cpp.

References DBGASSERT, and TTextureManager::DestroyTexture().

Here is the call graph for this function:


Friends And Related Function Documentation

friend class TArrayPtrs< TTexture > [friend]
 

Definition at line 305 of file Images.h.

friend class TTextureManager [friend]
 

Definition at line 304 of file Images.h.


The documentation for this class was generated from the following files:
Generated on Wed Nov 28 22:44:07 2007 for Joy4D by  doxygen 1.4.6-NO