#pragma once #include "Array.h" #include "Critical.h" namespace Framework { class Texture; //! Texture.h //! Manages all loaded texture data so that multiple drawings can use //! the same data class TextureList : public virtual ReferenceCounter { private: static int id; static Critical cs; RCArray* textures; RCArray* names; public: //! Constructor TextureList(); //! Destructor ~TextureList(); //! Deletes all textures DLLEXPORT void leeren(); //! Adds a texture to the list //! \param t The texture //! \param name The name under which the texture is stored in the list DLLEXPORT bool addTexture(Texture* t, const char* name); //! Removes a texture from the list //! \param name The name of the texture DLLEXPORT void removeTexture(const char* name); //! Checks whether a texture is stored under a specific name //! \param name The name \return true if a texture with the name exists DLLEXPORT bool hasTexture(const char* name) const; //! Returns a specific texture //! \param name The name of the texture DLLEXPORT Texture* getTexture(const char* name) const; //! Returns a specific texture //! \param id The id of the texture DLLEXPORT Texture* getTexture(int id) const; //! Returns a specific texture without increased reference counter //! \param name The name of the texture DLLEXPORT Texture* zTexture(const char* name) const; //! Returns a specific texture without increased reference counter //! \param id The id of the texture DLLEXPORT Texture* zTexture(int id) const; //! Initializes static private members. Called automatically by the //! framework. static void init(); //! Deletes static private members. Called automatically by the //! framework. static void destroy(); }; } // namespace Framework