Rev | Line | |
---|
[9781] | 1 | /*! |
---|
| 2 | * @file resource_texture.h |
---|
| 3 | * @brief Contains the ResourceTexture class, that handles the Resource-specific loading part of the Texture. |
---|
| 4 | * |
---|
| 5 | */ |
---|
| 6 | |
---|
| 7 | #ifndef _RESOURCE_TEXTURE_H |
---|
| 8 | #define _RESOURCE_TEXTURE_H |
---|
| 9 | |
---|
| 10 | #include "util/loading/resource.h" |
---|
| 11 | #include "texture.h" |
---|
| 12 | |
---|
| 13 | |
---|
[9847] | 14 | class ResourceTexture : public Texture, public Resources::Resource |
---|
[9781] | 15 | { |
---|
[9785] | 16 | public: |
---|
[9854] | 17 | ResourceTexture(const std::string& imageName, |
---|
| 18 | GLenum target = GL_TEXTURE_2D, |
---|
| 19 | const Resources::KeepLevel& keepLevel = Resources::KeepLevel()); |
---|
| 20 | static ResourceTexture createFromString(const std::string& loadString, |
---|
| 21 | const Resources::KeepLevel& keepLevel = Resources::KeepLevel()); |
---|
[9781] | 22 | |
---|
| 23 | private: |
---|
[9791] | 24 | class TextureResourcePointer : public Resources::StorePointer |
---|
[9781] | 25 | { |
---|
| 26 | public: |
---|
[9791] | 27 | TextureResourcePointer(const std::string& loadString, const Resources::KeepLevel& keepLevel, const TextureData::Pointer& data); |
---|
[9784] | 28 | inline const TextureData::Pointer& ptr() const { return pointer; } |
---|
[9846] | 29 | virtual bool last() const { return pointer.count() == 1; } |
---|
| 30 | private: |
---|
[9784] | 31 | TextureData::Pointer pointer; |
---|
[9781] | 32 | }; |
---|
| 33 | |
---|
[9785] | 34 | private: |
---|
[9823] | 35 | static Resources::tType<ResourceTexture> type; |
---|
[9781] | 36 | }; |
---|
| 37 | |
---|
| 38 | |
---|
| 39 | #endif /* _RESOURCE_TEXTURE_H */ |
---|
Note: See
TracBrowser
for help on using the repository browser.