diff options
author | sanine <sanine.not@pm.me> | 2023-05-16 18:53:16 -0500 |
---|---|---|
committer | sanine <sanine.not@pm.me> | 2023-05-16 18:53:16 -0500 |
commit | bc37d6024572b844e1c55afecb683fcce31491d1 (patch) | |
tree | 3c19d92dfc4e335ee1b81720bfa104f359e406f0 /src | |
parent | b2df3ae7c1bd33a92fc38c2f425a7242bfa93dd2 (diff) |
add gl.PolygonMode bind
Diffstat (limited to 'src')
-rw-r--r-- | src/opengl/drawing.c | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/src/opengl/drawing.c b/src/opengl/drawing.c index cdab5ae..e3a2d87 100644 --- a/src/opengl/drawing.c +++ b/src/opengl/drawing.c @@ -15,6 +15,7 @@ X("FramebufferTexture2D", glFramebufferTexture2D_bind) \ X("CullFace", glCullFace_bind) \ X("BlendFunc", glBlendFunc_bind) \ + X("PolygonMode", glPolygonMode_bind) \ #define X(name, func) int func(lua_State *L); @@ -60,6 +61,12 @@ void setup_drawing(lua_State *L, int gl_index) H_INT("CONSTANT_ALPHA", GL_CONSTANT_ALPHA), H_INT("ONE_MINUS_CONSTANT_ALPHA", GL_ONE_MINUS_CONSTANT_ALPHA), + /* PolygonMode faces & modes */ + H_INT("FRONT_AND_BACK", GL_FRONT_AND_BACK), + H_INT("POINT", GL_POINT), + H_INT("LINE", GL_LINE), + H_INT("FILL", GL_FILL), + H_INT("FRAMEBUFFER", GL_FRAMEBUFFER), H_END @@ -166,7 +173,16 @@ int glCullFace_bind(lua_State *L) int glBlendFunc_bind(lua_State *L) { int sfactor = luaL_checkinteger(L, 1); - int dfactor = luaL_checkinteger(L, 1); + int dfactor = luaL_checkinteger(L, 2); glBlendFunc(sfactor, dfactor); return 0; } + + +int glPolygonMode_bind(lua_State *L) +{ + int face = luaL_checkinteger(L, 1); + int mode = luaL_checkinteger(L, 2); + glPolygonMode(face, mode); + return 0; +} |