diff options
Diffstat (limited to 'source/Asura.Editor/graphics')
-rw-r--r-- | source/Asura.Editor/graphics/draw_info.cpp | 0 | ||||
-rw-r--r-- | source/Asura.Editor/graphics/draw_info.h | 14 | ||||
-rw-r--r-- | source/Asura.Editor/graphics/drawer.cpp | 16 | ||||
-rw-r--r-- | source/Asura.Editor/graphics/drawer.h | 39 | ||||
-rw-r--r-- | source/Asura.Editor/graphics/shader.h | 18 | ||||
-rw-r--r-- | source/Asura.Editor/graphics/shaders/image.shader.h | 35 | ||||
-rw-r--r-- | source/Asura.Editor/graphics/shaders/poly_line.shader.h | 15 | ||||
-rw-r--r-- | source/Asura.Editor/graphics/shaders/poly_shape.shader.h | 0 |
8 files changed, 137 insertions, 0 deletions
diff --git a/source/Asura.Editor/graphics/draw_info.cpp b/source/Asura.Editor/graphics/draw_info.cpp new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/source/Asura.Editor/graphics/draw_info.cpp diff --git a/source/Asura.Editor/graphics/draw_info.h b/source/Asura.Editor/graphics/draw_info.h new file mode 100644 index 0000000..442b92d --- /dev/null +++ b/source/Asura.Editor/graphics/draw_info.h @@ -0,0 +1,14 @@ +#ifndef __ASURA_EDITOR_DRAW_INFO_H__ +#define __ASURA_EDITOR_DRAW_INFO_H__ + +namespace AsuraEditor +{ + namespace Graphics + { + + + + } +} + +#endif
\ No newline at end of file diff --git a/source/Asura.Editor/graphics/drawer.cpp b/source/Asura.Editor/graphics/drawer.cpp new file mode 100644 index 0000000..f2fca31 --- /dev/null +++ b/source/Asura.Editor/graphics/drawer.cpp @@ -0,0 +1,16 @@ +#include "drawer.h" + +using namespace AEGraphics; + +namespace AsuraEditor +{ + namespace Graphics + { + + void Drawer::DrawImage(Image* img) + { + + } + + } +}
\ No newline at end of file diff --git a/source/Asura.Editor/graphics/drawer.h b/source/Asura.Editor/graphics/drawer.h new file mode 100644 index 0000000..a61a7f2 --- /dev/null +++ b/source/Asura.Editor/graphics/drawer.h @@ -0,0 +1,39 @@ +#ifndef __ASURA_EDITOR_PAINTER_H__ +#define __ASURA_EDITOR_PAINTER_H__ + +#include <asura-utils/scripting/portable.hpp> +#include <asura-utils/singleton.hpp> +#include <asura-core/graphics/image.h> + +namespace AsuraEditor +{ + namespace Graphics + { + + /// + /// AsuraEngineȾֵĻ滭࣬ڻƿؼ֮֡Բֱ沿ֵȾ + /// ΪȾframeworkʵ֣иijؼȾҪӵpass + /// ༭£Ⱦͱ༭ȾԻࡣ + /// + class Drawer + : public AsuraEngine::Singleton<Drawer> + , public AEScripting::Portable<Drawer> + { + public: + + void DrawLine(int x1, int y1, int x2, int y2); + void DrawImage(AEGraphics::Image* img, int x, int y, float sx, float sy, float r, int ox, int oy); + void DrawTexts(); + void DrawCircle(int x, int y, float d); + void DrawPoint(int x, int y); + + private: + + LUAX_DECL_SINGLETON(Drawer); + + }; + + } +} + +#endif
\ No newline at end of file diff --git a/source/Asura.Editor/graphics/shader.h b/source/Asura.Editor/graphics/shader.h new file mode 100644 index 0000000..6f5a8cc --- /dev/null +++ b/source/Asura.Editor/graphics/shader.h @@ -0,0 +1,18 @@ +#ifndef __ASURA_EDITOR_SHADER_H__ +#define __ASURA_EDITOR_SHADER_H__ + +namespace AsuraEditor +{ + namespace Graphics + { + + struct ShaderProgram + { + const char* vert; + const char* frag; + }; + + } +} + +#endif
\ No newline at end of file diff --git a/source/Asura.Editor/graphics/shaders/image.shader.h b/source/Asura.Editor/graphics/shaders/image.shader.h new file mode 100644 index 0000000..6274f56 --- /dev/null +++ b/source/Asura.Editor/graphics/shaders/image.shader.h @@ -0,0 +1,35 @@ +#ifndef __ASURA_EDITOR_SHADER_H__ +#include "../shader.h" +#endif + +// +static AsuraEditor::Graphics::ShaderProgram image_shader = +{ +R"( +in vec2 asura_position; +in vec2 asura_texcoord0; + +uniform mat4 asura_model_matrix; +uniform mat4 asura_view_matrix; +uniform mat4 asura_projection_matrix; + +void main() +{ + gl_Position = asura_projection_matrix * asura_view_matrix * asura_model_matrix * vec4(asura_position, 0, 1); + uv = asura_texcoord0; +} + +)", + +R"( +in vec2 uv; + +uniform sampler2D img; + +void main() +{ + +} + +)" +};
\ No newline at end of file diff --git a/source/Asura.Editor/graphics/shaders/poly_line.shader.h b/source/Asura.Editor/graphics/shaders/poly_line.shader.h new file mode 100644 index 0000000..763fd45 --- /dev/null +++ b/source/Asura.Editor/graphics/shaders/poly_line.shader.h @@ -0,0 +1,15 @@ + +const char* s = R"( +in vec2 asura_position; +in vec2 asura_texcoord0; + +uniform mat4 asura_model_matrix; +uniform mat4 asura_view_matrix; +uniform mat4 asura_projection_matrix; + +void main() +{ + gl_Position = asura_model_ +} + +)";
\ No newline at end of file diff --git a/source/Asura.Editor/graphics/shaders/poly_shape.shader.h b/source/Asura.Editor/graphics/shaders/poly_shape.shader.h new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/source/Asura.Editor/graphics/shaders/poly_shape.shader.h |