summaryrefslogtreecommitdiff
path: root/source/Asura.Editor/Graphics
diff options
context:
space:
mode:
authorchai <chaifix@163.com>2019-08-02 20:51:00 +0800
committerchai <chaifix@163.com>2019-08-02 20:51:00 +0800
commitbad78945ceba425f6a80e3b8dca2414d592970eb (patch)
tree8bf7540766349c534bf9e5746b24fd7507ba034e /source/Asura.Editor/Graphics
parent99b90496765df21c5f377f42b9ed073ccb34c1fd (diff)
*修改文件名格式
Diffstat (limited to 'source/Asura.Editor/Graphics')
-rw-r--r--source/Asura.Editor/Graphics/Brush.cpp0
-rw-r--r--source/Asura.Editor/Graphics/Brush.h20
-rw-r--r--source/Asura.Editor/Graphics/DrawInfo.cpp0
-rw-r--r--source/Asura.Editor/Graphics/DrawInfo.h16
-rw-r--r--source/Asura.Editor/Graphics/Drawer.cpp16
-rw-r--r--source/Asura.Editor/Graphics/Drawer.h40
-rw-r--r--source/Asura.Editor/Graphics/Pen.cpp0
-rw-r--r--source/Asura.Editor/Graphics/Pen.h7
-rw-r--r--source/Asura.Editor/Graphics/Shader.h18
-rw-r--r--source/Asura.Editor/Graphics/Style.cpp0
-rw-r--r--source/Asura.Editor/Graphics/Style.h15
-rw-r--r--source/Asura.Editor/Graphics/shaders/image.shader.h35
-rw-r--r--source/Asura.Editor/Graphics/shaders/polygon.shader.h29
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..ee38319
--- /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-utils/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..638ce08
--- /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-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);
+ 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..b6ed2c5
--- /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-utils/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