diff options
-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; +} |