HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
VEX_RslResolver.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: VEX_RslResolver.h ( VEX Library, C++)
7  *
8  * COMMENTS: Resolver for Rsl (RenderMan Shader Language).
9  *
10  * Since shader code can't be embedded in a RIB stream, the way this
11  * resolver works is that:
12  * - The resolver will save the object code to a pre-defined directory.
13  * - The shader name will be changed to point to the object code in
14  * question.
15  */
16 
17 #ifndef __VEX_RslResolver__
18 #define __VEX_RslResolver__
19 
20 #include "VEX_API.h"
21 class UT_String;
22 
23 // ============================================================================
25 {
26 public:
27  /// @{ Specifies where the temporary source code file is created
28  /// and where the compiled object file is saved.
29  static void setCachePath(const char *path);
30  static const char *getCachePath();
31  /// @}
32 
33  // Helper that simply replaces the shader name with the appropriate path.
34  static void patchShader(UT_String &shader, const char *path);
35 
36 protected:
37  virtual ~VEX_RibResolver();
38  virtual bool canResolve(const char *shader) = 0;
39  virtual bool doResolve(UT_String &shader, int context_type) = 0;
40 };
41 
42 // ============================================================================
44 {
45 public:
46  static bool canResolveShader(UT_String &shader);
47  static bool resolveShader(UT_String &shader, int context_type);
48 
49 protected:
51  virtual ~VEX_RslResolver();
52  static VEX_RslResolver *getRslResolver(const char *shader);
53 };
54 
55 // ============================================================================
56 // TODO: factor out VEX_RslResolver and VEX_OslResolver into one class without
57 // static list of resolvers
59 {
60 public:
61  static bool canResolveShader(UT_String &shader);
62  static bool resolveShader(UT_String &shader, int context_type);
63 
64 protected:
66  virtual ~VEX_OslResolver();
67  static VEX_OslResolver *getOslResolver(const char *shader);
68 };
69 #endif
70 
GLsizei const GLchar *const * path
Definition: glcorearb.h:3340
#define VEX_API
Definition: VEX_API.h:11
GLuint shader
Definition: glcorearb.h:784