TextureCache Class Reference

TextureCache Class Reference

#include <EdgeBleeding.h>

Class Description

Definition at line 33 of file EdgeBleeding.h.

Public Member Functions

void Request (mudbox::Texture *pTexture)
 
void Clear ()
 

Member Function Documentation

void Request ( mudbox::Texture pTexture)
inline

Definition at line 36 of file EdgeBleeding.h.

37  {
38  for( int i=0; i<cache.size(); i++ )
39  if( cache.at(i) == pTexture )
40  {
41  lastHit = i;
42  return;
43  }
44 
45  if( cache.size() >= MAX_TEXTURE_COUNT )
46  {
47  mudbox::Texture *pT = NULL;
48  if( lastHit != 0 )
49  pT = cache.takeFirst();
50  else
51  pT = cache.takeAt(1);
52  pT->AddDirtyTile( mudbox::ImgTile (0, 0, pT->Width(), pT->Height()) );
54  };
55 
56  cache.append( pTexture );
57  lastHit = cache.size() - 1;
58  if( pTexture->Location() != mudbox::TexturePool::locationGPU )
60  };
virtual void SetLocation(unsigned int iLocation)
Sets the location for the texture pool.
T takeAt(int i)
Definition: qlist.h:484
virtual void AddDirtyTile(const ImgTile &t)
Notifies the texture that part of it has changed.
Definition: material.h:1023
int size() const
Definition: qlist.h:137
virtual unsigned int Width(void) const
Returns the width of the texture in pixels.
T takeFirst()
Definition: qlist.h:489
const T & at(int i) const
Definition: qlist.h:468
virtual unsigned int Height(void) const
Returns the height of the texture in pixels.
Represents a texture tile inside a texture pool.
Definition: material.h:716
Represents a rectangle. Used to specify rectangular regions of an image.
Definition: image.h:960
void append(const T &t)
Definition: qlist.h:507
#define MAX_TEXTURE_COUNT
Definition: EdgeBleeding.h:32
virtual unsigned int Location(void) const
Gets the location for the texture pool.
void Clear ( )
inline

Definition at line 62 of file EdgeBleeding.h.

63  {
64 // for( int i=0; i<cache.size(); i++ )
65 // cache.at(i)->SetLocation( mudbox::TexturePool::locationCPU );
66 
67  cache.clear();
68  };
void clear()
Definition: qlist.h:764

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