diff options
author | chai <chaifix@163.com> | 2019-08-07 21:08:47 +0800 |
---|---|---|
committer | chai <chaifix@163.com> | 2019-08-07 21:08:47 +0800 |
commit | 0c391fdbce5a079cf03e483eb6174dd47806163d (patch) | |
tree | b06cd7a9d0ae0d9bb9e82f3dcb786dfce11f8628 /Source/Asura.Editor/Graphics | |
parent | 9686368e58e25cbd6dc37d686bdd2be3f80486d6 (diff) |
*misc
Diffstat (limited to 'Source/Asura.Editor/Graphics')
-rw-r--r-- | Source/Asura.Editor/Graphics/Brush.cpp | 0 | ||||
-rw-r--r-- | Source/Asura.Editor/Graphics/Brush.h | 20 | ||||
-rw-r--r-- | Source/Asura.Editor/Graphics/DrawInfo.cpp | 0 | ||||
-rw-r--r-- | Source/Asura.Editor/Graphics/DrawInfo.h | 16 | ||||
-rw-r--r-- | Source/Asura.Editor/Graphics/Drawer.cpp | 16 | ||||
-rw-r--r-- | Source/Asura.Editor/Graphics/Drawer.h | 40 | ||||
-rw-r--r-- | Source/Asura.Editor/Graphics/Pen.cpp | 0 | ||||
-rw-r--r-- | Source/Asura.Editor/Graphics/Pen.h | 7 | ||||
-rw-r--r-- | Source/Asura.Editor/Graphics/Shader.h | 18 | ||||
-rw-r--r-- | Source/Asura.Editor/Graphics/Style.cpp | 0 | ||||
-rw-r--r-- | Source/Asura.Editor/Graphics/Style.h | 15 | ||||
-rw-r--r-- | Source/Asura.Editor/Graphics/shaders/image.shader.h | 35 | ||||
-rw-r--r-- | Source/Asura.Editor/Graphics/shaders/polygon.shader.h | 29 |
13 files changed, 196 insertions, 0 deletions
diff --git a/Source/Asura.Editor/Graphics/Brush.cpp b/Source/Asura.Editor/Graphics/Brush.cpp new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/Source/Asura.Editor/Graphics/Brush.cpp diff --git a/Source/Asura.Editor/Graphics/Brush.h b/Source/Asura.Editor/Graphics/Brush.h new file mode 100644 index 0000000..4290926 --- /dev/null +++ b/Source/Asura.Editor/Graphics/Brush.h @@ -0,0 +1,20 @@ +#ifndef _ASURA_EDITOR_BRUSH_H_ +#define _ASURA_EDITOR_BRUSH_H_ + +namespace AsuraEditor +{ + namespace Graphics + { + + /// + /// ˢָģʽ + /// + class Brush + { + + }; + + } +} + +#endif
\ No newline at end of file diff --git a/Source/Asura.Editor/Graphics/DrawInfo.cpp b/Source/Asura.Editor/Graphics/DrawInfo.cpp new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/Source/Asura.Editor/Graphics/DrawInfo.cpp diff --git a/Source/Asura.Editor/Graphics/DrawInfo.h b/Source/Asura.Editor/Graphics/DrawInfo.h new file mode 100644 index 0000000..f399b41 --- /dev/null +++ b/Source/Asura.Editor/Graphics/DrawInfo.h @@ -0,0 +1,16 @@ +#ifndef _ASURA_EDITOR_DRAW_INFO_H_ +#define _ASURA_EDITOR_DRAW_INFO_H_ + +#include <asura-base/Classes.h> + +namespace_begin(AsuraEditor) + +class DrawInfo +{ + +}; + + +namespace_end + +#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..6482aeb --- /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..4adfa3f --- /dev/null +++ b/Source/Asura.Editor/Graphics/Drawer.h @@ -0,0 +1,40 @@ +#ifndef _ASURA_EDITOR_PAINTER_H_ +#define _ASURA_EDITOR_PAINTER_H_ + +#include <asura-base/Scripting/Scripting.h> +#include <asura-base/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); + void DrawPolyline(); + + private: + + LUAX_DECL_SINGLETON(Drawer); + + }; + + } +} + +#endif
\ No newline at end of file diff --git a/Source/Asura.Editor/Graphics/Pen.cpp b/Source/Asura.Editor/Graphics/Pen.cpp new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/Source/Asura.Editor/Graphics/Pen.cpp diff --git a/Source/Asura.Editor/Graphics/Pen.h b/Source/Asura.Editor/Graphics/Pen.h new file mode 100644 index 0000000..b949d14 --- /dev/null +++ b/Source/Asura.Editor/Graphics/Pen.h @@ -0,0 +1,7 @@ +#ifndef _ASURA_EDITOR_PEN_H_ +#define _ASURA_EDITOR_PEN_H_ + + + + +#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..a3abec1 --- /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/Style.cpp b/Source/Asura.Editor/Graphics/Style.cpp new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/Source/Asura.Editor/Graphics/Style.cpp diff --git a/Source/Asura.Editor/Graphics/Style.h b/Source/Asura.Editor/Graphics/Style.h new file mode 100644 index 0000000..2676c68 --- /dev/null +++ b/Source/Asura.Editor/Graphics/Style.h @@ -0,0 +1,15 @@ +#ifndef _ASURA_EDITOR_GUI_STYLE_H_ +#define _ASURA_EDITOR_GUI_STYLE_H_ + +#include <asura-base/Classes.h> + +namespace_begin(AsuraEditor) + +class GUIStyle +{ + +}; + +namespace_end + +#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..cbdd542 --- /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 asura_maintex; + +void main() +{ + +} + +)" +};
\ No newline at end of file diff --git a/Source/Asura.Editor/Graphics/shaders/polygon.shader.h b/Source/Asura.Editor/Graphics/shaders/polygon.shader.h new file mode 100644 index 0000000..a92e9a6 --- /dev/null +++ b/Source/Asura.Editor/Graphics/shaders/polygon.shader.h @@ -0,0 +1,29 @@ +#ifndef _ASURA_EDITOR_SHADER_H_ +#include "../shader.h" +#endif + +// +static AsuraEditor::Graphics::ShaderProgram polygon_shader = +{ + R"( +in vec2 position; + +uniform mat4 mvp_matrix; + +void main() +{ + gl_Position = mvp_matrix * vec4(position, 0, 1); +} + +)", + +R"( +uniform vec4 color; + +void main() +{ + gl_FragColor = color; +} + +)" +};
\ No newline at end of file |