diff options
author | chai <chaifix@163.com> | 2018-12-20 23:53:26 +0800 |
---|---|---|
committer | chai <chaifix@163.com> | 2018-12-20 23:53:26 +0800 |
commit | 1aecfab7ce9a7d25ba0ecf9525bd1058ca2b1ba0 (patch) | |
tree | a7f6b1487ac125e2b92a13ac009e2ca0cd1573d3 /src/libjin-lua/embed/scripts/graphics/graphics.lua | |
parent | 22da8ebd408e5d70c5ac1d2bb35070938a1d2820 (diff) |
*misc
Diffstat (limited to 'src/libjin-lua/embed/scripts/graphics/graphics.lua')
-rw-r--r-- | src/libjin-lua/embed/scripts/graphics/graphics.lua | 27 |
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 |