summaryrefslogtreecommitdiffstats
path: root/jni/feature_mos/src/mosaic_renderer/FrameBuffer.h
diff options
context:
space:
mode:
Diffstat (limited to 'jni/feature_mos/src/mosaic_renderer/FrameBuffer.h')
-rwxr-xr-xjni/feature_mos/src/mosaic_renderer/FrameBuffer.h31
1 files changed, 31 insertions, 0 deletions
diff --git a/jni/feature_mos/src/mosaic_renderer/FrameBuffer.h b/jni/feature_mos/src/mosaic_renderer/FrameBuffer.h
new file mode 100755
index 0000000..b6a20ad
--- /dev/null
+++ b/jni/feature_mos/src/mosaic_renderer/FrameBuffer.h
@@ -0,0 +1,31 @@
+#pragma once
+
+#include <EGL/egl.h>
+#include <GLES2/gl2.h>
+#include <GLES2/gl2ext.h>
+
+extern bool checkGlError(const char* op);
+
+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;
+};