From a077eb38b01292611f4f6031b75e3e2c1c20f06e Mon Sep 17 00:00:00 2001 From: chai Date: Fri, 16 Aug 2019 08:54:08 +0800 Subject: *misc --- Source/Asura.Editor/Graphics/GUIMaterial.cpp | 5 ++++ Source/Asura.Editor/Graphics/GUIMaterial.h | 22 ++++++++++++++ Source/Asura.Editor/Graphics/GUIStyle.cpp | 4 +++ Source/Asura.Editor/Graphics/GUIStyle.h | 34 +++++++++++++++++++++ Source/Asura.Editor/Graphics/Pen.cpp | 0 Source/Asura.Editor/Graphics/Pen.h | 7 ----- Source/Asura.Editor/Graphics/Shader.h | 13 ++++---- .../Asura.Editor/Graphics/Shaders/GUIClip.shader.h | 35 ++++++++++++++++++++++ .../Asura.Editor/Graphics/Shaders/GUIText.shader.h | 29 ++++++++++++++++++ .../Graphics/Shaders/GUITexture.shader.h | 35 ++++++++++++++++++++++ Source/Asura.Editor/Graphics/Style.cpp | 0 Source/Asura.Editor/Graphics/Style.h | 15 ---------- .../Asura.Editor/Graphics/shaders/image.shader.h | 35 ---------------------- .../Asura.Editor/Graphics/shaders/polygon.shader.h | 29 ------------------ 14 files changed, 169 insertions(+), 94 deletions(-) create mode 100644 Source/Asura.Editor/Graphics/GUIMaterial.cpp create mode 100644 Source/Asura.Editor/Graphics/GUIMaterial.h create mode 100644 Source/Asura.Editor/Graphics/GUIStyle.cpp create mode 100644 Source/Asura.Editor/Graphics/GUIStyle.h delete mode 100644 Source/Asura.Editor/Graphics/Pen.cpp delete mode 100644 Source/Asura.Editor/Graphics/Pen.h create mode 100644 Source/Asura.Editor/Graphics/Shaders/GUIClip.shader.h create mode 100644 Source/Asura.Editor/Graphics/Shaders/GUIText.shader.h create mode 100644 Source/Asura.Editor/Graphics/Shaders/GUITexture.shader.h delete mode 100644 Source/Asura.Editor/Graphics/Style.cpp delete mode 100644 Source/Asura.Editor/Graphics/Style.h delete mode 100644 Source/Asura.Editor/Graphics/shaders/image.shader.h delete mode 100644 Source/Asura.Editor/Graphics/shaders/polygon.shader.h (limited to 'Source/Asura.Editor/Graphics') diff --git a/Source/Asura.Editor/Graphics/GUIMaterial.cpp b/Source/Asura.Editor/Graphics/GUIMaterial.cpp new file mode 100644 index 0000000..b82afaa --- /dev/null +++ b/Source/Asura.Editor/Graphics/GUIMaterial.cpp @@ -0,0 +1,5 @@ +#include "GUIMaterial.h" + +namespace_begin(AsuraEditor) + +namespace_end diff --git a/Source/Asura.Editor/Graphics/GUIMaterial.h b/Source/Asura.Editor/Graphics/GUIMaterial.h new file mode 100644 index 0000000..bccfc7e --- /dev/null +++ b/Source/Asura.Editor/Graphics/GUIMaterial.h @@ -0,0 +1,22 @@ +#ifndef _ASURA_EDITOR_GUI_MATERIAL_H_ +#define _ASURA_EDITOR_GUI_MATERIAL_H_ + +#include + +namespace_begin(AsuraEditor) + +// GUI内建材质 +class GUIMaterial +{ +public: + +private: + + + +}; + + +namespace_end + +#endif diff --git a/Source/Asura.Editor/Graphics/GUIStyle.cpp b/Source/Asura.Editor/Graphics/GUIStyle.cpp new file mode 100644 index 0000000..4da2847 --- /dev/null +++ b/Source/Asura.Editor/Graphics/GUIStyle.cpp @@ -0,0 +1,4 @@ +#include "GUIStyle.h" + + + diff --git a/Source/Asura.Editor/Graphics/GUIStyle.h b/Source/Asura.Editor/Graphics/GUIStyle.h new file mode 100644 index 0000000..8556397 --- /dev/null +++ b/Source/Asura.Editor/Graphics/GUIStyle.h @@ -0,0 +1,34 @@ +#ifndef _ASURA_EDITOR_GUI_STYLE_H_ +#define _ASURA_EDITOR_GUI_STYLE_H_ + +#include + +#include "GUIMaterial.h" + +namespace_begin(AsuraEditor) + +/// 编辑器样式 +class GUIStyle +{ +public: + + GUIStyle(); + ~GUIStyle(); + + void DrawContent(); + +private: + + GUIMaterial* GetGUITextMaterial(); + GUIMaterial* GetGUIBlendMaterial(); + GUIMaterial* GetGUIBlitMaterial(); + + GUIMaterial* m_GUITextMaterial; + GUIMaterial* m_GUIBlendMaterial; + GUIMaterial* m_GUIBlitMaterial; + +}; + +namespace_end + +#endif \ No newline at end of file diff --git a/Source/Asura.Editor/Graphics/Pen.cpp b/Source/Asura.Editor/Graphics/Pen.cpp deleted file mode 100644 index e69de29..0000000 diff --git a/Source/Asura.Editor/Graphics/Pen.h b/Source/Asura.Editor/Graphics/Pen.h deleted file mode 100644 index b949d14..0000000 --- a/Source/Asura.Editor/Graphics/Pen.h +++ /dev/null @@ -1,7 +0,0 @@ -#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 index a3abec1..af291a5 100644 --- a/Source/Asura.Editor/Graphics/Shader.h +++ b/Source/Asura.Editor/Graphics/Shader.h @@ -3,16 +3,13 @@ namespace AsuraEditor { - namespace Graphics - { - struct ShaderProgram - { - const char* vert; - const char* frag; - }; +struct ShaderProgram +{ + const char* vert; + const char* frag; +}; - } } #endif \ No newline at end of file diff --git a/Source/Asura.Editor/Graphics/Shaders/GUIClip.shader.h b/Source/Asura.Editor/Graphics/Shaders/GUIClip.shader.h new file mode 100644 index 0000000..cbdd542 --- /dev/null +++ b/Source/Asura.Editor/Graphics/Shaders/GUIClip.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/GUIText.shader.h b/Source/Asura.Editor/Graphics/Shaders/GUIText.shader.h new file mode 100644 index 0000000..a92e9a6 --- /dev/null +++ b/Source/Asura.Editor/Graphics/Shaders/GUIText.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 diff --git a/Source/Asura.Editor/Graphics/Shaders/GUITexture.shader.h b/Source/Asura.Editor/Graphics/Shaders/GUITexture.shader.h new file mode 100644 index 0000000..cbdd542 --- /dev/null +++ b/Source/Asura.Editor/Graphics/Shaders/GUITexture.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/Style.cpp b/Source/Asura.Editor/Graphics/Style.cpp deleted file mode 100644 index e69de29..0000000 diff --git a/Source/Asura.Editor/Graphics/Style.h b/Source/Asura.Editor/Graphics/Style.h deleted file mode 100644 index 2676c68..0000000 --- a/Source/Asura.Editor/Graphics/Style.h +++ /dev/null @@ -1,15 +0,0 @@ -#ifndef _ASURA_EDITOR_GUI_STYLE_H_ -#define _ASURA_EDITOR_GUI_STYLE_H_ - -#include - -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 deleted file mode 100644 index cbdd542..0000000 --- a/Source/Asura.Editor/Graphics/shaders/image.shader.h +++ /dev/null @@ -1,35 +0,0 @@ -#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 deleted file mode 100644 index a92e9a6..0000000 --- a/Source/Asura.Editor/Graphics/shaders/polygon.shader.h +++ /dev/null @@ -1,29 +0,0 @@ -#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 -- cgit v1.1-26-g67d0