summaryrefslogtreecommitdiff
path: root/Source/Asura.Editor
diff options
context:
space:
mode:
Diffstat (limited to 'Source/Asura.Editor')
-rw-r--r--Source/Asura.Editor/Controls/GUIPanel.cpp6
-rw-r--r--Source/Asura.Editor/Controls/GUIPanel.h10
-rw-r--r--Source/Asura.Editor/Graphics/GUIMaterial.cpp5
-rw-r--r--Source/Asura.Editor/Graphics/GUIMaterial.h22
-rw-r--r--Source/Asura.Editor/Graphics/GUIStyle.cpp4
-rw-r--r--Source/Asura.Editor/Graphics/GUIStyle.h34
-rw-r--r--Source/Asura.Editor/Graphics/Pen.h7
-rw-r--r--Source/Asura.Editor/Graphics/Shader.h13
-rw-r--r--Source/Asura.Editor/Graphics/Shaders/GUIClip.shader.h (renamed from Source/Asura.Editor/Graphics/shaders/image.shader.h)0
-rw-r--r--Source/Asura.Editor/Graphics/Shaders/GUIText.shader.h (renamed from Source/Asura.Editor/Graphics/shaders/polygon.shader.h)0
-rw-r--r--Source/Asura.Editor/Graphics/Shaders/GUITexture.shader.h35
-rw-r--r--Source/Asura.Editor/Graphics/Style.cpp0
-rw-r--r--Source/Asura.Editor/Graphics/Style.h15
-rw-r--r--Source/Asura.Editor/System/ContainerFrame.cpp6
-rw-r--r--Source/Asura.Editor/System/ContainerFrame.h63
-rw-r--r--Source/Asura.Editor/System/ContainerWindow.h14
-rw-r--r--Source/Asura.Editor/System/GUIWindow.cpp (renamed from Source/Asura.Editor/Graphics/Pen.cpp)0
-rw-r--r--Source/Asura.Editor/System/GUIWindow.h36
-rw-r--r--Source/Asura.Editor/System/Input.cpp2
19 files changed, 225 insertions, 47 deletions
diff --git a/Source/Asura.Editor/Controls/GUIPanel.cpp b/Source/Asura.Editor/Controls/GUIPanel.cpp
index 3a78af7..e69de29 100644
--- a/Source/Asura.Editor/Controls/GUIPanel.cpp
+++ b/Source/Asura.Editor/Controls/GUIPanel.cpp
@@ -1,6 +0,0 @@
-#include "GUIPanel.h"
-
-namespace_begin(AsuraEditor)
-
-
-namespace_end
diff --git a/Source/Asura.Editor/Controls/GUIPanel.h b/Source/Asura.Editor/Controls/GUIPanel.h
index 0f98eaa..9ff6eed 100644
--- a/Source/Asura.Editor/Controls/GUIPanel.h
+++ b/Source/Asura.Editor/Controls/GUIPanel.h
@@ -1,11 +1,13 @@
-#ifndef _ASURA_EDITOR_GUI_PANEL_H_
-#define _ASURA_EDITOR_GUI_PANEL_H_
+#ifndef _ASURA_EDITOR_GUIPANEL_H_
+#define _ASURA_EDITOR_GUIPANEL_H_
#include <asura-base/Classes.h>
+#include "../System/GUIWindow.h"
+
namespace_begin(AsuraEditor)
-/// IMGUI panel
+// GUIWindowĵ
class GUIPanel
{
public:
@@ -15,10 +17,12 @@ public:
private:
+ GUIWindow* m_GUIWindow; // Ļƴ
};
+
namespace_end
#endif \ No newline at end of file
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 <asura-base/Classes.h>
+
+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 <asura-base/Classes.h>
+
+#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.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/image.shader.h b/Source/Asura.Editor/Graphics/Shaders/GUIClip.shader.h
index cbdd542..cbdd542 100644
--- a/Source/Asura.Editor/Graphics/shaders/image.shader.h
+++ b/Source/Asura.Editor/Graphics/Shaders/GUIClip.shader.h
diff --git a/Source/Asura.Editor/Graphics/shaders/polygon.shader.h b/Source/Asura.Editor/Graphics/Shaders/GUIText.shader.h
index a92e9a6..a92e9a6 100644
--- a/Source/Asura.Editor/Graphics/shaders/polygon.shader.h
+++ b/Source/Asura.Editor/Graphics/Shaders/GUIText.shader.h
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
--- a/Source/Asura.Editor/Graphics/Style.cpp
+++ /dev/null
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 <asura-base/Classes.h>
-
-namespace_begin(AsuraEditor)
-
-class GUIStyle
-{
-
-};
-
-namespace_end
-
-#endif \ No newline at end of file
diff --git a/Source/Asura.Editor/System/ContainerFrame.cpp b/Source/Asura.Editor/System/ContainerFrame.cpp
new file mode 100644
index 0000000..9626317
--- /dev/null
+++ b/Source/Asura.Editor/System/ContainerFrame.cpp
@@ -0,0 +1,6 @@
+#include "ContainerFrame.h"
+
+namespace_begin(AsuraEditor)
+
+
+namespace_end
diff --git a/Source/Asura.Editor/System/ContainerFrame.h b/Source/Asura.Editor/System/ContainerFrame.h
new file mode 100644
index 0000000..51a08d4
--- /dev/null
+++ b/Source/Asura.Editor/System/ContainerFrame.h
@@ -0,0 +1,63 @@
+#ifndef _ASURA_CONTAINER_FRAME_H_
+#define _ASURA_CONTAINER_FRAME_H_
+
+#include <windows.h>
+#include <string.h>
+
+#include <asura-base/Scripting/Scripting.h>
+#include <asura-base/Classes.h>
+
+#include "../Type.h"
+
+namespace_begin(AsuraEditor)
+
+/// ༭ڵnativeڣΪmenuûmenuģGUIWindow
+class ContainerFrame : public AEScripting::Portable<ContainerFrame>
+{
+public:
+
+ enum WindowStyle
+ {
+ WINDOW_STYLE_MAIN, ///<
+ WINDOW_STYLE_NORMAL, ///<
+ WINDOW_STYLE_TOOL, ///<
+ WINDOW_STYLE_POPUP, ///<
+ };
+
+ struct WindowConfig
+ {
+ std::string title; ///<
+ uint x, y; ///<
+ uint width, height; ///< С
+ WindowStyle style; ///<
+ };
+
+ ContainerFrame();
+ ~ContainerFrame();
+
+ bool Init(WindowConfig& config);
+
+private:
+
+ WindowStyle m_Style;
+ HWND m_HWND;
+ HDC m_HDC;
+
+luaxport:
+
+ LUAX_DECL_FACTORY(ContainerFrame);
+
+ LUAX_DECL_ENUM(WindowStyle);
+
+ LUAX_DECL_METHOD(_New);
+ LUAX_DECL_METHOD(_Init);
+ LUAX_DECL_METHOD(_SetPosition);
+
+};
+
+// GUIWindowĿ
+using ContainerWindow = ContainerFrame;
+
+namespace_end
+
+#endif \ No newline at end of file
diff --git a/Source/Asura.Editor/System/ContainerWindow.h b/Source/Asura.Editor/System/ContainerWindow.h
index 5893aff..06a7b82 100644
--- a/Source/Asura.Editor/System/ContainerWindow.h
+++ b/Source/Asura.Editor/System/ContainerWindow.h
@@ -11,9 +11,7 @@
namespace_begin(AsuraEditor)
-///
-/// ༭ڵnative
-///
+/// ༭ڵnativeڣΪmenuûmenuģGUIWindow
class ContainerWindow : public AEScripting::Portable<ContainerWindow>
{
public:
@@ -40,10 +38,9 @@ public:
private:
- ContainerWindow* mParent;
- WindowStyle mStyle;
- HWND mHWND;
- HDC mHDC;
+ WindowStyle m_Style;
+ HWND m_HWND;
+ HDC m_HDC;
luaxport:
@@ -57,6 +54,9 @@ luaxport:
};
+// GUIWindowĿ
+using ContainerFrame = ContainerWindow;
+
namespace_end
#endif \ No newline at end of file
diff --git a/Source/Asura.Editor/Graphics/Pen.cpp b/Source/Asura.Editor/System/GUIWindow.cpp
index e69de29..e69de29 100644
--- a/Source/Asura.Editor/Graphics/Pen.cpp
+++ b/Source/Asura.Editor/System/GUIWindow.cpp
diff --git a/Source/Asura.Editor/System/GUIWindow.h b/Source/Asura.Editor/System/GUIWindow.h
new file mode 100644
index 0000000..228aa74
--- /dev/null
+++ b/Source/Asura.Editor/System/GUIWindow.h
@@ -0,0 +1,36 @@
+#ifndef _ASURA_GUI_WINDOW_H_
+#define _ASURA_GUI_WINDOW_H_
+
+#include <vector>
+
+#include <asura-base/Classes.h>
+
+#include "ContainerWindow.h"
+
+namespace_begin(AsuraEditor)
+
+typedef std::vector<GUIPanel*> GUIPanelVector;
+
+/// һGUIWindowGUI paneltabpanelлGUIԪصĴڡ
+class GUIWindow
+{
+public:
+
+ GUIWindow();
+ ~GUIWindow();
+
+ void DoRepint();
+
+private:
+
+ ContainerWindow* m_ParentWindow;
+ GUIPanelVector m_GUIPanels;
+
+ bool m_IsRepaint;
+
+};
+
+
+namespace_end
+
+#endif \ No newline at end of file
diff --git a/Source/Asura.Editor/System/Input.cpp b/Source/Asura.Editor/System/Input.cpp
index c10eb3b..80086d3 100644
--- a/Source/Asura.Editor/System/Input.cpp
+++ b/Source/Asura.Editor/System/Input.cpp
@@ -49,7 +49,7 @@ LRESULT Input::OnDeviceChange(LPCWSTR name, bool add)
{
}
-bool Input::ConvertPositionToClientAreaCoord(HWND activeWindow, POINT position, AEMath::Vector2f& newPos)
+bool Input::ConvertPositionToClientAreaCoord(HWND activeWindow, POINT position, Vector2f& newPos)
{
}