VR-Vantage 2.2 API Documentation
Home
Modules
Namespaces
Classes
Files
Libraries
Examples
Tutorials
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Groups
Pages
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
VertexAttribPtrInfo
24
{
25
VertexAttribPtrInfo
(
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
bool
operator==
(
const
VertexAttribPtrInfo
& rhs)
37
{
38
return
pointer
==rhs.
pointer
&&
type
==rhs.
type
&&
size
==rhs.
size
;
39
}
40
};
41
43
DtEffect
();
44
46
virtual
~
DtEffect
();
47
49
void
releaseResources();
50
52
bool
enabled
()
const
;
53
54
//Start using the effect. Returns true if the effect is enabled.
55
bool
enable
();
56
57
//Stop using the effect.
58
void
disable();
59
60
// Utility function
61
static
std::string
loadShaderSource(
const
std::string
& strFileName);
62
63
protected
:
65
virtual
void
initializeShaderSource(
void
) = 0;
66
virtual
void
updateUniformLocations() = 0;
67
virtual
void
updateUniforms() = 0;
68
69
protected
:
70
72
bool
compileShaders(
void
);
73
74
protected
:
75
76
bool
myEnabledFlag
;
77
unsigned
int
myProgram
;
78
unsigned
int
myVertexShader
;
79
unsigned
int
myFragmentShader
;
80
81
std::string
myVertexShaderSource
;
82
std::string
myFragmentShaderSource
;
83
std::string
myGeometryShaderSource
;
84
};
85
89
class
DT_DLL_VRVGRAPHICS
DtEffectCreator
90
{
91
public
:
92
93
class
CreateParameters
94
{
95
virtual
~
CreateParameters
()
96
{
97
}
98
};
99
100
DtEffectCreator
();
101
virtual
~
DtEffectCreator
();
102
virtual
DtEffect
* create(CreateParameters*
params
= 0) = 0;
103
};
104
105
}
106
Copyright © 2005-2017 VT MÄK. All Rights Reserved (
www.mak.com
)