summaryrefslogtreecommitdiff
path: root/Source/Asura.Engine/Graphics/Canvas.h
diff options
context:
space:
mode:
Diffstat (limited to 'Source/Asura.Engine/Graphics/Canvas.h')
-rw-r--r--Source/Asura.Engine/Graphics/Canvas.h43
1 files changed, 41 insertions, 2 deletions
diff --git a/Source/Asura.Engine/Graphics/Canvas.h b/Source/Asura.Engine/Graphics/Canvas.h
index c9adf2d..fc8a527 100644
--- a/Source/Asura.Engine/Graphics/Canvas.h
+++ b/Source/Asura.Engine/Graphics/Canvas.h
@@ -1,25 +1,64 @@
#ifndef __ASURA_ENGINE_CANVAS_H__
#define __ASURA_ENGINE_CANVAS_H__
+#include <Scripting/Luax.hpp>
+
+#include "GL.h"
+#include "SimClass.h"
#include "Texture.h"
+#include "RenderTarget.h"
namespace AsuraEngine
{
namespace Graphics
{
- class Canvas : public Texture
+ ///
+ /// CanvasҲԳΪrender textureҲΪtextureȾ
+ ///
+ class Canvas final : public Texture, public RenderTarget, public SimClass
{
public:
Canvas();
+ ///
+ /// 󶨴canvasΪ
+ ///
+ void Bind();
+
+ ///
+ /// Ϊǻ󶨻screen
+ ///
+ void Unbind();
+
+ void Render(int x, int y, int sx, int sy, int ox, int oy, int r) override;
+
+ void Render(const Math::Rect& quad, int x, int y, int sx, int sy, int ox, int oy, int r) override;
+
+ //----------------------------------------------------------------------------------------------------------
+
+ LUAX_DECL_FACTORY(SimCanvas);
+
+ LUAX_DECL_METHOD(l_Bind);
+ LUAX_DECL_METHOD(l_Unbind);
+
+ //----------------------------------------------------------------------------------------------------------
+
private:
- LUAX_DECL_FACTORY(SimCanvas); // AsuraEngine.SimCanvas
+ ///
+ /// Frame buffer object id.
+ ///
+ GLuint mFBO;
};
+ ///
+ /// CanvasΪRenderTexture
+ ///
+ using RenderTexture = Canvas;
+
}
}