| #pragma once |
| |
| #ifndef DRAWABLEMESHIMAGE_H |
| #define DRAWABLEMESHIMAGE_H |
| |
| #include <memory> |
| |
| |
| #include "meshtexturizer.h" |
| |
| |
| #include "tgldisplaylistsmanager.h" |
| |
| #undef DVAPI |
| #undef DVVAR |
| #ifdef TNZEXT_EXPORTS |
| #define DVAPI DV_EXPORT_API |
| #define DVVAR DV_EXPORT_VAR |
| #else |
| #define DVAPI DV_IMPORT_API |
| #define DVVAR DV_IMPORT_VAR |
| #endif |
| |
| |
| |
| |
| |
| |
| struct DrawableTextureData { |
| MeshTexturizer::TextureData *m_textureData; |
| |
| public: |
| DrawableTextureData() {} |
| ~DrawableTextureData(); |
| |
| private: |
| friend class TTexturesStorage; |
| |
| int m_texId; |
| int m_dlSpaceId; |
| int m_objIdx; |
| |
| private: |
| |
| |
| DrawableTextureData(const DrawableTextureData &); |
| DrawableTextureData &operator=(const DrawableTextureData &); |
| }; |
| |
| typedef std::shared_ptr<DrawableTextureData> DrawableTextureDataP; |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| class DVAPI TTexturesStorage : private TGLDisplayListsManager::Observer { |
| public: |
| static TTexturesStorage *instance(); |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| DrawableTextureDataP loadTexture(const std::string &textureId, |
| const TRaster32P &ras, |
| const TRectD &geometry); |
| |
| |
| void unloadTexture(const std::string &textureId); |
| |
| |
| DrawableTextureDataP getTextureData(const std::string &textureId); |
| |
| private: |
| TTexturesStorage(); |
| ~TTexturesStorage(); |
| |
| void onDisplayListDestroyed(int dlSpaceId) override; |
| }; |
| |
| #endif |