Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: orxonox.OLD/branches/new_class_id/src/lib/graphics/resource_shader.h @ 9854

Last change on this file since 9854 was 9854, checked in by bensch, 18 years ago

more nice comments, and also updated the KeepLevel loading (if you want to load a Resource to a KeepLevel just append it at loadtime:
eg.:
Texture tex = ResourceTexture(orxonox.png, GL_TEXTURE_2D, GameEnd);
where GameEnd is the KeepLevel as defined in orxonox.cc→initResources()

File size: 1.1 KB
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
14class ResourceShader : public Shader, public Resources::Resource
15{
16public:
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());
22
23private:
24class ShaderResourcePointer : public Resources::StorePointer
25  {
26  public:
27    ShaderResourcePointer(const std::string& loadString, const Resources::KeepLevel& keepLevel, const ShaderData::Pointer& data);
28    inline const ShaderData::Pointer& ptr() const { return pointer; }
29    virtual bool last() const { return pointer.count() == 1; }
30  private:
31    ShaderData::Pointer pointer;
32  };
33
34private:
35  static Resources::tType<ResourceShader> type;
36};
37
38
39#endif /* _RESOURCE_SHADER_H */
Note: See TracBrowser for help on using the repository browser.