diff options
author | chai <chaifix@163.com> | 2019-03-01 08:50:34 +0800 |
---|---|---|
committer | chai <chaifix@163.com> | 2019-03-01 08:50:34 +0800 |
commit | 64d9d7b3eb7cece81da8b2cb56eb0f50d87a5964 (patch) | |
tree | 12bde99e5415f77f60f8873a66d09bfd3b84ec48 /Source/Asura.Engine/Graphics/Canvas.cpp | |
parent | e28a7d48d032fe7fd4c8789e95fbc659873a0adc (diff) |
*misc
Diffstat (limited to 'Source/Asura.Engine/Graphics/Canvas.cpp')
-rw-r--r-- | Source/Asura.Engine/Graphics/Canvas.cpp | 32 |
1 files changed, 31 insertions, 1 deletions
diff --git a/Source/Asura.Engine/Graphics/Canvas.cpp b/Source/Asura.Engine/Graphics/Canvas.cpp index 8ca6fb2..61787b6 100644 --- a/Source/Asura.Engine/Graphics/Canvas.cpp +++ b/Source/Asura.Engine/Graphics/Canvas.cpp @@ -5,7 +5,37 @@ namespace AsuraEngine namespace Graphics { - + Canvas::Canvas() + : Texture() + , mWidth(0) + , mHeight(0) + { + glGenFramebuffers(1, &mFBO); + GLint current_fbo; + glGetIntegerv(GL_DRAW_FRAMEBUFFER_BINDING, ¤t_fbo); + glBindFramebuffer(GL_FRAMEBUFFER, mFBO); + glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, mTextureHandle, 0); + glBindFramebuffer(GL_FRAMEBUFFER, current_fbo); + } + + void Canvas::SetSize(uint w, uint h) + { + GLint current_tex; + glGetIntegerv(GL_TEXTURE_BINDING_2D, ¤t_tex); + glBindTexture(GL_TEXTURE_2D, mTextureHandle); + + glBindTexture(GL_TEXTURE_2D, current_tex); + } + + void Canvas::Bind() + { + + } + + void Canvas::Unbind() + { + + } } }
\ No newline at end of file |