aboutsummaryrefslogtreecommitdiff
path: root/src/libjin-lua/embed/scripts/graphics/graphics.lua
diff options
context:
space:
mode:
authorchai <chaifix@163.com>2018-12-20 23:53:26 +0800
committerchai <chaifix@163.com>2018-12-20 23:53:26 +0800
commit1aecfab7ce9a7d25ba0ecf9525bd1058ca2b1ba0 (patch)
treea7f6b1487ac125e2b92a13ac009e2ca0cd1573d3 /src/libjin-lua/embed/scripts/graphics/graphics.lua
parent22da8ebd408e5d70c5ac1d2bb35070938a1d2820 (diff)
*misc
Diffstat (limited to 'src/libjin-lua/embed/scripts/graphics/graphics.lua')
-rw-r--r--src/libjin-lua/embed/scripts/graphics/graphics.lua27
1 files changed, 19 insertions, 8 deletions
diff --git a/src/libjin-lua/embed/scripts/graphics/graphics.lua b/src/libjin-lua/embed/scripts/graphics/graphics.lua
index ffa84db..d625249 100644
--- a/src/libjin-lua/embed/scripts/graphics/graphics.lua
+++ b/src/libjin-lua/embed/scripts/graphics/graphics.lua
@@ -27,15 +27,12 @@ jg.SpriteMode = {
}
-- Built in shaders
-jg.Shaders = {
- Font = nil,
- Texture = nil,
- Sprite = nil,
- SpriteSheet = nil,
- Default = nil
-}
-
+jg.Shaders = nil
local function compileBuiltInShaders()
+ if jg.Shaders ~= nil then
+ return
+ end
+ jg.Shaders = {}
jg.Shaders.Font = jg.newShader[[
#VERTEX_SHADER
Vertex vert(Vertex v)
@@ -106,6 +103,20 @@ local function compileBuiltInShaders()
}
#END_FRAGMENT_SHADER
]]
+ jg.Shaders.Shape = jg.newShader[[
+ #VERTEX_SHADER
+ Vertex vert(Vertex v)
+ {
+ return v;
+ }
+ #END_VERTEX_SHADER
+ #FRAGMENT_SHADER
+ Color frag(Color col, Texture tex, Vertex v)
+ {
+ return col;
+ }
+ #END_FRAGMENT_SHADER
+ ]]
end
local _init = jg.init