summaryrefslogtreecommitdiff
path: root/src/gl/shader.c
diff options
context:
space:
mode:
authorsanine <sanine.not@pm.me>2022-08-22 15:55:44 -0500
committersanine <sanine.not@pm.me>2022-08-22 15:55:44 -0500
commit1f47b685f35455afcc7441389cdc60018f66d159 (patch)
tree640f1ae52966ad0b6621a0cd4b4f810f9186e803 /src/gl/shader.c
parentd69f711275675d4b5da88117b14c1d15be232cf5 (diff)
add textures
Diffstat (limited to 'src/gl/shader.c')
-rw-r--r--src/gl/shader.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/gl/shader.c b/src/gl/shader.c
index fb64bc0..c3b409c 100644
--- a/src/gl/shader.c
+++ b/src/gl/shader.c
@@ -14,6 +14,7 @@ int gl_program_link(lua_State *L);
int gl_program_use(lua_State *L);
int gl_uniform_get_location(lua_State *L);
+int gl_uniform_1i(lua_State *L);
int gl_uniform_4f(lua_State *L);
@@ -36,6 +37,7 @@ void setup_shader(lua_State *L, int gl_index)
hs_str_cfunc("use", gl_program_use),
hs_str_cfunc("getUniformLocation", gl_uniform_get_location),
+ hs_str_cfunc("uniform1i", gl_uniform_1i),
hs_str_cfunc("uniform4f", gl_uniform_4f),
hs_str_tbl("type", shader_types),
@@ -141,6 +143,15 @@ int gl_uniform_get_location(lua_State *L)
}
+int gl_uniform_1i(lua_State *L)
+{
+ lua_Integer location, v0;
+ hs_parse_args(L, hs_int(location), hs_int(v0));
+ glUniform1i(location, v0);
+ return 0;
+}
+
+
int gl_uniform_4f(lua_State *L)
{
lua_Integer location;