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