diff options
author | chai <chaifix@163.com> | 2019-02-26 08:48:54 +0800 |
---|---|---|
committer | chai <chaifix@163.com> | 2019-02-26 08:48:54 +0800 |
commit | 3f457498b9c39d40a16a0ec6328880854f8cf4de (patch) | |
tree | 061ef9974b4da4c472909a65e6ebd10e8156c1b3 /Source/Asura.Engine/Graphics/Canvas.h | |
parent | 684f71790401727cc45f4dad1822ddae46305072 (diff) |
*misc
Diffstat (limited to 'Source/Asura.Engine/Graphics/Canvas.h')
-rw-r--r-- | Source/Asura.Engine/Graphics/Canvas.h | 43 |
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; + } } |