VR-Vantage 2.7 API Documentation
Home
Modules
Namespaces
Classes
Files
Libraries
Examples
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) 2017 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
(
const
std::string
& dataPath);
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
std::string
myName
;
77
bool
myEnabledFlag
;
78
unsigned
int
myProgram
;
79
unsigned
int
myVertexShader
;
80
unsigned
int
myFragmentShader
;
81
82
std::string
myVertexShaderSource
;
83
std::string
myVertexShaderName
;
84
std::string
myFragmentShaderSource
;
85
std::string
myFragmentShaderName
;
86
std::string
myGeometryShaderSource
;
87
88
std::string
myDataPath
;
89
};
90
94
class
DT_DLL_VRVGRAPHICS
DtEffectCreator
95
{
96
public
:
97
98
class
CreateParameters
99
{
100
virtual
~
CreateParameters
()
101
{
102
}
103
};
104
105
DtEffectCreator
();
106
virtual
~
DtEffectCreator
();
107
virtual
DtEffect
* create(
const
std::string
& dataPath, CreateParameters*
params
= 0) = 0;
108
};
109
110
}
111
Copyright © 2005-2021 MAK Technologies. All Rights Reserved (
www.mak.com
)