VR-Forces 4.8 Class Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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>
14 
15 namespace makVrv
16 {
20  {
21  public:
22 
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 
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;
78  unsigned int myProgram;
79  unsigned int myVertexShader;
80  unsigned int myFragmentShader;
81 
82  std::string myVertexShaderSource;
83  std::string myVertexShaderName;
85  std::string myFragmentShaderName;
87 
88  std::string myDataPath;
89  };
90 
95  {
96  public:
97 
99  {
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 
std::string myDataPath
Definition: DtEffect.h:88
Abstract creator class for registering effects with a effects manager.
Definition: DtEffect.h:94
unsigned int myProgram
Definition: DtEffect.h:78
unsigned int myVertexShader
Definition: DtEffect.h:79
std::string myFragmentShaderName
Definition: DtEffect.h:85
voidpf void uLong size
Definition: ioapi.h:39
std::string myVertexShaderName
Definition: DtEffect.h:83
bool operator==(const VertexAttribPtrInfo &rhs)
Definition: DtEffect.h:36
unsigned int size
Definition: DtEffect.h:34
VertexAttribPtrInfo(const void *p, unsigned int t, unsigned int s)
Definition: DtEffect.h:25
#define DT_DLL_VRVGRAPHICS
Contains DLL export macros.
Definition: vrvGraphics.h:19
unsigned int myFragmentShader
Definition: DtEffect.h:80
Definition: DtEffect.h:23
bool myEnabledFlag
Definition: DtEffect.h:77
std::string myGeometryShaderSource
Definition: DtEffect.h:86
unsigned int type
Definition: DtEffect.h:33
The base class for a programmable pipeline render effect.
Definition: DtEffect.h:19
virtual ~CreateParameters()
Definition: DtEffect.h:100
const void * pointer
Definition: DtEffect.h:32
std::string myName
Definition: DtEffect.h:76
std::string myVertexShaderSource
Definition: DtEffect.h:82
std::string myFragmentShaderSource
Definition: DtEffect.h:84

Document ID: Generated on Thu Aug 27 10:56:05 EDT 2020 from SVN revision 217100
Copyright © 2005-2020 MAK Technologies. All Rights Reserved (www.mak.com)