summaryrefslogtreecommitdiffstats
path: root/jni_mosaic/feature_mos/src/mosaic_renderer/FrameBuffer.h
diff options
context:
space:
mode:
Diffstat (limited to 'jni_mosaic/feature_mos/src/mosaic_renderer/FrameBuffer.h')
-rwxr-xr-xjni_mosaic/feature_mos/src/mosaic_renderer/FrameBuffer.h34
1 files changed, 34 insertions, 0 deletions
diff --git a/jni_mosaic/feature_mos/src/mosaic_renderer/FrameBuffer.h b/jni_mosaic/feature_mos/src/mosaic_renderer/FrameBuffer.h
new file mode 100755
index 000000000..314b12622
--- /dev/null
+++ b/jni_mosaic/feature_mos/src/mosaic_renderer/FrameBuffer.h
@@ -0,0 +1,34 @@
+#pragma once
+
+#include <EGL/egl.h>
+#include <GLES2/gl2.h>
+#include <GLES2/gl2ext.h>
+
+#define checkGlError(op) checkGLErrorDetail(__FILE__, __LINE__, (op))
+
+extern bool checkGLErrorDetail(const char* file, int line, const char* op);
+extern void checkFramebufferStatus(const char* name);
+
+class FrameBuffer {
+ public:
+ FrameBuffer();
+ virtual ~FrameBuffer();
+
+ bool InitializeGLContext();
+ bool Init(int width, int height, GLenum format);
+ GLuint GetTextureName() const;
+ GLuint GetFrameBufferName() const;
+ GLenum GetFormat() const;
+
+ int GetWidth() const;
+ int GetHeight() const;
+
+ private:
+ void Reset();
+ bool CreateBuffers();
+ GLuint mFrameBufferName;
+ GLuint mTextureName;
+ int mWidth;
+ int mHeight;
+ GLenum mFormat;
+};