VR-Forces 4.1 Class Documentation
Home
Modules
Namespaces
Classes
Files
Examples
Behavior Models
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 <
vrvGraphics/vrvGraphics.h
>
13
14
namespace
makVrv
15
{
18
class
DT_DLL_VRVGRAPHICS
DtEffect
19
{
20
public
:
21
22
struct
VaryingAttributeAddress
23
{
24
VaryingAttributeAddress
(
const
void
* p,
unsigned
int
t,
unsigned
int
s)
25
: pointer(p)
26
, type(t)
27
, size(s)
28
{
29
}
30
31
const
void
*
pointer
;
//Address
32
unsigned
int
type
;
//The OpenGL type of the attribute.
33
unsigned
int
size
;
//The OpenGL width of the attribute 1-4
34
};
35
36
38
DtEffect
();
39
41
virtual
~
DtEffect
();
42
44
void
releaseResources();
45
47
bool
enabled()
const
;
48
49
//Start using the effect. Returns true if the effect is enabled.
50
bool
enable();
51
52
//Stop using the effect.
53
void
disable();
54
55
protected
:
57
virtual
void
getShaderSource(
const
char
*& vs,
const
char
*& fs,
const
char
*& gs) = 0;
58
virtual
void
updateUniformLocations() = 0;
59
virtual
void
updateUniforms() = 0;
60
61
protected
:
62
64
bool
compileProgram(
const
char
* vs,
const
char
* fs,
const
char
* gs);
65
66
protected
:
67
68
bool
myEnabledFlag
;
69
unsigned
int
myProgram
;
70
unsigned
int
myVertexShader
;
71
unsigned
int
myFragmentShader
;
72
};
73
77
class
DT_DLL_VRVGRAPHICS
DtEffectCreator
78
{
79
public
:
80
81
class
CreateParameters
82
{
83
virtual
~
CreateParameters
()
84
{
85
}
86
};
87
88
DtEffectCreator
();
89
virtual
~
DtEffectCreator
();
90
virtual
DtEffect
* create(CreateParameters* params = 0) = 0;
91
};
92
93
}
94
Document ID: Generated on Tue Jan 29 18:21:16 EST 2013 from SVN revision 123193
Copyright © 2005-2013 VT MÄK Inc. All Rights Reserved (
www.mak.com
)