#include <rTexture.h>
Public Member Functions | |
virtual | ~rITexture ()=0 |
destructor | |
void | Select (bool enforce=false) |
Selects the texture for rendering. | |
void | Unload () |
Unloads the texture from OpenGL and memory. | |
Static Public Member Functions | |
static void | UnloadAll () |
Unloads all textures from memory. | |
static void | LoadAll () |
Loads all active textures. | |
Protected Member Functions | |
rITexture () | |
constructor | |
virtual void | OnSelect (bool enforce)=0 |
Selects the texture for rendering. | |
virtual void | OnUnload ()=0 |
Unloads the texture from OpenGL and memory. | |
Private Member Functions | |
rITexture (rITexture const &) | |
rITexture & | operator= (rITexture const &) |
Private Attributes | |
int | id_ |
ID number of this texture. | |
Static Private Attributes | |
static tList< rITexture > | s_textures_ |
list of all textures |
Definition at line 96 of file rTexture.h.
rITexture::~rITexture | ( | void | ) | [pure virtual] |
destructor
Definition at line 339 of file rTexture.cpp.
References id_, tList< T, MALLOC, REFERENCE >::Remove(), and s_textures_.
00340 { 00341 s_textures_.Remove(this,id_); 00342 }
rITexture::rITexture | ( | void | ) | [protected] |
rITexture::rITexture | ( | rITexture const & | ) | [private] |
static rCallbackBeforeScreenModeChange unload & rITexture::UnloadAll | ( | void | ) | [static] |
Unloads all textures from memory.
Definition at line 353 of file rTexture.cpp.
References GrowingArrayBase::Len(), and s_textures_.
Referenced by cleanup(), main(), and uMenu::Message().
00354 { 00355 for(int i=s_textures_.Len()-1;i>=0;i--) 00356 { 00357 s_textures_(i)->Unload(); 00358 } 00359 }
void rITexture::LoadAll | ( | void | ) | [static] |
Loads all active textures.
Definition at line 370 of file rTexture.cpp.
References GrowingArrayBase::Len(), and s_textures_.
Referenced by init_game_objects(), and gGame::StateUpdate().
00371 { 00372 // s_reportErrors=false; 00373 for(int i=s_textures_.Len()-1;i>=0;i--) 00374 { 00375 s_textures_(i)->Select(); 00376 //if (i>=s_textures.Len()) 00377 // i=s_textures.Len()-1; 00378 } 00379 // s_reportErrors=true; 00380 }
void rITexture::Select | ( | bool | enforce = false |
) | [inline] |
Selects the texture for rendering.
enforce | when set to true, the texture should be loaded even if the configuration says it should not |
Definition at line 358 of file rTexture.h.
References OnSelect().
Referenced by dir_eWall_select(), gLogo::Display(), gFloor::glFloorTexture(), gFloor::glFloorTexture_a(), gFloor::glFloorTexture_b(), gTextureCycle::gTextureCycle(), gWallRim_helper(), gCycle::Render(), rFontContainer::Render(), rFont::Render(), rResourceTexture::Select(), sky_select(), and sr_MotionBlurCore().
00359 { 00360 this->OnSelect( enforce ); 00361 }
void rITexture::Unload | ( | ) | [inline] |
Unloads the texture from OpenGL and memory.
Definition at line 372 of file rTexture.h.
References OnUnload().
Referenced by rISurfaceTexture::OnSelect(), and rResourceTexture::InternalTex::Release().
00373 { 00374 this->OnUnload(); 00375 }
void rITexture::OnSelect | ( | bool | enforce | ) | [protected, pure virtual] |
Selects the texture for rendering.
enforce | enforce when set to true, the texture should be loaded even if the configuration says it should not |
Implemented in rFont, rISurfaceTexture, rTextureRenderTarget, and gTextureCycle.
Definition at line 406 of file rTexture.cpp.
References tList< T, MALLOC, REFERENCE >::Add(), id_, and s_textures_.
Referenced by rISurfaceTexture::OnSelect(), and Select().
00407 { 00408 if ( id_ < 0 ) 00409 s_textures_.Add(this,id_); 00410 }
void rITexture::OnUnload | ( | void | ) | [protected, pure virtual] |
Unloads the texture from OpenGL and memory.
Implemented in rISurfaceTexture, and rTextureRenderTarget.
Definition at line 421 of file rTexture.cpp.
Referenced by rISurfaceTexture::OnUnload(), and Unload().
tList< rITexture > rITexture::s_textures_ [static, private] |
list of all textures
Definition at line 113 of file rTexture.h.
Referenced by LoadAll(), OnSelect(), UnloadAll(), and ~rITexture().
int rITexture::id_ [private] |
ID number of this texture.
Definition at line 114 of file rTexture.h.
Referenced by OnSelect(), and ~rITexture().