|
Last change
on this file since 9836 was
9823,
checked in by bensch, 19 years ago
|
|
orxonox/new_class_id: now it should also be possible, to cache the resources, by suppling a LoadString.
This is vital to loading Resources, when you only know the TypeName and a LoadString, but not the c++-type and the LoadParameters as is the case when loading over the internet.
|
|
File size:
933 bytes
|
| Line | |
|---|
| 1 | /*! |
|---|
| 2 | * @file resource_shader.h |
|---|
| 3 | * @brief Contains the ResourceShader class, that handles the Resource-specific loading part of the Shader. |
|---|
| 4 | * |
|---|
| 5 | */ |
|---|
| 6 | |
|---|
| 7 | #ifndef _RESOURCE_SHADER_H |
|---|
| 8 | #define _RESOURCE_SHADER_H |
|---|
| 9 | |
|---|
| 10 | #include "util/loading/resource.h" |
|---|
| 11 | #include "shader.h" |
|---|
| 12 | |
|---|
| 13 | |
|---|
| 14 | class ResourceShader : public Shader, public Resources::NewResource |
|---|
| 15 | { |
|---|
| 16 | public: |
|---|
| 17 | ResourceShader(const std::string& vertexShaderName, const std::string& fragmentShaderName); |
|---|
| 18 | static ResourceShader createFromString(const std::string& loadString); |
|---|
| 19 | |
|---|
| 20 | private: |
|---|
| 21 | class ShaderResourcePointer : public Resources::StorePointer |
|---|
| 22 | { |
|---|
| 23 | public: |
|---|
| 24 | ShaderResourcePointer(const std::string& loadString, const Resources::KeepLevel& keepLevel, const ShaderData::Pointer& data); |
|---|
| 25 | inline const ShaderData::Pointer& ptr() const { return pointer; } |
|---|
| 26 | private: |
|---|
| 27 | ShaderData::Pointer pointer; |
|---|
| 28 | }; |
|---|
| 29 | |
|---|
| 30 | private: |
|---|
| 31 | static Resources::tType<ResourceShader> type; |
|---|
| 32 | }; |
|---|
| 33 | |
|---|
| 34 | |
|---|
| 35 | #endif /* _RESOURCE_SHADER_H */ |
|---|
Note: See
TracBrowser
for help on using the repository browser.