New raylib 5.5 rlgl functions.
This commit is contained in:
@@ -18,6 +18,8 @@ DETAILED CHANGES:
|
|||||||
- ADDED: ColorIsEqual and ColorLerp.
|
- ADDED: ColorIsEqual and ColorLerp.
|
||||||
- ADDED: TextToSnake and TextToCamel.
|
- ADDED: TextToSnake and TextToCamel.
|
||||||
- ADDED: DrawModelPoints, DrawModelPointsEx, ExportMeshAsCode and UpdateModelAnimationBones.
|
- ADDED: DrawModelPoints, DrawModelPointsEx, ExportMeshAsCode and UpdateModelAnimationBones.
|
||||||
|
- ADDED: rlSetClipPlanes, rlGetCullDistanceNear, rlGetCullDistanceFar, rlGetActiveFramebuffer,
|
||||||
|
rlBindFramebuffer, rlColorMask and rlSetUniformMatrices.
|
||||||
|
|
||||||
------------------------------------------------------------------------
|
------------------------------------------------------------------------
|
||||||
Release: ReiLua version 0.8.0 Using Raylib 5.0 and Forked Raygui 4.0
|
Release: ReiLua version 0.8.0 Using Raylib 5.0 and Forked Raygui 4.0
|
||||||
|
|||||||
@@ -12,6 +12,9 @@ int lrlglMultMatrixf( lua_State* L );
|
|||||||
int lrlglFrustum( lua_State* L );
|
int lrlglFrustum( lua_State* L );
|
||||||
int lrlglOrtho( lua_State* L );
|
int lrlglOrtho( lua_State* L );
|
||||||
int lrlglViewport( lua_State* L );
|
int lrlglViewport( lua_State* L );
|
||||||
|
int lrlglSetClipPlanes( lua_State* L );
|
||||||
|
int lrlglGetCullDistanceNear( lua_State* L );
|
||||||
|
int lrlglGetCullDistanceFar( lua_State* L );
|
||||||
/* Vertex level operations */
|
/* Vertex level operations */
|
||||||
int lrlglBegin( lua_State* L );
|
int lrlglBegin( lua_State* L );
|
||||||
int lrlglEnd( lua_State* L );
|
int lrlglEnd( lua_State* L );
|
||||||
@@ -49,8 +52,10 @@ int lrlglDisableShader( lua_State* L );
|
|||||||
/* Framebuffer state. */
|
/* Framebuffer state. */
|
||||||
int lrlglEnableFramebuffer( lua_State* L );
|
int lrlglEnableFramebuffer( lua_State* L );
|
||||||
int lrlglDisableFramebuffer( lua_State* L );
|
int lrlglDisableFramebuffer( lua_State* L );
|
||||||
|
int lrlglGetActiveFramebuffer( lua_State* L );
|
||||||
int lrlglActiveDrawBuffers( lua_State* L );
|
int lrlglActiveDrawBuffers( lua_State* L );
|
||||||
int lrlglBlitFramebuffer( lua_State* L );
|
int lrlglBlitFramebuffer( lua_State* L );
|
||||||
|
int lrlglBindFramebuffer( lua_State* L );
|
||||||
/* General render state. */
|
/* General render state. */
|
||||||
int lrlglEnableColorBlend( lua_State* L );
|
int lrlglEnableColorBlend( lua_State* L );
|
||||||
int lrlglDisableColorBlend( lua_State* L );
|
int lrlglDisableColorBlend( lua_State* L );
|
||||||
@@ -60,6 +65,7 @@ int lrlglEnableDepthMask( lua_State* L );
|
|||||||
int lrlglDisableDepthMask( lua_State* L );
|
int lrlglDisableDepthMask( lua_State* L );
|
||||||
int lrlglEnableBackfaceCulling( lua_State* L );
|
int lrlglEnableBackfaceCulling( lua_State* L );
|
||||||
int lrlglDisableBackfaceCulling( lua_State* L );
|
int lrlglDisableBackfaceCulling( lua_State* L );
|
||||||
|
int lrlglColorMask( lua_State* L );
|
||||||
int lrlglSetCullFace( lua_State* L );
|
int lrlglSetCullFace( lua_State* L );
|
||||||
int lrlglEnableScissorTest( lua_State* L );
|
int lrlglEnableScissorTest( lua_State* L );
|
||||||
int lrlglDisableScissorTest( lua_State* L );
|
int lrlglDisableScissorTest( lua_State* L );
|
||||||
@@ -137,6 +143,7 @@ int lrlglGetLocationUniform( lua_State* L );
|
|||||||
int lrlglGetLocationAttrib( lua_State* L );
|
int lrlglGetLocationAttrib( lua_State* L );
|
||||||
int lrlglSetUniform( lua_State* L );
|
int lrlglSetUniform( lua_State* L );
|
||||||
int lrlglSetUniformMatrix( lua_State* L );
|
int lrlglSetUniformMatrix( lua_State* L );
|
||||||
|
int lrlglSetUniformMatrices( lua_State* L );
|
||||||
int lrlglSetUniformSampler( lua_State* L );
|
int lrlglSetUniformSampler( lua_State* L );
|
||||||
int lrlglSetShader( lua_State* L );
|
int lrlglSetShader( lua_State* L );
|
||||||
/* Compute shader management */
|
/* Compute shader management */
|
||||||
|
|||||||
@@ -2195,6 +2195,9 @@ void luaRegister() {
|
|||||||
assingGlobalFunction( "rlFrustum", lrlglFrustum );
|
assingGlobalFunction( "rlFrustum", lrlglFrustum );
|
||||||
assingGlobalFunction( "rlOrtho", lrlglOrtho );
|
assingGlobalFunction( "rlOrtho", lrlglOrtho );
|
||||||
assingGlobalFunction( "rlViewport", lrlglViewport );
|
assingGlobalFunction( "rlViewport", lrlglViewport );
|
||||||
|
assingGlobalFunction( "rlSetClipPlanes", lrlglSetClipPlanes );
|
||||||
|
assingGlobalFunction( "rlGetCullDistanceNear", lrlglGetCullDistanceNear );
|
||||||
|
assingGlobalFunction( "rlGetCullDistanceFar", lrlglGetCullDistanceFar );
|
||||||
/* Vertex level operations. */
|
/* Vertex level operations. */
|
||||||
assingGlobalFunction( "rlBegin", lrlglBegin );
|
assingGlobalFunction( "rlBegin", lrlglBegin );
|
||||||
assingGlobalFunction( "rlEnd", lrlglEnd );
|
assingGlobalFunction( "rlEnd", lrlglEnd );
|
||||||
@@ -2232,8 +2235,10 @@ void luaRegister() {
|
|||||||
/* Framebuffer state. */
|
/* Framebuffer state. */
|
||||||
assingGlobalFunction( "rlEnableFramebuffer", lrlglEnableFramebuffer );
|
assingGlobalFunction( "rlEnableFramebuffer", lrlglEnableFramebuffer );
|
||||||
assingGlobalFunction( "rlDisableFramebuffer", lrlglDisableFramebuffer );
|
assingGlobalFunction( "rlDisableFramebuffer", lrlglDisableFramebuffer );
|
||||||
|
assingGlobalFunction( "rlGetActiveFramebuffer", lrlglGetActiveFramebuffer );
|
||||||
assingGlobalFunction( "rlActiveDrawBuffers", lrlglActiveDrawBuffers );
|
assingGlobalFunction( "rlActiveDrawBuffers", lrlglActiveDrawBuffers );
|
||||||
assingGlobalFunction( "rlBlitFramebuffer", lrlglBlitFramebuffer );
|
assingGlobalFunction( "rlBlitFramebuffer", lrlglBlitFramebuffer );
|
||||||
|
assingGlobalFunction( "rlBindFramebuffer", lrlglBindFramebuffer );
|
||||||
/* General render state. */
|
/* General render state. */
|
||||||
assingGlobalFunction( "rlEnableColorBlend", lrlglEnableColorBlend );
|
assingGlobalFunction( "rlEnableColorBlend", lrlglEnableColorBlend );
|
||||||
assingGlobalFunction( "rlDisableColorBlend", lrlglDisableColorBlend );
|
assingGlobalFunction( "rlDisableColorBlend", lrlglDisableColorBlend );
|
||||||
@@ -2243,6 +2248,7 @@ void luaRegister() {
|
|||||||
assingGlobalFunction( "rlDisableDepthMask", lrlglDisableDepthMask );
|
assingGlobalFunction( "rlDisableDepthMask", lrlglDisableDepthMask );
|
||||||
assingGlobalFunction( "rlEnableBackfaceCulling", lrlglEnableBackfaceCulling );
|
assingGlobalFunction( "rlEnableBackfaceCulling", lrlglEnableBackfaceCulling );
|
||||||
assingGlobalFunction( "rlDisableBackfaceCulling", lrlglDisableBackfaceCulling );
|
assingGlobalFunction( "rlDisableBackfaceCulling", lrlglDisableBackfaceCulling );
|
||||||
|
assingGlobalFunction( "rlColorMask", lrlglColorMask );
|
||||||
assingGlobalFunction( "rlSetCullFace", lrlglSetCullFace );
|
assingGlobalFunction( "rlSetCullFace", lrlglSetCullFace );
|
||||||
assingGlobalFunction( "rlEnableScissorTest", lrlglEnableScissorTest );
|
assingGlobalFunction( "rlEnableScissorTest", lrlglEnableScissorTest );
|
||||||
assingGlobalFunction( "rlDisableScissorTest", lrlglDisableScissorTest );
|
assingGlobalFunction( "rlDisableScissorTest", lrlglDisableScissorTest );
|
||||||
@@ -2320,6 +2326,7 @@ void luaRegister() {
|
|||||||
assingGlobalFunction( "rlGetLocationAttrib", lrlglGetLocationAttrib );
|
assingGlobalFunction( "rlGetLocationAttrib", lrlglGetLocationAttrib );
|
||||||
assingGlobalFunction( "rlSetUniform", lrlglSetUniform );
|
assingGlobalFunction( "rlSetUniform", lrlglSetUniform );
|
||||||
assingGlobalFunction( "rlSetUniformMatrix", lrlglSetUniformMatrix );
|
assingGlobalFunction( "rlSetUniformMatrix", lrlglSetUniformMatrix );
|
||||||
|
assingGlobalFunction( "rlSetUniformMatrices", lrlglSetUniformMatrices );
|
||||||
assingGlobalFunction( "rlSetUniformSampler", lrlglSetUniformSampler );
|
assingGlobalFunction( "rlSetUniformSampler", lrlglSetUniformSampler );
|
||||||
assingGlobalFunction( "rlSetShader", lrlglSetShader );
|
assingGlobalFunction( "rlSetShader", lrlglSetShader );
|
||||||
/* Compute shader management */
|
/* Compute shader management */
|
||||||
|
|||||||
107
src/rlgl.c
107
src/rlgl.c
@@ -160,6 +160,46 @@ int lrlglViewport( lua_State* L ) {
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
> RL.rlSetClipPlanes( float nearPlane, float farPlane )
|
||||||
|
|
||||||
|
Set clip planes distances
|
||||||
|
*/
|
||||||
|
int lrlglSetClipPlanes( lua_State* L ) {
|
||||||
|
float nearPlane = luaL_checknumber( L, 1 );
|
||||||
|
float farPlane = luaL_checknumber( L, 2 );
|
||||||
|
|
||||||
|
rlSetClipPlanes( nearPlane, farPlane );
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
> distance = RL.rlGetCullDistanceNear()
|
||||||
|
|
||||||
|
Get cull plane distance near
|
||||||
|
|
||||||
|
- Success return float
|
||||||
|
*/
|
||||||
|
int lrlglGetCullDistanceNear( lua_State* L ) {
|
||||||
|
lua_pushnumber( L, rlGetCullDistanceNear() );
|
||||||
|
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
> distance = RL.rlGetCullDistanceFar()
|
||||||
|
|
||||||
|
Get cull plane distance far
|
||||||
|
|
||||||
|
- Success return float
|
||||||
|
*/
|
||||||
|
int lrlglGetCullDistanceFar( lua_State* L ) {
|
||||||
|
lua_pushnumber( L, rlGetCullDistanceFar() );
|
||||||
|
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
## RLGL - Vertex level operations
|
## RLGL - Vertex level operations
|
||||||
*/
|
*/
|
||||||
@@ -544,6 +584,19 @@ int lrlglDisableFramebuffer( lua_State* L ) {
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
> framebuffer = RL.rlGetActiveFramebuffer()
|
||||||
|
|
||||||
|
Get the currently active render texture (fbo), 0 for default framebuffer
|
||||||
|
|
||||||
|
- Success return int
|
||||||
|
*/
|
||||||
|
int lrlglGetActiveFramebuffer( lua_State* L ) {
|
||||||
|
lua_pushnumber( L, rlGetActiveFramebuffer() );
|
||||||
|
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
> RL.rlActiveDrawBuffers( int count )
|
> RL.rlActiveDrawBuffers( int count )
|
||||||
|
|
||||||
@@ -570,6 +623,20 @@ int lrlglBlitFramebuffer( lua_State* L ) {
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
> RL.rlBindFramebuffer( int target, int framebuffer )
|
||||||
|
|
||||||
|
Bind framebuffer (FBO)
|
||||||
|
*/
|
||||||
|
int lrlglBindFramebuffer( lua_State* L ) {
|
||||||
|
int target = luaL_checkinteger( L, 1 );
|
||||||
|
int framebuffer = luaL_checkinteger( L, 1 );
|
||||||
|
|
||||||
|
rlBindFramebuffer( target, framebuffer );
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
## RLGL - General render state
|
## RLGL - General render state
|
||||||
*/
|
*/
|
||||||
@@ -662,6 +729,22 @@ int lrlglDisableBackfaceCulling( lua_State* L ) {
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
> RL.rlColorMask( bool r, bool g, bool b, bool a )
|
||||||
|
|
||||||
|
Color mask control
|
||||||
|
*/
|
||||||
|
int lrlglColorMask( lua_State* L ) {
|
||||||
|
bool r = uluaGetBoolean( L, 1 );
|
||||||
|
bool g = uluaGetBoolean( L, 1 );
|
||||||
|
bool b = uluaGetBoolean( L, 1 );
|
||||||
|
bool a = uluaGetBoolean( L, 1 );
|
||||||
|
|
||||||
|
rlColorMask( r, g, b, a );
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
> RL.rlSetCullFace( int mode )
|
> RL.rlSetCullFace( int mode )
|
||||||
|
|
||||||
@@ -1702,6 +1785,30 @@ int lrlglSetUniformMatrix( lua_State* L ) {
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
> RL.rlSetUniformMatrices( int locIndex, Matrix{} mat )
|
||||||
|
|
||||||
|
Set shader value matrices
|
||||||
|
*/
|
||||||
|
int lrlglSetUniformMatrices( lua_State* L ) {
|
||||||
|
int locIndex = luaL_checkinteger( L, 1 );
|
||||||
|
|
||||||
|
int count = uluaGetTableLen( L, 2 );
|
||||||
|
Matrix mat[ count ];
|
||||||
|
|
||||||
|
int t = 2, i = 0;
|
||||||
|
lua_pushnil( L );
|
||||||
|
|
||||||
|
while ( lua_next( L, t ) != 0 ) {
|
||||||
|
mat[i] = uluaGetMatrix( L, lua_gettop( L ) );
|
||||||
|
i++;
|
||||||
|
lua_pop( L, 1 );
|
||||||
|
}
|
||||||
|
rlSetUniformMatrices( locIndex, mat, count );
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
> RL.rlSetUniformSampler( int locIndex, int textureId )
|
> RL.rlSetUniformSampler( int locIndex, int textureId )
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user