aboutsummaryrefslogtreecommitdiff
path: root/KaplaDemo/samples/sampleViewer3/RenderTarget.h
diff options
context:
space:
mode:
Diffstat (limited to 'KaplaDemo/samples/sampleViewer3/RenderTarget.h')
-rw-r--r--KaplaDemo/samples/sampleViewer3/RenderTarget.h31
1 files changed, 31 insertions, 0 deletions
diff --git a/KaplaDemo/samples/sampleViewer3/RenderTarget.h b/KaplaDemo/samples/sampleViewer3/RenderTarget.h
new file mode 100644
index 00000000..6f77127b
--- /dev/null
+++ b/KaplaDemo/samples/sampleViewer3/RenderTarget.h
@@ -0,0 +1,31 @@
+#ifndef RENDER_TARGET
+#define RENDER_TARGET
+
+#include "FrameBufferObject.h"
+
+// -------------------------------------------------------------------------------------------
+class RenderTarget
+{
+public:
+ RenderTarget(int width, int height);
+ ~RenderTarget();
+
+ void resize(int width, int height);
+
+ void beginCapture();
+ void endCapture();
+
+ GLuint getColorTexId() { return mColorTexId; }
+ GLuint getDepthTexId() { return mDepthTexId; }
+
+private:
+ void clear();
+ GLuint createTexture(GLenum target, int width, int height, GLint internalFormat, GLenum format);
+
+ GLuint mColorTexId;
+ GLuint mDepthTexId;
+
+ FrameBufferObject *mFBO;
+};
+
+#endif \ No newline at end of file