HDK
Main Page
Related Pages
Modules
Namespaces
Classes
Files
Examples
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Groups
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
#include <
UT/UT_NonCopyable.h
>
22
23
class
UT_String
;
24
25
// ============================================================================
26
class
VEX_API
VEX_RibResolver
27
{
28
public
:
29
/// @{ Specifies where the temporary source code file is created
30
/// and where the compiled object file is saved.
31
static
void
setCachePath(
const
char
*
path
);
32
static
const
char
*getCachePath();
33
/// @}
34
35
// Helper that simply replaces the shader name with the appropriate path.
36
static
void
patchShader(
UT_String
&
shader
,
const
char
*path);
37
38
protected
:
39
VEX_RibResolver
() =
default
;
40
virtual
~
VEX_RibResolver
();
41
UT_NON_COPYABLE
(
VEX_RibResolver
)
42
virtual
bool
canResolve(
const
char
*shader) = 0;
43
virtual
bool
doResolve(
UT_String
&shader,
int
context_type) = 0;
44
};
45
46
// ============================================================================
47
class
VEX_API
VEX_RslResolver
:
public
VEX_RibResolver
48
{
49
public
:
50
static
bool
canResolveShader(
UT_String
&
shader
);
51
static
bool
resolveShader(
UT_String
&shader,
int
context_type);
52
53
protected
:
54
VEX_RslResolver
();
55
~
VEX_RslResolver
()
override
;
56
UT_NON_COPYABLE
(
VEX_RslResolver
)
57
static
VEX_RslResolver
*getRslResolver(
const
char
*shader);
58
};
59
60
// ============================================================================
61
// TODO: factor out VEX_RslResolver and VEX_OslResolver into one class without
62
// static list of resolvers
63
class
VEX_API
VEX_OslResolver
:
public
VEX_RibResolver
64
{
65
public
:
66
static
bool
canResolveShader(
UT_String
&
shader
);
67
static
bool
resolveShader(
UT_String
&shader,
int
context_type);
68
69
protected
:
70
VEX_OslResolver
();
71
~
VEX_OslResolver
()
override
;
72
UT_NON_COPYABLE
(
VEX_OslResolver
)
73
static
VEX_OslResolver
*getOslResolver(
const
char
*shader);
74
};
75
#endif
76
VEX_RibResolver
Definition:
VEX_RslResolver.h:26
path
GLsizei const GLchar *const * path
Definition:
glcorearb.h:3341
VEX_API
#define VEX_API
Definition:
VEX_API.h:14
UT_NON_COPYABLE
#define UT_NON_COPYABLE(CLASS)
Define deleted copy constructor and assignment operator inside a class.
Definition:
UT_NonCopyable.h:31
UT_NonCopyable.h
VEX_RslResolver
Definition:
VEX_RslResolver.h:47
shader
GLuint shader
Definition:
glcorearb.h:785
UT_String
Definition:
UT_String.h:73
VEX_OslResolver
Definition:
VEX_RslResolver.h:63
VEX_API.h
VEX
VEX_RslResolver.h
Generated on Thu Nov 21 2024 02:46:18 for HDK by
1.8.6