summaryrefslogtreecommitdiff
path: root/Source/Asura.Framework
diff options
context:
space:
mode:
Diffstat (limited to 'Source/Asura.Framework')
-rw-r--r--Source/Asura.Framework/Filesystem/animation_loader.lua4
-rw-r--r--Source/Asura.Framework/Framework.lua1
-rw-r--r--Source/Asura.Framework/GUI/Button.lua5
-rw-r--r--Source/Asura.Framework/Graphics/Material.lua11
-rw-r--r--Source/Asura.Framework/compile.sh (renamed from Source/Asura.Framework/Game.lua)0
-rw-r--r--Source/Asura.Framework/filesystem/animation_loader.lua4
-rw-r--r--Source/Asura.Framework/filesystem/asset.lua7
-rw-r--r--Source/Asura.Framework/filesystem/image_loader.lua13
-rw-r--r--Source/Asura.Framework/filesystem/shader_loader.lua5
-rw-r--r--Source/Asura.Framework/framework.lua1
-rw-r--r--Source/Asura.Framework/graphics/canvas.lua18
-rw-r--r--Source/Asura.Framework/graphics/canvas_renderer.lua0
-rw-r--r--Source/Asura.Framework/graphics/image.lua37
-rw-r--r--Source/Asura.Framework/graphics/material.lua11
-rw-r--r--Source/Asura.Framework/graphics/mesh2d.lua (renamed from Source/Asura.Framework/Graphics/canvas_renderer.lua)0
-rw-r--r--Source/Asura.Framework/graphics/shader.lua40
-rw-r--r--Source/Asura.Framework/graphics/shape.lua (renamed from Source/Asura.Framework/game.lua)0
-rw-r--r--Source/Asura.Framework/graphics/sprite.lua10
-rw-r--r--Source/Asura.Framework/gui/button.lua5
19 files changed, 148 insertions, 24 deletions
diff --git a/Source/Asura.Framework/Filesystem/animation_loader.lua b/Source/Asura.Framework/Filesystem/animation_loader.lua
index 4f989bd..c6808c0 100644
--- a/Source/Asura.Framework/Filesystem/animation_loader.lua
+++ b/Source/Asura.Framework/Filesystem/animation_loader.lua
@@ -6,7 +6,5 @@ local manager = AsuraEngine.AnimationManager
local Animation = AsuraEngine.Animation
function AnimationLoader.Load(asset)
-
- local animation = AsuraEngine.Class()
-
+ local animation = AsuraEngine.Class()
end \ No newline at end of file
diff --git a/Source/Asura.Framework/Framework.lua b/Source/Asura.Framework/Framework.lua
index 449cc4a..14e7b24 100644
--- a/Source/Asura.Framework/Framework.lua
+++ b/Source/Asura.Framework/Framework.lua
@@ -1 +1,2 @@
+--框架入口文件
require ""
diff --git a/Source/Asura.Framework/GUI/Button.lua b/Source/Asura.Framework/GUI/Button.lua
index a63cc01..260759b 100644
--- a/Source/Asura.Framework/GUI/Button.lua
+++ b/Source/Asura.Framework/GUI/Button.lua
@@ -1,6 +1,5 @@
--- Ϸimgui
-
-local Button = AsuraEngine.Component.Extend("Button")
+--
+local Button = AsuraEngine.Component.Sub("Button")
diff --git a/Source/Asura.Framework/Graphics/Material.lua b/Source/Asura.Framework/Graphics/Material.lua
index 0ba970c..e50b273 100644
--- a/Source/Asura.Framework/Graphics/Material.lua
+++ b/Source/Asura.Framework/Graphics/Material.lua
@@ -1,10 +1,9 @@
---[[
-material是shader的代理
-]]
-local Material = AsuraEngine.Class()
+--material是shader的代理
+local Material = AsuraEngine.Asset.Sub("Material")
function Material:Ctor()
-
+ self.uniforms = {} --uniform变量和值
+ self.isShared = false
end
function Material:ToAsset()
@@ -15,7 +14,7 @@ function Material:GetUniform(name)
end
-function Material:SendFloat()
+function Material:SetFloat()
end
diff --git a/Source/Asura.Framework/Game.lua b/Source/Asura.Framework/compile.sh
index e69de29..e69de29 100644
--- a/Source/Asura.Framework/Game.lua
+++ b/Source/Asura.Framework/compile.sh
diff --git a/Source/Asura.Framework/filesystem/animation_loader.lua b/Source/Asura.Framework/filesystem/animation_loader.lua
index 4f989bd..c6808c0 100644
--- a/Source/Asura.Framework/filesystem/animation_loader.lua
+++ b/Source/Asura.Framework/filesystem/animation_loader.lua
@@ -6,7 +6,5 @@ local manager = AsuraEngine.AnimationManager
local Animation = AsuraEngine.Animation
function AnimationLoader.Load(asset)
-
- local animation = AsuraEngine.Class()
-
+ local animation = AsuraEngine.Class()
end \ No newline at end of file
diff --git a/Source/Asura.Framework/filesystem/asset.lua b/Source/Asura.Framework/filesystem/asset.lua
new file mode 100644
index 0000000..09b4be3
--- /dev/null
+++ b/Source/Asura.Framework/filesystem/asset.lua
@@ -0,0 +1,7 @@
+local Asset = AsuraEngine.Class("Asset")
+AsuraEngine.Asset = Asset
+
+--获得资源编号
+function Asset.GetGUID(self)
+
+end
diff --git a/Source/Asura.Framework/filesystem/image_loader.lua b/Source/Asura.Framework/filesystem/image_loader.lua
new file mode 100644
index 0000000..174d837
--- /dev/null
+++ b/Source/Asura.Framework/filesystem/image_loader.lua
@@ -0,0 +1,13 @@
+require "graphics.image"
+local loader = AsuraEngine.Loader.New("image")
+
+function loader.Load(asset)
+ assert(asset ~= nil)
+ local path = asset.extern
+ local image = AusraEngine.Image.New(path)
+ if image == nil then
+ AsuraEngine.LogError("")
+ return
+ end
+ return image
+end \ No newline at end of file
diff --git a/Source/Asura.Framework/filesystem/shader_loader.lua b/Source/Asura.Framework/filesystem/shader_loader.lua
new file mode 100644
index 0000000..d488eb9
--- /dev/null
+++ b/Source/Asura.Framework/filesystem/shader_loader.lua
@@ -0,0 +1,5 @@
+local loader = AsuraEngine.Loader.New("shader")
+
+function loader.Load(asset)
+
+end \ No newline at end of file
diff --git a/Source/Asura.Framework/framework.lua b/Source/Asura.Framework/framework.lua
index 449cc4a..14e7b24 100644
--- a/Source/Asura.Framework/framework.lua
+++ b/Source/Asura.Framework/framework.lua
@@ -1 +1,2 @@
+--框架入口文件
require ""
diff --git a/Source/Asura.Framework/graphics/canvas.lua b/Source/Asura.Framework/graphics/canvas.lua
new file mode 100644
index 0000000..b0a2cfb
--- /dev/null
+++ b/Source/Asura.Framework/graphics/canvas.lua
@@ -0,0 +1,18 @@
+local Canvas = AsuraEngine.Component.Sub("Canvas")
+AsuraEngine.Canvas = Canvas
+
+function Canvas.Ctor(self, width, height)
+ self.simCanvas = AsuraEngine.SimCanvas.New(width, height)
+ self.width = width
+ self.height = height
+end
+
+function Canvas.OnEnable(self)
+
+end
+
+function Canvas.OnDisable(self)
+
+end
+
+
diff --git a/Source/Asura.Framework/graphics/canvas_renderer.lua b/Source/Asura.Framework/graphics/canvas_renderer.lua
deleted file mode 100644
index e69de29..0000000
--- a/Source/Asura.Framework/graphics/canvas_renderer.lua
+++ /dev/null
diff --git a/Source/Asura.Framework/graphics/image.lua b/Source/Asura.Framework/graphics/image.lua
new file mode 100644
index 0000000..ad2e1a9
--- /dev/null
+++ b/Source/Asura.Framework/graphics/image.lua
@@ -0,0 +1,37 @@
+-- 图片资源
+local Image = AsuraEngine.Asset.Sub("Image")
+AsuraEngine.Image = Image
+
+function Image.Ctor(self, path)
+ local simImage = AsuraEngine.SimImage.New(path)
+ local w, h = simImage:GetSize()
+ self.simImage = simImage
+ self.width = w
+ self.height = h
+end
+
+function Image.GetWidth(self)
+ return self.simImage.GetWidth()
+end
+
+function Image.GetHeight(self)
+ return self.simImage.GetHeight()
+end
+
+function Image.GetSize(self)
+ return self.simImage.GetSize()
+end
+
+--获得x,y位置的颜色值
+function Image.GetColor(self, x, y)
+ return self.simImage.GetColor(x, y)
+end
+
+--获得所有像素,返回到一个table里
+function Image.GetPixels(self)
+ return self.simImage:GetPixels()
+end
+
+--image不可再编辑器编辑,所以没有ToAsset方法
+--function Image.ToAsset()
+--end
diff --git a/Source/Asura.Framework/graphics/material.lua b/Source/Asura.Framework/graphics/material.lua
index 0ba970c..e50b273 100644
--- a/Source/Asura.Framework/graphics/material.lua
+++ b/Source/Asura.Framework/graphics/material.lua
@@ -1,10 +1,9 @@
---[[
-material是shader的代理
-]]
-local Material = AsuraEngine.Class()
+--material是shader的代理
+local Material = AsuraEngine.Asset.Sub("Material")
function Material:Ctor()
-
+ self.uniforms = {} --uniform变量和值
+ self.isShared = false
end
function Material:ToAsset()
@@ -15,7 +14,7 @@ function Material:GetUniform(name)
end
-function Material:SendFloat()
+function Material:SetFloat()
end
diff --git a/Source/Asura.Framework/Graphics/canvas_renderer.lua b/Source/Asura.Framework/graphics/mesh2d.lua
index e69de29..e69de29 100644
--- a/Source/Asura.Framework/Graphics/canvas_renderer.lua
+++ b/Source/Asura.Framework/graphics/mesh2d.lua
diff --git a/Source/Asura.Framework/graphics/shader.lua b/Source/Asura.Framework/graphics/shader.lua
new file mode 100644
index 0000000..d381575
--- /dev/null
+++ b/Source/Asura.Framework/graphics/shader.lua
@@ -0,0 +1,40 @@
+local Shader = AsuraEngine.Asset.Sub("Shader")
+AsuraEngine.Shader = Shader
+
+function Shader.Ctor(self, vert, frag)
+ local simShader = AsuraEngine.simShader(vert, frag)
+ self.simShader = shader
+
+end
+
+function Shader.SendVec2(self, name, vec2)
+
+end
+
+function Shader.SendVec3(self, name, vec3)
+
+end
+
+function Shader.SendVec4(self, name, vec4)
+
+end
+
+function Shader.SendTexture(self, name, tex)
+
+end
+
+function Shader.SendFloat(self, name, number)
+
+end
+
+function Shader.SendInteger(self, name, integer)
+
+end
+
+function Shader.SendColor(self, name, color)
+
+end
+
+function Shader.SendMat44(self, name, mat44)
+
+end
diff --git a/Source/Asura.Framework/game.lua b/Source/Asura.Framework/graphics/shape.lua
index e69de29..e69de29 100644
--- a/Source/Asura.Framework/game.lua
+++ b/Source/Asura.Framework/graphics/shape.lua
diff --git a/Source/Asura.Framework/graphics/sprite.lua b/Source/Asura.Framework/graphics/sprite.lua
new file mode 100644
index 0000000..745138e
--- /dev/null
+++ b/Source/Asura.Framework/graphics/sprite.lua
@@ -0,0 +1,10 @@
+local Sprite = AsuraEngine.Asset.Sub("Sprite")
+AsuraEngine.Sprite = Sprite
+
+function Sprite.Ctor(self, image)
+ self.image = image
+end
+
+function Sprite.ToAsset(self)
+
+end \ No newline at end of file
diff --git a/Source/Asura.Framework/gui/button.lua b/Source/Asura.Framework/gui/button.lua
index a63cc01..260759b 100644
--- a/Source/Asura.Framework/gui/button.lua
+++ b/Source/Asura.Framework/gui/button.lua
@@ -1,6 +1,5 @@
--- Ϸimgui
-
-local Button = AsuraEngine.Component.Extend("Button")
+--
+local Button = AsuraEngine.Component.Sub("Button")