summaryrefslogtreecommitdiff
path: root/src/shader.c
diff options
context:
space:
mode:
authorsanine-a <sanine.not@pm.me>2020-12-03 02:10:32 -0600
committersanine-a <sanine.not@pm.me>2020-12-03 02:10:32 -0600
commite767e1ff9d81f8a76196caab91d9b6b4bbe0b30e (patch)
tree25a058779bcd4de00ce04ccf6cb0157cfba32611 /src/shader.c
parentf417d2b047369cac234c471ef37ab8281181d69f (diff)
rewrite demo
Diffstat (limited to 'src/shader.c')
-rw-r--r--src/shader.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/src/shader.c b/src/shader.c
index a05bd0c..048cf87 100644
--- a/src/shader.c
+++ b/src/shader.c
@@ -10,17 +10,20 @@ void honey_setup_shader(lua_State* L)
/* honey.shader.prototype */
HONEY_FUNCTION, "use", honey_shader_use,
- HONEY_FUNCTION, "set_int", honey_shader_set_int,
- HONEY_FUNCTION, "set_float", honey_shader_set_float,
- HONEY_FUNCTION, "set_vec3", honey_shader_set_vec3,
- HONEY_FUNCTION, "set_vec4", honey_shader_set_vec4,
- HONEY_FUNCTION, "set_mat3", honey_shader_set_mat3,
- HONEY_FUNCTION, "set_mat4", honey_shader_set_mat4,
+ HONEY_FUNCTION, "setInteger", honey_shader_set_int,
+ HONEY_FUNCTION, "setFloat", honey_shader_set_float,
+ HONEY_FUNCTION, "setVec3", honey_shader_set_vec3,
+ HONEY_FUNCTION, "setVec4", honey_shader_set_vec4,
+ HONEY_FUNCTION, "setMat3", honey_shader_set_mat3,
+ HONEY_FUNCTION, "setMat4", honey_shader_set_mat4,
HONEY_FUNCTION, "__gc", honey_shader_delete);
honey_shader_mt_ref = luaL_ref(L, LUA_REGISTRYINDEX);
+ lua_rawgeti(L, LUA_REGISTRYINDEX, honey_shader_mt_ref);
+ lua_setfield(L, -2, "shaderMetatable");
+
lua_pushcfunction(L, honey_shader_new);
lua_setfield(L, -2, "shader");
}