diff options
-rw-r--r-- | Data/BuiltIn/Libraries/GameLab/Camera.lua | 0 | ||||
-rw-r--r-- | Data/BuiltIn/Libraries/GameLab/Engine/GUI/IMGUI.lua | 5 | ||||
-rw-r--r-- | Data/BuiltIn/Libraries/GameLab/Helper.lua | 26 | ||||
-rw-r--r-- | Data/BuiltIn/Libraries/GameLab/StringUtil.lua | 4 | ||||
-rw-r--r-- | Data/BuiltIn/Libraries/GameLab/define.lua | 1 | ||||
-rw-r--r-- | Data/Libraries/GameLab/Editor/Window/GUIWindow.lua | 8 | ||||
-rw-r--r-- | Data/Scripts/EditorResources.lua | 11 | ||||
-rw-r--r-- | Data/Scripts/defines.lua | 5 | ||||
-rw-r--r-- | Documents/Unity.xlsx | bin | 195084 -> 292645 bytes | |||
-rw-r--r-- | Runtime/Scripting/GL/GL.bind.cpp | 67 | ||||
-rw-r--r-- | Test/README.txt | 1 | ||||
-rw-r--r-- | Test/lua/env.lua | 3 |
12 files changed, 100 insertions, 31 deletions
diff --git a/Data/BuiltIn/Libraries/GameLab/Camera.lua b/Data/BuiltIn/Libraries/GameLab/Camera.lua new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/Data/BuiltIn/Libraries/GameLab/Camera.lua diff --git a/Data/BuiltIn/Libraries/GameLab/Engine/GUI/IMGUI.lua b/Data/BuiltIn/Libraries/GameLab/Engine/GUI/IMGUI.lua index a16c2ed..cf84bff 100644 --- a/Data/BuiltIn/Libraries/GameLab/Engine/GUI/IMGUI.lua +++ b/Data/BuiltIn/Libraries/GameLab/Engine/GUI/IMGUI.lua @@ -15,6 +15,11 @@ local Rendering = GameLab.Engine.Rendering local EEventType = GameLab.Events.EEventType
local Resource = GameLab.Engine.Resource
+local EditorRes
+if GAMELAB_EDITOR then
+ EditorRes = find "Scripts/EditorResources"
+end
+
GUI.BeginOnGUI = function()
GUIState.ResetControlID()
end
diff --git a/Data/BuiltIn/Libraries/GameLab/Helper.lua b/Data/BuiltIn/Libraries/GameLab/Helper.lua new file mode 100644 index 0000000..19b586e --- /dev/null +++ b/Data/BuiltIn/Libraries/GameLab/Helper.lua @@ -0,0 +1,26 @@ +local Helper = GameLab.GlobalClass("GameLab.Helper")
+
+function Helper:Ctor()
+ self.path = {}
+ self.cpath = {}
+end
+
+function Helper:RestorePath()
+ local path = package.path
+
+end
+
+function Helper:RestoreCPath()
+ local cpath = package.cpath
+
+end
+
+function Helper:AddPath()
+
+end
+
+function Helper:AddCPath()
+
+end
+
+return Helper
\ No newline at end of file diff --git a/Data/BuiltIn/Libraries/GameLab/StringUtil.lua b/Data/BuiltIn/Libraries/GameLab/StringUtil.lua new file mode 100644 index 0000000..6b1c027 --- /dev/null +++ b/Data/BuiltIn/Libraries/GameLab/StringUtil.lua @@ -0,0 +1,4 @@ +local util = Gamelab.GloablTable("GameLab.StringUtil")
+
+
+return util
\ No newline at end of file diff --git a/Data/BuiltIn/Libraries/GameLab/define.lua b/Data/BuiltIn/Libraries/GameLab/define.lua index dd4420e..ba1e130 100644 --- a/Data/BuiltIn/Libraries/GameLab/define.lua +++ b/Data/BuiltIn/Libraries/GameLab/define.lua @@ -1,4 +1,3 @@ -
local define = {}
define.builtInPath = "./BuiltIn"
diff --git a/Data/Libraries/GameLab/Editor/Window/GUIWindow.lua b/Data/Libraries/GameLab/Editor/Window/GUIWindow.lua index c430cfd..f1f4445 100644 --- a/Data/Libraries/GameLab/Editor/Window/GUIWindow.lua +++ b/Data/Libraries/GameLab/Editor/Window/GUIWindow.lua @@ -19,10 +19,10 @@ local clone = Utils.Clone local i = 0
local col = {
- {1, 0, 0, 1},
- {1, 1, 0, 1},
- {0, 0, 1, 1},
- {0, 1, 1, 1},
+ {1, 0, 0, 0.5},
+ {1, 1, 0, 0.5},
+ {0, 0, 1, 0.5},
+ {0, 1, 1, 0.5},
}
local kSideBorders = 2 -- GUIView的右边距
diff --git a/Data/Scripts/EditorResources.lua b/Data/Scripts/EditorResources.lua new file mode 100644 index 0000000..c9d2e77 --- /dev/null +++ b/Data/Scripts/EditorResources.lua @@ -0,0 +1,11 @@ +local find = GameLab.Find
+
+local res = {}
+
+local loadRes = function()
+
+end
+
+GameLab.onApplicationStart:Add(loadRes)
+
+return res
\ No newline at end of file diff --git a/Data/Scripts/defines.lua b/Data/Scripts/defines.lua index cec592c..ec456a5 100644 --- a/Data/Scripts/defines.lua +++ b/Data/Scripts/defines.lua @@ -1,2 +1,7 @@ GAMELAB_PROFILE = true GAMELAB_DEBUG = true + +GAMELAB_EDITOR = true +GAMELAB_RUNNER = false + +GAMELAB_VERSION = "0.0.1" diff --git a/Documents/Unity.xlsx b/Documents/Unity.xlsx Binary files differindex 70d0a73..a2561fc 100644 --- a/Documents/Unity.xlsx +++ b/Documents/Unity.xlsx diff --git a/Runtime/Scripting/GL/GL.bind.cpp b/Runtime/Scripting/GL/GL.bind.cpp index f97b1e0..caf3877 100644 --- a/Runtime/Scripting/GL/GL.bind.cpp +++ b/Runtime/Scripting/GL/GL.bind.cpp @@ -175,6 +175,21 @@ int Color(lua_State* L) return 0; } +// left, bottom, width, height +int Viewport(lua_State* L) +{ + LUA_BIND_STATE(L); + + float left = state.GetValue<float>(1, 0); + float right = state.GetValue<float>(2, 0); + float width = state.GetValue<float>(3, 0); + float height = state.GetValue<float>(4, 0); + + glViewport(left, right, width, height); + + return 0; +} + int LoadIdentity(lua_State* L) { glLoadIdentity(); @@ -397,25 +412,25 @@ int Translate(lua_State* L) } static luaL_Reg glFuncs[] = { - {"ClearColor", ClearColor}, - {"Clear", Clear}, - // immediate mode apis - {"Color", Color}, - {"Begin", Begin}, - {"End", End}, - {"Vertex", Vertex }, - {"LoadIdentity", LoadIdentity}, - {"PushMatrix", PushMatrix}, - {"PopMatrix", PopMatrix}, - {"MatrixMode", MatrixMode}, - {"LoadMatrix", LoadMatrix}, - {"LoadOrthoMatrix", OrthoMatrix}, - {"LoadFrustumMatrix", FrustumMatrix}, - {"MultMatrix", MultMatrix}, - {"Scale", Scale}, - {"Rotate", Rotate}, - {"Translate", Translate}, - {0, 0} + { "ClearColor", ClearColor }, + { "Clear", Clear }, + { "Color", Color }, + { "Viewport", Viewport }, + { "Begin", Begin }, + { "End", End }, + { "Vertex", Vertex }, + { "LoadIdentity", LoadIdentity }, + { "PushMatrix", PushMatrix }, + { "PopMatrix", PopMatrix }, + { "MatrixMode", MatrixMode }, + { "LoadMatrix", LoadMatrix }, + { "LoadOrthoMatrix", OrthoMatrix }, + { "LoadFrustumMatrix", FrustumMatrix }, + { "MultMatrix", MultMatrix }, + { "Scale", Scale }, + { "Rotate", Rotate }, + { "Translate", Translate }, + { 0, 0} }; // GameLab.Engine.GL @@ -433,20 +448,20 @@ int luaopen_GameLab_Engine_GL(lua_State* L) state.RegisterMethods(glFuncs); LUA_BIND_REGISTER_ENUM(state, "EBufferType", - { "ColorBuffer", EBufferType::ColorBuffer }, - { "DepthBuffer", EBufferType::DepthBuffer}, - { "StencilBuffer", EBufferType::StencilBuffer} + { "ColorBuffer", EBufferType::ColorBuffer }, + { "DepthBuffer", EBufferType::DepthBuffer }, + { "StencilBuffer", EBufferType::StencilBuffer } ); LUA_BIND_REGISTER_ENUM(state, "EPrimitiveType", { "Triangles", EPrimitiveType::Triangles }, - { "Lines", EPrimitiveType::Lines }, - { "Points", EPrimitiveType::Points } + { "Lines", EPrimitiveType::Lines }, + { "Points", EPrimitiveType::Points } ); LUA_BIND_REGISTER_ENUM(state, "EMatrixMode", - { "MatrixView", EMatrixMode::ModelView }, - { "Projection", EMatrixMode::Projection} + { "MatrixView", EMatrixMode::ModelView }, + { "Projection", EMatrixMode::Projection } ); return 1; diff --git a/Test/README.txt b/Test/README.txt new file mode 100644 index 0000000..8409f9f --- /dev/null +++ b/Test/README.txt @@ -0,0 +1 @@ +一些测试的代码存在这个目录下
\ No newline at end of file diff --git a/Test/lua/env.lua b/Test/lua/env.lua new file mode 100644 index 0000000..9b352ec --- /dev/null +++ b/Test/lua/env.lua @@ -0,0 +1,3 @@ +-- 环境中执行代码
+
+
|