ArcGIS Procedural Runtime  3.2.10650
Shader.h
1 /*
2  COPYRIGHT (c) 2012-2024 Esri R&D Center Zurich
3  TRADE SECRETS: ESRI PROPRIETARY AND CONFIDENTIAL
4  Unpublished material - all rights reserved under the
5  Copyright Laws of the United States and applicable international
6  laws, treaties, and conventions.
7 
8  For additional information, contact:
9  Environmental Systems Research Institute, Inc.
10  Attn: Contracts and Legal Services Department
11  380 New York Street
12  Redlands, California, 92373
13  USA
14 
15  email: contracts@esri.com
16 */
17 
18 #ifndef PRTX_SHADER_H_
19 #define PRTX_SHADER_H_
20 
21 #include "prtx/prtx.h"
22 #include "prtx/Types.h"
23 #include "prtx/Builder.h"
24 #include "prtx/Content.h"
25 
26 #include <string>
27 #include <memory>
28 
29 #ifdef _MSC_VER
30 # pragma warning(push)
31 # pragma warning (disable : 4231 4251 4275 4660)
32 #endif
33 
34 
35 class CoreShader;
36 
37 
38 namespace prtx {
39 
40 class Shader;
41 typedef std::shared_ptr<Shader> ShaderPtr;
42 
87 class PRTX_EXPORTS_API Shader : public ComparableContent {
88 public:
92  enum KeyType {
97  KT_TEXTURE
98  };
99 
100  virtual ~Shader();
101 
105  virtual const std::wstring& getName() const = 0;
106 
111  virtual size_t getKey(const std::wstring& name) const = 0;
112 
116  virtual bool hasKey(const std::wstring& name) const = 0;
117 
121  virtual WStringVector getKeys() const = 0;
122 
128  static ShaderPtr getDefault();
129 
130 protected:
131  Shader();
132 };
133 
134 
138 class PRTX_EXPORTS_API ShaderBuilder : public SharedPtrBuilder<Shader> {
139 public:
140  ShaderBuilder();
141  virtual ~ShaderBuilder();
142 
143  void setName(const std::wstring& name);
144  size_t addKey(const std::wstring& name, Shader::KeyType type, size_t size);
145 
146  // SharedPtrBuilder interface implementation
147  virtual ShaderPtr createShared(std::wstring* warnings = 0) const;
148  virtual ShaderPtr createSharedAndReset(std::wstring* warnings = 0);
149 
150 private:
151  CoreShader* mShader;
152 };
153 
154 
155 } /* namespace prtx */
156 
157 
158 #ifdef _MSC_VER
159 # pragma warning(pop)
160 #endif
161 
162 
163 #endif /* PRTX_SHADER_H_ */
Definition: Builder.h:65
Float type.
Definition: Shader.h:95
std::shared_ptr< Shader > ShaderPtr
shared Shader pointer
Definition: Shader.h:40
Boolean type.
Definition: Shader.h:94
KeyType
Definition: Shader.h:92
String type.
Definition: Shader.h:96
The Procedural Runtime eXtension namespace. The prtx namespace contains the tools to extend the Proce...
Definition: AnnotationBuilder.h:35
Integer type.
Definition: Shader.h:93
Definition: Content.h:88
Definition: Shader.h:87
Definition: Shader.h:138
std::vector< std::wstring > WStringVector
vector of std::wstring
Definition: Types.h:35