| #pragma once |
| |
| #ifndef MESHTEXTURIZER_H |
| #define MESHTEXTURIZER_H |
| |
| #include <memory> |
| |
| |
| #include "traster.h" |
| #include "tgl.h" |
| |
| |
| #include <vector> |
| #include <deque> |
| |
| #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 |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| class DVAPI MeshTexturizer { |
| public: |
| struct TextureData; |
| |
| enum PremultMode |
| { NONPREMULTIPLIED, |
| PREMULTIPLIED, |
| }; |
| |
| public: |
| MeshTexturizer(); |
| ~MeshTexturizer(); |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| int bindTexture( |
| const TRaster32P &ras, |
| const TRectD |
| &geometry, |
| PremultMode premultiplyMode = |
| NONPREMULTIPLIED); |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| TextureData *getTextureData( |
| int textureId); |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| void rebindTexture( |
| int textureId, const TRaster32P &ras, |
| const TRectD |
| &geometry, |
| PremultMode premultiplyMode = NONPREMULTIPLIED); |
| void unbindTexture(int textureId); |
| |
| |
| |
| |
| private: |
| class Imp; |
| std::unique_ptr<Imp> m_imp; |
| |
| private: |
| |
| MeshTexturizer(const MeshTexturizer &); |
| MeshTexturizer &operator=(const MeshTexturizer &); |
| }; |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| struct MeshTexturizer::TextureData { |
| struct TileData //! Data structure for a texture tile. |
| { |
| GLuint m_textureId; |
| TRectD m_tileGeometry; |
| }; |
| |
| public: |
| TRectD m_geom; |
| std::vector<TileData> |
| m_tileDatas; |
| |
| public: |
| TextureData() {} |
| TextureData(const TRectD &geom) : m_geom(geom) {} |
| |
| ~TextureData() { |
| int t, tilesCount = m_tileDatas.size(); |
| for (t = 0; t < tilesCount; ++t) |
| glDeleteTextures(1, &m_tileDatas[t].m_textureId); |
| } |
| |
| private: |
| |
| TextureData(const TextureData &); |
| TextureData &operator=(const TextureData &); |
| }; |
| |
| #endif |