diff options
author | chai <chaifix@163.com> | 2019-01-12 21:48:33 +0800 |
---|---|---|
committer | chai <chaifix@163.com> | 2019-01-12 21:48:33 +0800 |
commit | 8b00d67febf133e89f6a0bfabc41feed555dc4a9 (patch) | |
tree | fe48ef17c250afa40c2588300fcdb5920dba6951 /src/libjin/graphics/je_canvas.cpp | |
parent | a907c39756ef6b368d06643afa491c49a9044a8e (diff) |
*去掉文件前缀je_
Diffstat (limited to 'src/libjin/graphics/je_canvas.cpp')
-rw-r--r-- | src/libjin/graphics/je_canvas.cpp | 58 |
1 files changed, 0 insertions, 58 deletions
diff --git a/src/libjin/graphics/je_canvas.cpp b/src/libjin/graphics/je_canvas.cpp deleted file mode 100644 index bb1e2a9..0000000 --- a/src/libjin/graphics/je_canvas.cpp +++ /dev/null @@ -1,58 +0,0 @@ -#include "../core/je_configuration.h" -#if defined(jin_graphics) - -#include "../utils/je_macros.h" -#include "je_canvas.h" -#include "je_window.h" - -namespace JinEngine -{ - namespace Graphics - { - - Canvas::Canvas(GLuint n) - : fbo(n) - { - ++gl.getStats().canvases; - } - - Canvas::Canvas(int w, int h) - : Graphic(w, h) - { - GLint current_fbo; - glGetIntegerv(GL_DRAW_FRAMEBUFFER_BINDING, ¤t_fbo); - - // Generate a new render buffer object. - fbo = gl.genFrameBuffer(); - gl.bindFrameBuffer(fbo); - - // Render texture. - GLuint texture = getGLTexture(); - gl.bindTexture2D(texture); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST); - gl.texImage(GL_RGBA8, w, h, GL_RGBA, GL_UNSIGNED_BYTE, NULL); - - glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, texture, 0); - GLenum status = glCheckFramebufferStatus(GL_FRAMEBUFFER); - - // Unbind framebuffer - gl.bindFrameBuffer(current_fbo); - - ++gl.getStats().canvases; - } - - Canvas::~Canvas() - { - --gl.getStats().canvases; - } - - bool Canvas::isBinded(const Canvas* cvs) - { - return gl.getCanvas() == cvs; - } - - } // namespace Graphics -} // namespace JinEngine - -#endif // defined(jin_graphics)
\ No newline at end of file |