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 
13 
14 namespace makVrv
15 {
19  {
20  public:
21 
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 
69  unsigned int myProgram;
70  unsigned int myVertexShader;
71  unsigned int myFragmentShader;
72  };
73 
78  {
79  public:
80 
82  {
83  virtual ~CreateParameters()
84  {
85  }
86  };
87 
89  virtual ~DtEffectCreator();
90  virtual DtEffect* create(CreateParameters* params = 0) = 0;
91  };
92 
93 }
94 


Copyright © 2005-2013 VT MÄK Inc. All Rights Reserved (www.mak.com)