From cddfc09ccc286726736fa436a10919021a177b69 Mon Sep 17 00:00:00 2001 From: jussi Date: Fri, 25 Oct 2024 21:19:42 +0300 Subject: glDepthRange and glPolygonOffset. --- src/gl.c | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) (limited to 'src/gl.c') diff --git a/src/gl.c b/src/gl.c index ec27d3b..4082e27 100644 --- a/src/gl.c +++ b/src/gl.c @@ -77,6 +77,20 @@ int lglBlitFramebuffer( lua_State* L ) { ## OpenGL - State Management */ +/* +> RL.glDepthRange( float nearVal, float farVal ) + +Specify mapping of depth values from normalized device coordinates to window coordinates +*/ +int lglDepthRange( lua_State* L ) { + float nearVal = luaL_checknumber( L, 1 ); + float farVal = luaL_checknumber( L, 2 ); + + glDepthRange( nearVal, farVal ); + + return 0; +} + /* > RL.glEnable( int cap ) @@ -103,6 +117,20 @@ int lglDisable( lua_State* L ) { return 0; } +/* +> RL.glPolygonOffset( float factor, float units ) + +Set the scale and units used to calculate depth values +*/ +int lglPolygonOffset( lua_State* L ) { + float factor = luaL_checknumber( L, 1 ); + float units = luaL_checknumber( L, 2 ); + + glPolygonOffset( factor, units ); + + return 0; +} + /* > RL.glStencilFunc( int func, int ref, int mask ) -- cgit v1.2.3