summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjussi2024-02-24 18:09:53 +0200
committerjussi2024-02-24 18:09:53 +0200
commit631cea6aa7510ba53d4f14b5537e1719a72976b9 (patch)
tree936134d4cfa228a4a1d9964823a3a9889df230ef
parent9f1bec39f9d3d67c5d194fa4553c2ace09656a1c (diff)
downloadreilua-enhanced-631cea6aa7510ba53d4f14b5537e1719a72976b9.tar.gz
reilua-enhanced-631cea6aa7510ba53d4f14b5537e1719a72976b9.tar.bz2
reilua-enhanced-631cea6aa7510ba53d4f14b5537e1719a72976b9.zip
Rest of rlgl and raymath functions.
-rw-r--r--API.md40
-rw-r--r--ReiLua_API.lua36
-rw-r--r--apiScanner.lua14
-rw-r--r--changelog3
-rw-r--r--include/lrlgl.h6
-rw-r--r--include/rmath.h2
-rw-r--r--src/lua_core.c8
-rw-r--r--src/rlgl.c55
-rw-r--r--src/rmath.c32
9 files changed, 188 insertions, 8 deletions
diff --git a/API.md b/API.md
index d2b4dff..28e318c 100644
--- a/API.md
+++ b/API.md
@@ -8261,6 +8261,22 @@ Normalize provided vector
---
+> result = RL.Vector3Project( Vector3 v1, Vector3 v2 )
+
+Calculate the projection of the vector v1 on to v2
+
+- Success return Vector3
+
+---
+
+> result = RL.Vector3Reject( Vector3 v1, Vector3 v2 )
+
+Calculate the rejection of the vector v1 on to v2
+
+- Success return Vector3
+
+---
+
> v1, v2 = RL.Vector3OrthoNormalize( Vector3 v1, Vector3 v2 )
Orthonormalize provided vectors. Makes vectors normalized and orthogonal to each other.
@@ -9485,6 +9501,18 @@ Disable vertex attribute index
---
+> RL.rlEnableStatePointer( int vertexAttribType, Buffer buffer )
+
+Enable attribute state pointer
+
+---
+
+> RL.rlDisableStatePointer( int vertexAttribType )
+
+Disable attribute state pointer
+
+---
+
## RLGL - Textures state
---
@@ -9569,6 +9597,12 @@ Activate multiple draw color buffers
---
+> RL.rlBlitFramebuffer( Rectangle srcRect, Rectangle dstRect, int bufferMask )
+
+Blit active framebuffer to main framebuffer
+
+---
+
## RLGL - General render state
---
@@ -9651,6 +9685,12 @@ Enable wire mode
---
+> RL.rlEnablePointMode()
+
+Enable point mode
+
+---
+
> RL.rlDisableWireMode()
Disable wire mode
diff --git a/ReiLua_API.lua b/ReiLua_API.lua
index 12d7b72..5236275 100644
--- a/ReiLua_API.lua
+++ b/ReiLua_API.lua
@@ -5462,6 +5462,20 @@ function RL.Vector3Divide( v1, v2 ) end
---@return any result
function RL.Vector3Normalize( v ) end
+---Calculate the projection of the vector v1 on to v2
+---- Success return Vector3
+---@param v1 table
+---@param v2 table
+---@return any result
+function RL.Vector3Project( v1, v2 ) end
+
+---Calculate the rejection of the vector v1 on to v2
+---- Success return Vector3
+---@param v1 table
+---@param v2 table
+---@return any result
+function RL.Vector3Reject( v1, v2 ) end
+
---Orthonormalize provided vectors. Makes vectors normalized and orthogonal to each other.
---Gram-Schmidt function implementation
---- Success return Vector3, Vector3
@@ -6592,6 +6606,17 @@ function RL.rlEnableVertexAttribute( index ) end
---@return any RL.rlDisableVertexAttribute
function RL.rlDisableVertexAttribute( index ) end
+---Enable attribute state pointer
+---@param vertexAttribType integer
+---@param buffer any
+---@return any RL.rlEnableStatePointer
+function RL.rlEnableStatePointer( vertexAttribType, buffer ) end
+
+---Disable attribute state pointer
+---@param vertexAttribType integer
+---@return any RL.rlDisableStatePointer
+function RL.rlDisableStatePointer( vertexAttribType ) end
+
-- RLGL - Textures state
---Select and active a texture slot
@@ -6658,6 +6683,13 @@ function RL.rlDisableFramebuffer() end
---@return any RL.rlActiveDrawBuffers
function RL.rlActiveDrawBuffers( count ) end
+---Blit active framebuffer to main framebuffer
+---@param srcRect table
+---@param dstRect table
+---@param bufferMask integer
+---@return any RL.rlBlitFramebuffer
+function RL.rlBlitFramebuffer( srcRect, dstRect, bufferMask ) end
+
-- RLGL - General render state
---Enable color blending
@@ -6714,6 +6746,10 @@ function RL.rlScissor( area ) end
---@return any RL.rlEnableWireMode
function RL.rlEnableWireMode() end
+---Enable point mode
+---@return any RL.rlEnablePointMode
+function RL.rlEnablePointMode() end
+
---Disable wire mode
---@return any RL.rlDisableWireMode
function RL.rlDisableWireMode() end
diff --git a/apiScanner.lua b/apiScanner.lua
index 709e766..6a23268 100644
--- a/apiScanner.lua
+++ b/apiScanner.lua
@@ -93,10 +93,8 @@ local rlgl = {
rlLoadDrawQuad = true, -- Most likely not needed.
},
info = {
- rlBlitFramebuffer = "Will be added",
- rlEnablePointMode = "Will be added",
- rlEnableStatePointer = "Should probably be added for GRAPHICS_API_OPENGL_11",
- rlDisableStatePointer = "Should probably be added for GRAPHICS_API_OPENGL_11",
+ rlEnableStatePointer = "Available for GRAPHICS_API_OPENGL_11",
+ rlDisableStatePointer = "Available for GRAPHICS_API_OPENGL_11",
},
}
local raygui = {
@@ -123,12 +121,12 @@ local easings = {
prefix = "EASEDEF",
file = "easings.h",
blacklist = {
+ EaseLinearNone = true, -- "Replaced by EaseLinear"
+ EaseLinearIn = true, -- "Replaced by EaseLinear"
+ EaseLinearOut = true, -- "Replaced by EaseLinear"
+ EaseLinearInOut = true, -- "Replaced by EaseLinear"
},
info = {
- EaseLinearNone = "Will be added",
- EaseLinearIn = "Will be added",
- EaseLinearOut = "Will be added",
- EaseLinearInOut = "Will be added",
},
}
diff --git a/changelog b/changelog
index 6e59f3e..ab88cba 100644
--- a/changelog
+++ b/changelog
@@ -15,6 +15,9 @@ DETAILED CHANGES:
- FIXED: GuiSetStyle, GuiLoadStyle and GuiLoadStyleDefault sets state->guiDefaultFont to GuiGetFont.
- ADDED: TextFindIndex.
- FIXED: SeekMusicStream was not assigned.
+ - ADDED: rlEnableStatePointer and rlDisableStatePointer for GRAPHICS_API_OPENGL_11.
+ - ADDED: rlBlitFramebuffer and rlEnablePointMode.
+ - ADDED: Vector3Project and Vector3Reject.
------------------------------------------------------------------------
Release: ReiLua version 0.7.0 Using Raylib 5.0 and Forked Raygui 4.0
diff --git a/include/lrlgl.h b/include/lrlgl.h
index b9c45b1..ba07936 100644
--- a/include/lrlgl.h
+++ b/include/lrlgl.h
@@ -31,6 +31,10 @@ int lrlglEnableVertexBufferElement( lua_State* L );
int lrlglDisableVertexBufferElement( lua_State* L );
int lrlglEnableVertexAttribute( lua_State* L );
int lrlglDisableVertexAttribute( lua_State* L );
+#if defined( GRAPHICS_API_OPENGL_11 )
+int lrlglEnableStatePointer( lua_State* L );
+int lrlglDisableStatePointer( lua_State* L );
+#endif
/* Textures state */
int lrlglActiveTextureSlot( lua_State* L );
int lrlglEnableTexture( lua_State* L );
@@ -46,6 +50,7 @@ int lrlglDisableShader( lua_State* L );
int lrlglEnableFramebuffer( lua_State* L );
int lrlglDisableFramebuffer( lua_State* L );
int lrlglActiveDrawBuffers( lua_State* L );
+int lrlglBlitFramebuffer( lua_State* L );
/* General render state. */
int lrlglEnableColorBlend( lua_State* L );
int lrlglDisableColorBlend( lua_State* L );
@@ -60,6 +65,7 @@ int lrlglEnableScissorTest( lua_State* L );
int lrlglDisableScissorTest( lua_State* L );
int lrlglScissor( lua_State* L );
int lrlglEnableWireMode( lua_State* L );
+int lrlglEnablePointMode( lua_State* L );
int lrlglDisableWireMode( lua_State* L );
int lrlglSetLineWidth( lua_State* L );
int lrlglGetLineWidth( lua_State* L );
diff --git a/include/rmath.h b/include/rmath.h
index 26642d9..9dd8482 100644
--- a/include/rmath.h
+++ b/include/rmath.h
@@ -58,6 +58,8 @@ int lmathVector3Angle( lua_State* L );
int lmathVector3Negate( lua_State* L );
int lmathVector3Divide( lua_State* L );
int lmathVector3Normalize( lua_State* L );
+int lmathVector3Project( lua_State* L );
+int lmathVector3Reject( lua_State* L );
int lmathVector3OrthoNormalize( lua_State* L );
int lmathVector3Transform( lua_State* L );
int lmathVector3RotateByQuaternion( lua_State* L );
diff --git a/src/lua_core.c b/src/lua_core.c
index fffce5a..3747791 100644
--- a/src/lua_core.c
+++ b/src/lua_core.c
@@ -1881,6 +1881,8 @@ void luaRegister() {
assingGlobalFunction( "Vector3Negate", lmathVector3Negate );
assingGlobalFunction( "Vector3Divide", lmathVector3Divide );
assingGlobalFunction( "Vector3Normalize", lmathVector3Normalize );
+ assingGlobalFunction( "Vector3Project", lmathVector3Project );
+ assingGlobalFunction( "Vector3Reject", lmathVector3Reject );
assingGlobalFunction( "Vector3OrthoNormalize", lmathVector3OrthoNormalize );
assingGlobalFunction( "Vector3Transform", lmathVector3Transform );
assingGlobalFunction( "Vector3RotateByQuaternion", lmathVector3RotateByQuaternion );
@@ -2057,6 +2059,10 @@ void luaRegister() {
assingGlobalFunction( "rlDisableVertexBufferElement", lrlglDisableVertexBufferElement );
assingGlobalFunction( "rlEnableVertexAttribute", lrlglEnableVertexAttribute );
assingGlobalFunction( "rlDisableVertexAttribute", lrlglDisableVertexAttribute );
+#if defined( GRAPHICS_API_OPENGL_11 )
+ assingGlobalFunction( "rlEnableStatePointer", lrlglEnableStatePointer );
+ assingGlobalFunction( "rlDisableStatePointer", lrlglDisableStatePointer );
+#endif
/* Textures state. */
assingGlobalFunction( "rlActiveTextureSlot", lrlglActiveTextureSlot );
assingGlobalFunction( "rlEnableTexture", lrlglEnableTexture );
@@ -2072,6 +2078,7 @@ void luaRegister() {
assingGlobalFunction( "rlEnableFramebuffer", lrlglEnableFramebuffer );
assingGlobalFunction( "rlDisableFramebuffer", lrlglDisableFramebuffer );
assingGlobalFunction( "rlActiveDrawBuffers", lrlglActiveDrawBuffers );
+ assingGlobalFunction( "rlBlitFramebuffer", lrlglBlitFramebuffer );
/* General render state. */
assingGlobalFunction( "rlEnableColorBlend", lrlglEnableColorBlend );
assingGlobalFunction( "rlDisableColorBlend", lrlglDisableColorBlend );
@@ -2086,6 +2093,7 @@ void luaRegister() {
assingGlobalFunction( "rlDisableScissorTest", lrlglDisableScissorTest );
assingGlobalFunction( "rlScissor", lrlglScissor );
assingGlobalFunction( "rlEnableWireMode", lrlglEnableWireMode );
+ assingGlobalFunction( "rlEnablePointMode", lrlglEnablePointMode );
assingGlobalFunction( "rlDisableWireMode", lrlglDisableWireMode );
assingGlobalFunction( "rlSetLineWidth", lrlglSetLineWidth );
assingGlobalFunction( "rlGetLineWidth", lrlglGetLineWidth );
diff --git a/src/rlgl.c b/src/rlgl.c
index b0bd067..71f91c7 100644
--- a/src/rlgl.c
+++ b/src/rlgl.c
@@ -374,6 +374,35 @@ int lrlglDisableVertexAttribute( lua_State* L ) {
return 0;
}
+#if defined( GRAPHICS_API_OPENGL_11 )
+/*
+> RL.rlEnableStatePointer( int vertexAttribType, Buffer buffer )
+
+Enable attribute state pointer
+*/
+int lrlglEnableStatePointer( lua_State* L ) {
+ int vertexAttribType = luaL_checkinteger( L, 1 );
+ Buffer* buffer = uluaGetBuffer( L, 2 );
+
+ rlEnableStatePointer( vertexAttribType, buffer->data );
+
+ return 0;
+}
+
+/*
+> RL.rlDisableStatePointer( int vertexAttribType )
+
+Disable attribute state pointer
+*/
+int lrlglDisableStatePointer( lua_State* L ) {
+ int vertexAttribType = luaL_checkinteger( L, 1 );
+
+ rlDisableStatePointer( vertexAttribType );
+
+ return 0;
+}
+#endif
+
/*
## RLGL - Textures state
*/
@@ -527,6 +556,21 @@ int lrlglActiveDrawBuffers( lua_State* L ) {
}
/*
+> RL.rlBlitFramebuffer( Rectangle srcRect, Rectangle dstRect, int bufferMask )
+
+Blit active framebuffer to main framebuffer
+*/
+int lrlglBlitFramebuffer( lua_State* L ) {
+ Rectangle src = uluaGetRectangle( L, 1 );
+ Rectangle dst = uluaGetRectangle( L, 2 );
+ int bufferMask = luaL_checkinteger( L, 3 );
+
+ rlBlitFramebuffer( (int)src.x, (int)src.y, (int)src.width, (int)src.height, (int)dst.x, (int)dst.y, (int)dst.width, (int)dst.height, bufferMask );
+
+ return 0;
+}
+
+/*
## RLGL - General render state
*/
@@ -676,6 +720,17 @@ int lrlglEnableWireMode( lua_State* L ) {
}
/*
+> RL.rlEnablePointMode()
+
+Enable point mode
+*/
+int lrlglEnablePointMode( lua_State* L ) {
+ rlEnablePointMode();
+
+ return 0;
+}
+
+/*
> RL.rlDisableWireMode()
Disable wire mode
diff --git a/src/rmath.c b/src/rmath.c
index d8f85b6..2b05c7e 100644
--- a/src/rmath.c
+++ b/src/rmath.c
@@ -849,6 +849,38 @@ int lmathVector3Normalize( lua_State* L ) {
}
/*
+> result = RL.Vector3Project( Vector3 v1, Vector3 v2 )
+
+Calculate the projection of the vector v1 on to v2
+
+- Success return Vector3
+*/
+int lmathVector3Project( lua_State* L ) {
+ Vector3 v1 = uluaGetVector3( L, 1 );
+ Vector3 v2 = uluaGetVector3( L, 2 );
+
+ uluaPushVector3( L, Vector3Project( v1, v2 ) );
+
+ return 1;
+}
+
+/*
+> result = RL.Vector3Reject( Vector3 v1, Vector3 v2 )
+
+Calculate the rejection of the vector v1 on to v2
+
+- Success return Vector3
+*/
+int lmathVector3Reject( lua_State* L ) {
+ Vector3 v1 = uluaGetVector3( L, 1 );
+ Vector3 v2 = uluaGetVector3( L, 2 );
+
+ uluaPushVector3( L, Vector3Reject( v1, v2 ) );
+
+ return 1;
+}
+
+/*
> v1, v2 = RL.Vector3OrthoNormalize( Vector3 v1, Vector3 v2 )
Orthonormalize provided vectors. Makes vectors normalized and orthogonal to each other.