summaryrefslogtreecommitdiff
path: root/src/texture.c
diff options
context:
space:
mode:
authorsanine-a <sanine.not@pm.me>2020-11-29 16:26:12 -0600
committersanine-a <sanine.not@pm.me>2020-11-29 16:26:12 -0600
commit65f1870eaa68cd18f2136bd112c042728855af03 (patch)
treed76e307f867b8e7a8439ce1bb8f3bb30a63e3526 /src/texture.c
parentf9f3ab244d12e6c7f38bf56dcf22c6a4913dc0f6 (diff)
refactor all files to use new argument parsing and table building functions
Diffstat (limited to 'src/texture.c')
-rw-r--r--src/texture.c19
1 files changed, 8 insertions, 11 deletions
diff --git a/src/texture.c b/src/texture.c
index 37e38e9..7388d50 100644
--- a/src/texture.c
+++ b/src/texture.c
@@ -97,15 +97,14 @@ static int honey_lua_framebuffer_new(lua_State* L)
void honey_setup_texture(lua_State* L)
{
- honey_lua_element texture_elements[] = {
- { "new", HONEY_FUNCTION, { .function = honey_lua_texture_new } },
- { "new_framebuffer", HONEY_FUNCTION, { .function = honey_lua_framebuffer_new } },
- { "create", HONEY_FUNCTION, { .function = honey_lua_texture_create } },
- { "load", HONEY_FUNCTION, { .function = honey_lua_texture_load } },
- { "use", HONEY_FUNCTION, { .function = honey_lua_texture_use } },
- };
-
- honey_lua_create_table(L, texture_elements, 5);
+ honey_lua_create_table
+ (L, 5,
+ HONEY_FUNCTION, "new", honey_lua_texture_new,
+ HONEY_FUNCTION, "new_framebuffer", honey_lua_framebuffer_new,
+ HONEY_FUNCTION, "create", honey_lua_texture_create,
+ HONEY_FUNCTION, "load", honey_lua_texture_load,
+ HONEY_FUNCTION, "use", honey_lua_texture_use);
+ lua_setfield(L, -2, "texture");
}
/* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */
@@ -158,8 +157,6 @@ static void generate_texture(honey_texture* texture,
default:
break;
}
-
- return HONEY_OK;
}
/* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */