HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
STY_VexResolver.h
Go to the documentation of this file.
1 /*
2  * PROPRIETARY INFORMATION. This software is proprietary to
3  * Side Effects Software Inc., and is not to be reproduced,
4  * transmitted, or disclosed in any way without written permission.
5  *
6  * NAME: STY_VexResolver.h ( VEX Library, C++)
7  *
8  * COMMENTS: A class with virtual functions for getting VEX code from
9  * style sheet material definitions.
10  */
11 
12 #ifndef __STY_VexResolver__
13 #define __STY_VexResolver__
14 
15 #include "STY_API.h"
16 #include <VEX/VEX_VexResolver.h>
17 #include <VEX/VCC_VexCompiler.h>
18 #include <UT/UT_Map.h>
19 #include <UT/UT_StringMap.h>
20 #include <UT/UT_StringHolder.h>
21 #include <UT/UT_UniquePtr.h>
22 
24 {
25 public:
27  virtual ~STY_VexResolver();
28 
29  void registerShader(VEX_ContextType context_type,
30  const UT_StringHolder &shader_name,
31  const UT_StringHolder &shader_code);
32 
33 protected:
34  virtual bool canResolveCode(const char *shader);
35  virtual bool supportedByMantra(const char *shader);
36  virtual bool resolveVflCode(const char *shader, std::ostream &os,
38  int context_type);
39  virtual bool resolveVexCode(const char *shader, std::ostream &os,
40  VEX_CodeGenFlags flags, int context_type,
41  bool &is_pure_compiled_out,
42  VEX_ErrorLog &errors);
43  // No concept of pre-caching here like there is in VOPs.
44  virtual bool resolveCacheVexCode(const char *shader,
45  int context_type, VEX_ErrorLog &errors)
46  { return true; }
47  virtual bool resolveAddDependency(const char *shader,
48  DEP_MicroNode *depnode);
49  virtual bool resolveDependencies(const char *shader,
50  UT_StringArray &shader_deps,
51  int context_type);
52  virtual int resolveCodeTimeStamp(const char *shader,
53  int context_type);
54  virtual bool resolveVexContext(const char *shader, UT_String &ctx,
55  int requested_context_type);
56  virtual bool resolveCanonicalPath(const char *shader,
57  UT_String &canonical_shader);
58  virtual bool resolveAlias(const char *alias, UT_String &shader);
59 
60 private:
63 };
64 
66 
67 #endif
68 
virtual bool resolveAddDependency(const char *shader, DEP_MicroNode *depmicronode)=0
Unsorted map container.
Definition: UT_Map.h:83
virtual bool resolveVflCode(const char *shader, std::ostream &os, VEX_CodeGenFlags code_flags, int context_type)=0
virtual bool resolveVexCode(const char *shader, std::ostream &os, VEX_CodeGenFlags code_flags, int context_type, bool &is_pure_compiled_out, VEX_ErrorLog &errors)=0
See comments for getVexCode().
virtual bool resolveAlias(const char *alias, UT_String &shader)=0
GLbitfield flags
Definition: glcorearb.h:1595
virtual bool resolveCacheVexCode(const char *shader, int context_type, VEX_ErrorLog &errors)
#define STY_API
Definition: STY_API.h:10
virtual bool resolveCanonicalPath(const char *shader, UT_String &canonical_shader)=0
virtual int resolveCodeTimeStamp(const char *shader, int context_type)=0
virtual bool supportedByMantra(const char *shader)=0
GLuint shader
Definition: glcorearb.h:784
virtual bool resolveVexContext(const char *shader, UT_String &ctx, int requested_context_type)=0
VEX_CodeGenFlags
VEX code generation flags when calling VEX_VexResolver::getVflCode.
Definition: VEX_VexTypes.h:137
STY_API STY_VexResolver * STYgetVexResolver()
VEX_ContextType
Definition: VEX_VexTypes.h:60
virtual bool canResolveCode(const char *shader)=0
virtual bool resolveDependencies(const char *shader, UT_StringArray &shader_deps, int context_type)=0