VR-Vantage API Documentation
Home
Modules
Namespaces
Classes
Files
Libraries
Examples
Tutorials
File List
File Members
include
vrvGraphics
DtEffect.h
Go to the documentation of this file.
1
/******************************************************************************
2
** Copyright (c) 2010 MAK Technologies, Inc.
3
** All rights reserved.
4
******************************************************************************/
5
9
10
#pragma once
11
12
#include <string>
13
#include <
vrvGraphics/vrvGraphics.h
>
14
15
namespace
makVrv
16
{
19
class
DT_DLL_VRVGRAPHICS
DtEffect
20
{
21
public
:
22
23
struct
VaryingAttributeAddress
24
{
25
VaryingAttributeAddress
(
const
void
*
p
,
unsigned
int
t
,
unsigned
int
s
)
26
:
pointer
(p)
27
,
type
(t)
28
,
size
(s)
29
{
30
}
31
32
const
void
*
pointer
;
//Address
33
unsigned
int
type
;
//The OpenGL type of the attribute.
34
unsigned
int
size
;
//The OpenGL width of the attribute 1-4
35
};
36
37
39
DtEffect
();
40
42
virtual
~
DtEffect
();
43
45
void
releaseResources();
46
48
bool
enabled
()
const
;
49
50
//Start using the effect. Returns true if the effect is enabled.
51
bool
enable
();
52
53
//Stop using the effect.
54
void
disable();
55
56
// Utility function
57
static
std::string
loadShaderSource(
const
std::string
& strFileName);
58
59
protected
:
61
virtual
void
initializeShaderSource(
void
) = 0;
62
virtual
void
updateUniformLocations() = 0;
63
virtual
void
updateUniforms() = 0;
64
65
protected
:
66
68
bool
compileShaders(
void
);
69
70
protected
:
71
72
bool
myEnabledFlag
;
73
unsigned
int
myProgram
;
74
unsigned
int
myVertexShader
;
75
unsigned
int
myFragmentShader
;
76
77
std::string
myVertexShaderSource
;
78
std::string
myFragmentShaderSource
;
79
std::string
myGeometryShaderSource
;
80
};
81
85
class
DT_DLL_VRVGRAPHICS
DtEffectCreator
86
{
87
public
:
88
89
class
CreateParameters
90
{
91
virtual
~
CreateParameters
()
92
{
93
}
94
};
95
96
DtEffectCreator
();
97
virtual
~
DtEffectCreator
();
98
virtual
DtEffect
* create(CreateParameters*
params
= 0) = 0;
99
};
100
101
}
102
Copyright © 2005-2013 VT MÄK. All Rights Reserved (
www.mak.com
)