Rest of rlgl and raymath functions.
This commit is contained in:
@@ -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 );
|
||||
|
||||
55
src/rlgl.c
55
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
|
||||
*/
|
||||
@@ -526,6 +555,21 @@ int lrlglActiveDrawBuffers( lua_State* L ) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
> 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
|
||||
*/
|
||||
@@ -675,6 +719,17 @@ int lrlglEnableWireMode( lua_State* L ) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
> RL.rlEnablePointMode()
|
||||
|
||||
Enable point mode
|
||||
*/
|
||||
int lrlglEnablePointMode( lua_State* L ) {
|
||||
rlEnablePointMode();
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
> RL.rlDisableWireMode()
|
||||
|
||||
|
||||
32
src/rmath.c
32
src/rmath.c
@@ -848,6 +848,38 @@ int lmathVector3Normalize( lua_State* L ) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
/*
|
||||
> 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 )
|
||||
|
||||
|
||||
Reference in New Issue
Block a user