VR-Forces 4.7 Class Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
DtGlRenderToTexture.h
Go to the documentation of this file.
1 /******************************************************************************
2 ** Copyright (c) 2018 MAK Technologies, Inc.
3 ** All rights reserved.
4 ******************************************************************************/
5 #pragma once
6 
10 
11 
15 
16 #include <vector>
17 #include <string>
18 
19 namespace makVrv
20 {
23  {
24  private:
27 
30 
32  DtGlRenderTexture& operator=(const DtGlRenderTexture&);
33 
34  public:
35  enum ImageType {
43 
44  //depth types
45  D16,
46  D24,
47  D32,
48  };
49 
52  DtGlRenderTexture(const std::string& name, int width, int height, int samples = 0);
53 
55  virtual ~DtGlRenderTexture();
56 
58  bool init(ImageType colorFormat = RGB32F, GLenum minFilter = GL_LINEAR, GLenum wrapMode = GL_CLAMP_TO_EDGE);
59 
61  bool initDepth(ImageType depthFormat = D32);
62 
64  void activateForDrawingInto();
65 
67  void deactivateForDrawingInto();
68 
70  void bindColorTexture(int unit);
71 
73  void unbindColorTexture(int unit);
74 
76  int width() const;
77 
79  int height() const;
80 
82  unsigned int colorId() const;
83 
85  unsigned int depthId() const;
86 
88  int numSamples() const;
89 
90  protected:
91  unsigned int myFboId;
92  unsigned int myMultisampleFboId;
95  unsigned int myColorId;
96  unsigned int myDepthId;
97 
98  void initColorTexture(const std::string& name, GLenum minfilter, GLenum wrapMode);
99  void initDepthBufferTexture(const std::string& name);
100  void initFBO(const std::string& name);
101 
102  GLenum getGLInternalTypes(ImageType colorType);
103 
104  int myWidth;
105  int myHeight;
106 
108  bool myIsValid;
109 
112  std::string myName;
113 
115  };
116 
117 
120  {
121  private:
124 
126  DtGlScreenQuad& operator=(const DtGlScreenQuad&);
127 
128  public:
130  DtGlScreenQuad();
131 
133  virtual ~DtGlScreenQuad();
134 
136  void draw();
137 
138  protected:
139  unsigned int vbo;
140  };
141 }
142 

Document ID: Generated on Fri Apr 26 21:53:14 EDT 2019 from SVN revision 197883
Copyright © 2005-2019 VT MAK. All Rights Reserved (www.mak.com)