aboutsummaryrefslogtreecommitdiff
path: root/src/libjin/Graphics/Canvas.h
diff options
context:
space:
mode:
authorchai <chaifix@163.com>2018-07-28 10:39:31 +0800
committerchai <chaifix@163.com>2018-07-28 10:39:31 +0800
commit589ee7ee7014a5f8918e1d99c0e04bff4f7a83cb (patch)
tree8d377c830bcc68afd24b02f97a0811d3d4c50598 /src/libjin/Graphics/Canvas.h
parent654a75401775d74f95f3d98611e333bb5641ee9b (diff)
*update
Diffstat (limited to 'src/libjin/Graphics/Canvas.h')
-rw-r--r--src/libjin/Graphics/Canvas.h40
1 files changed, 40 insertions, 0 deletions
diff --git a/src/libjin/Graphics/Canvas.h b/src/libjin/Graphics/Canvas.h
new file mode 100644
index 0000000..bccb3f6
--- /dev/null
+++ b/src/libjin/Graphics/Canvas.h
@@ -0,0 +1,40 @@
+#ifndef __JIN_CANVAS_H
+#define __JIN_CANVAS_H
+#include "../modules.h"
+#if JIN_MODULES_RENDER
+
+#include "drawable.h"
+namespace jin
+{
+namespace graphics
+{
+ class Canvas: public Drawable
+ {
+ public:
+
+ static Canvas* createCanvas(int w, int h);
+
+ ~Canvas();
+
+ void bind();
+
+ static void unbind();
+
+ static bool hasbind(GLint fbo);
+
+ private:
+
+ Canvas(int w, int h);
+
+ GLuint fbo;
+
+ // current binded fbo
+ static GLint cur;
+
+ bool init();
+ };
+} // render
+} // jin
+
+#endif // JIN_MODULES_RENDER
+#endif // __JIN_CANVAS_H \ No newline at end of file