VR-Vantage API Documentation
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>
14 
15 namespace makVrv
16 {
20  {
21  public:
22 
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 
73  unsigned int myProgram;
74  unsigned int myVertexShader;
75  unsigned int myFragmentShader;
76 
80  };
81 
86  {
87  public:
88 
90  {
91  virtual ~CreateParameters()
92  {
93  }
94  };
95 
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)