diff options
author | sanine <sanine.not@pm.me> | 2023-03-12 00:44:46 -0600 |
---|---|---|
committer | sanine <sanine.not@pm.me> | 2023-03-12 00:44:46 -0600 |
commit | f1444d38ed6c8a350cbeb6edd01306df42ccf2f6 (patch) | |
tree | ea24a0bc1d5bcffa6b9c9ecc937f46d3227ce23b /src/opengl | |
parent | 427a7e24281ca345fa2799da628baa7cf5f81269 (diff) |
add glGetString bind
Diffstat (limited to 'src/opengl')
-rw-r--r-- | src/opengl/gl.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/opengl/gl.c b/src/opengl/gl.c index 532d818..6643f5f 100644 --- a/src/opengl/gl.c +++ b/src/opengl/gl.c @@ -18,6 +18,7 @@ int glad_init(lua_State *L); int gl_get_error(lua_State *L); int gl_enable(lua_State *L); int gl_disable(lua_State *L); +int glGetString_bind(lua_State *L); void setup_gl(lua_State *L, int honey_index) { @@ -27,6 +28,7 @@ void setup_gl(lua_State *L, int honey_index) H_FUNC("GetError", gl_get_error), H_FUNC("Enable", gl_enable), H_FUNC("Disable", gl_disable), + H_FUNC("GetString", glGetString_bind), /******** enums ********/ /* data types */ @@ -47,6 +49,12 @@ void setup_gl(lua_State *L, int honey_index) H_INT("DEPTH_TEST", GL_DEPTH_TEST), H_INT("CULL_FACE", GL_CULL_FACE), + /* strings */ + H_INT("VENDOR", GL_VENDOR), + H_INT("RENDERER", GL_RENDERER), + H_INT("VERSION", GL_VERSION), + H_INT("SHADING_LANGUAGE_VERSION", GL_SHADING_LANGUAGE_VERSION), + H_END }; create_table(L, tbl); @@ -90,3 +98,12 @@ int gl_disable(lua_State *L) glDisable(cap); return 0; } + + +int glGetString_bind(lua_State *L) +{ + int name = luaL_checkinteger(L, 1); + const char *str = glGetString(name); + lua_pushstring(L, str); + return 1; +} |