summaryrefslogtreecommitdiff
path: root/src/gl.c
diff options
context:
space:
mode:
authorjussi2024-10-25 21:19:42 +0300
committerjussi2024-10-25 21:19:42 +0300
commitcddfc09ccc286726736fa436a10919021a177b69 (patch)
treeac99e0a221807ee4d1906124f6b1218022d6011f /src/gl.c
parentab995f345387b306735ecfbda84dbc019f1053bb (diff)
downloadreilua-enhanced-cddfc09ccc286726736fa436a10919021a177b69.tar.gz
reilua-enhanced-cddfc09ccc286726736fa436a10919021a177b69.tar.bz2
reilua-enhanced-cddfc09ccc286726736fa436a10919021a177b69.zip
glDepthRange and glPolygonOffset.
Diffstat (limited to 'src/gl.c')
-rw-r--r--src/gl.c28
1 files changed, 28 insertions, 0 deletions
diff --git a/src/gl.c b/src/gl.c
index ec27d3b..4082e27 100644
--- a/src/gl.c
+++ b/src/gl.c
@@ -78,6 +78,20 @@ int lglBlitFramebuffer( lua_State* L ) {
*/
/*
+> 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 )
Enable server-side GL capabilities
@@ -104,6 +118,20 @@ int lglDisable( lua_State* L ) {
}
/*
+> 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 )
Set front and back function and reference value for stencil testing