mirror of
https://github.com/glest/glest-source.git
synced 2025-08-09 01:46:28 +02:00
- added the ability to track pixmap memory usage at start and end of a game
This commit is contained in:
@@ -19,6 +19,7 @@
|
||||
|
||||
using std::string;
|
||||
using Shared::Platform::uint8;
|
||||
using Shared::Platform::uint64;
|
||||
|
||||
namespace Shared{ namespace Graphics{
|
||||
|
||||
@@ -81,6 +82,7 @@ public:
|
||||
virtual void end()=0;
|
||||
virtual string getPath() const = 0;
|
||||
virtual void deletePixels() = 0;
|
||||
virtual uint64 getPixelByteCount() const = 0;
|
||||
|
||||
virtual void reseInitState() { inited = false; }
|
||||
|
||||
@@ -104,6 +106,7 @@ public:
|
||||
const Pixmap1D *getPixmap() const {return &pixmap;}
|
||||
virtual string getPath() const;
|
||||
virtual void deletePixels();
|
||||
virtual uint64 getPixelByteCount() const {return pixmap.getPixelByteCount();}
|
||||
};
|
||||
|
||||
// =====================================================
|
||||
@@ -121,6 +124,7 @@ public:
|
||||
const Pixmap2D *getPixmap() const {return &pixmap;}
|
||||
virtual string getPath() const;
|
||||
virtual void deletePixels();
|
||||
virtual uint64 getPixelByteCount() const {return pixmap.getPixelByteCount();}
|
||||
};
|
||||
|
||||
// =====================================================
|
||||
@@ -138,6 +142,7 @@ public:
|
||||
const Pixmap3D *getPixmap() const {return &pixmap;}
|
||||
virtual string getPath() const;
|
||||
virtual void deletePixels();
|
||||
virtual uint64 getPixelByteCount() const {return pixmap.getPixelByteCount();}
|
||||
};
|
||||
|
||||
// =====================================================
|
||||
@@ -155,6 +160,7 @@ public:
|
||||
const PixmapCube *getPixmap() const {return &pixmap;}
|
||||
virtual string getPath() const;
|
||||
virtual void deletePixels();
|
||||
virtual uint64 getPixelByteCount() const {return pixmap.getPixelByteCount();}
|
||||
};
|
||||
|
||||
}}//end namespace
|
||||
|
@@ -23,11 +23,10 @@ namespace Shared{ namespace Graphics{
|
||||
// =====================================================
|
||||
// class TextureManager
|
||||
// =====================================================
|
||||
typedef vector<Texture*> TextureContainer;
|
||||
|
||||
//manages textures, creation on request and deletion on destruction
|
||||
class TextureManager{
|
||||
protected:
|
||||
typedef vector<Texture*> TextureContainer;
|
||||
|
||||
protected:
|
||||
TextureContainer textures;
|
||||
@@ -56,6 +55,8 @@ public:
|
||||
Texture2D *newTexture2D();
|
||||
Texture3D *newTexture3D();
|
||||
TextureCube *newTextureCube();
|
||||
|
||||
const TextureContainer &getTextures() const {return textures;}
|
||||
};
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user