Pointer variable declaration style change.

This commit is contained in:
jussi
2024-02-18 19:46:50 +02:00
parent 9b27daefc2
commit 836c9d1d00
33 changed files with 2476 additions and 2476 deletions

View File

@@ -1,52 +1,52 @@
#pragma once #pragma once
/* Audio device management functions. */ /* Audio device management functions. */
int laudioInitAudioDevice( lua_State *L ); int laudioInitAudioDevice( lua_State* L );
int laudioCloseAudioDevice( lua_State *L ); int laudioCloseAudioDevice( lua_State* L );
int laudioIsAudioDeviceReady( lua_State *L ); int laudioIsAudioDeviceReady( lua_State* L );
int laudioSetMasterVolume( lua_State *L ); int laudioSetMasterVolume( lua_State* L );
int laudioGetMasterVolume( lua_State *L ); int laudioGetMasterVolume( lua_State* L );
/* Wave/Sound loading/unloading functions. */ /* Wave/Sound loading/unloading functions. */
int laudioLoadSound( lua_State *L ); int laudioLoadSound( lua_State* L );
int laudioLoadWave( lua_State *L ); int laudioLoadWave( lua_State* L );
int laudioLoadWaveFromMemory( lua_State *L ); int laudioLoadWaveFromMemory( lua_State* L );
int laudioIsWaveReady( lua_State *L ); int laudioIsWaveReady( lua_State* L );
int laudioLoadSoundFromWave( lua_State *L ); int laudioLoadSoundFromWave( lua_State* L );
int laudioLoadSoundAlias( lua_State *L ); int laudioLoadSoundAlias( lua_State* L );
int laudioIsSoundReady( lua_State *L ); int laudioIsSoundReady( lua_State* L );
int laudioUnloadWave( lua_State *L ); int laudioUnloadWave( lua_State* L );
int laudioUnloadSound( lua_State *L ); int laudioUnloadSound( lua_State* L );
int laudioUnloadSoundAlias( lua_State *L ); int laudioUnloadSoundAlias( lua_State* L );
int laudioExportWave( lua_State *L ); int laudioExportWave( lua_State* L );
int laudioExportWaveAsCode( lua_State *L ); int laudioExportWaveAsCode( lua_State* L );
/* Wave/Sound management functions. */ /* Wave/Sound management functions. */
int laudioPlaySound( lua_State *L ); int laudioPlaySound( lua_State* L );
int laudioStopSound( lua_State *L ); int laudioStopSound( lua_State* L );
int laudioPauseSound( lua_State *L ); int laudioPauseSound( lua_State* L );
int laudioResumeSound( lua_State *L ); int laudioResumeSound( lua_State* L );
int laudioIsSoundPlaying( lua_State *L ); int laudioIsSoundPlaying( lua_State* L );
int laudioSetSoundVolume( lua_State *L ); int laudioSetSoundVolume( lua_State* L );
int laudioSetSoundPitch( lua_State *L ); int laudioSetSoundPitch( lua_State* L );
int laudioSetSoundPan( lua_State *L ); int laudioSetSoundPan( lua_State* L );
int laudioWaveFormat( lua_State *L ); int laudioWaveFormat( lua_State* L );
int laudioWaveCopy( lua_State *L ); int laudioWaveCopy( lua_State* L );
int laudioWaveCrop( lua_State *L ); int laudioWaveCrop( lua_State* L );
/* Music management functions. */ /* Music management functions. */
int laudioLoadMusicStream( lua_State *L ); int laudioLoadMusicStream( lua_State* L );
int laudioLoadMusicStreamFromMemory( lua_State *L ); int laudioLoadMusicStreamFromMemory( lua_State* L );
int laudioIsMusicReady( lua_State *L ); int laudioIsMusicReady( lua_State* L );
int laudioUnloadMusicStream( lua_State *L ); int laudioUnloadMusicStream( lua_State* L );
int laudioPlayMusicStream( lua_State *L ); int laudioPlayMusicStream( lua_State* L );
int laudioIsMusicStreamPlaying( lua_State *L ); int laudioIsMusicStreamPlaying( lua_State* L );
int laudioUpdateMusicStream( lua_State *L ); int laudioUpdateMusicStream( lua_State* L );
int laudioStopMusicStream( lua_State *L ); int laudioStopMusicStream( lua_State* L );
int laudioPauseMusicStream( lua_State *L ); int laudioPauseMusicStream( lua_State* L );
int laudioResumeMusicStream( lua_State *L ); int laudioResumeMusicStream( lua_State* L );
int laudioSeekMusicStream( lua_State *L ); int laudioSeekMusicStream( lua_State* L );
int laudioSetMusicVolume( lua_State *L ); int laudioSetMusicVolume( lua_State* L );
int laudioSetMusicPitch( lua_State *L ); int laudioSetMusicPitch( lua_State* L );
int laudioSetMusicPan( lua_State *L ); int laudioSetMusicPan( lua_State* L );
int laudioSetMusicLooping( lua_State *L ); int laudioSetMusicLooping( lua_State* L );
int laudioGetMusicLooping( lua_State *L ); int laudioGetMusicLooping( lua_State* L );
int laudioGetMusicTimeLength( lua_State *L ); int laudioGetMusicTimeLength( lua_State* L );
int laudioGetMusicTimePlayed( lua_State *L ); int laudioGetMusicTimePlayed( lua_State* L );

View File

@@ -4,229 +4,229 @@
void unloadBuffer( Buffer *buffer ); void unloadBuffer( Buffer *buffer );
/* Window-related functions. */ /* Window-related functions. */
int lcoreCloseWindow( lua_State *L ); int lcoreCloseWindow( lua_State* L );
int lcoreIsWindowReady( lua_State *L ); int lcoreIsWindowReady( lua_State* L );
int lcoreIsWindowFullscreen( lua_State *L ); int lcoreIsWindowFullscreen( lua_State* L );
int lcoreIsWindowHidden( lua_State *L ); int lcoreIsWindowHidden( lua_State* L );
int lcoreIsWindowMinimized( lua_State *L ); int lcoreIsWindowMinimized( lua_State* L );
int lcoreIsWindowMaximized( lua_State *L ); int lcoreIsWindowMaximized( lua_State* L );
int lcoreIsWindowFocused( lua_State *L ); int lcoreIsWindowFocused( lua_State* L );
int lcoreIsWindowResized( lua_State *L ); int lcoreIsWindowResized( lua_State* L );
int lcoreIsWindowState( lua_State *L ); int lcoreIsWindowState( lua_State* L );
int lcoreSetWindowState( lua_State *L ); int lcoreSetWindowState( lua_State* L );
int lcoreClearWindowState( lua_State *L ); int lcoreClearWindowState( lua_State* L );
int lcoreToggleFullscreen( lua_State *L ); int lcoreToggleFullscreen( lua_State* L );
int lcoreToggleBorderlessWindowed( lua_State *L ); int lcoreToggleBorderlessWindowed( lua_State* L );
int lcoreMaximizeWindow( lua_State *L ); int lcoreMaximizeWindow( lua_State* L );
int lcoreMinimizeWindow( lua_State *L ); int lcoreMinimizeWindow( lua_State* L );
int lcoreRestoreWindow( lua_State *L ); int lcoreRestoreWindow( lua_State* L );
int lcoreSetWindowIcon( lua_State *L ); int lcoreSetWindowIcon( lua_State* L );
int lcoreSetWindowIcons( lua_State *L ); int lcoreSetWindowIcons( lua_State* L );
int lcoreSetWindowTitle( lua_State *L ); int lcoreSetWindowTitle( lua_State* L );
int lcoreSetWindowPosition( lua_State *L ); int lcoreSetWindowPosition( lua_State* L );
int lcoreSetWindowMonitor( lua_State *L ); int lcoreSetWindowMonitor( lua_State* L );
int lcoreSetWindowMinSize( lua_State *L ); int lcoreSetWindowMinSize( lua_State* L );
int lcoreSetWindowMaxSize( lua_State *L ); int lcoreSetWindowMaxSize( lua_State* L );
int lcoreSetWindowSize( lua_State *L ); int lcoreSetWindowSize( lua_State* L );
int lcoreSetWindowOpacity( lua_State *L ); int lcoreSetWindowOpacity( lua_State* L );
int lcoreSetWindowFocused( lua_State *L ); int lcoreSetWindowFocused( lua_State* L );
int lcoreGetWindowHandle( lua_State *L ); int lcoreGetWindowHandle( lua_State* L );
int lcoreGetScreenSize( lua_State *L ); int lcoreGetScreenSize( lua_State* L );
int lcoreGetRenderSize( lua_State *L ); int lcoreGetRenderSize( lua_State* L );
int lcoreGetMonitorCount( lua_State *L ); int lcoreGetMonitorCount( lua_State* L );
int lcoreGetCurrentMonitor( lua_State *L ); int lcoreGetCurrentMonitor( lua_State* L );
int lcoreGetMonitorPosition( lua_State *L ); int lcoreGetMonitorPosition( lua_State* L );
int lcoreGetMonitorSize( lua_State *L ); int lcoreGetMonitorSize( lua_State* L );
int lcoreGetMonitorPhysicalSize( lua_State *L ); int lcoreGetMonitorPhysicalSize( lua_State* L );
int lcoreGetMonitorRefreshRate( lua_State *L ); int lcoreGetMonitorRefreshRate( lua_State* L );
int lcoreGetWindowPosition( lua_State *L ); int lcoreGetWindowPosition( lua_State* L );
int lcoreGetWindowScaleDPI( lua_State *L ); int lcoreGetWindowScaleDPI( lua_State* L );
int lcoreGetMonitorName( lua_State *L ); int lcoreGetMonitorName( lua_State* L );
int lcoreSetClipboardText( lua_State *L ); int lcoreSetClipboardText( lua_State* L );
int lcoreGetClipboardText( lua_State *L ); int lcoreGetClipboardText( lua_State* L );
/* Cursor-related functions. */ /* Cursor-related functions. */
int lcoreShowCursor( lua_State *L ); int lcoreShowCursor( lua_State* L );
int lcoreHideCursor( lua_State *L ); int lcoreHideCursor( lua_State* L );
int lcoreIsCursorHidden( lua_State *L ); int lcoreIsCursorHidden( lua_State* L );
int lcoreEnableCursor( lua_State *L ); int lcoreEnableCursor( lua_State* L );
int lcoreDisableCursor( lua_State *L ); int lcoreDisableCursor( lua_State* L );
int lcoreIsCursorOnScreen( lua_State *L ); int lcoreIsCursorOnScreen( lua_State* L );
/* Drawing-related functions. */ /* Drawing-related functions. */
int lcoreClearBackground( lua_State *L ); int lcoreClearBackground( lua_State* L );
int lcoreBeginDrawing( lua_State *L ); int lcoreBeginDrawing( lua_State* L );
int lcoreEndDrawing( lua_State *L ); int lcoreEndDrawing( lua_State* L );
int lcoreBeginMode2D( lua_State *L ); int lcoreBeginMode2D( lua_State* L );
int lcoreEndMode2D( lua_State *L ); int lcoreEndMode2D( lua_State* L );
int lcoreBeginMode3D( lua_State *L ); int lcoreBeginMode3D( lua_State* L );
int lcoreEndMode3D( lua_State *L ); int lcoreEndMode3D( lua_State* L );
int lcoreBeginTextureMode( lua_State *L ); int lcoreBeginTextureMode( lua_State* L );
int lcoreEndTextureMode( lua_State *L ); int lcoreEndTextureMode( lua_State* L );
int lcoreBeginShaderMode( lua_State *L ); int lcoreBeginShaderMode( lua_State* L );
int lcoreEndShaderMode( lua_State *L ); int lcoreEndShaderMode( lua_State* L );
int lcoreBeginBlendMode( lua_State *L ); int lcoreBeginBlendMode( lua_State* L );
int lcoreEndBlendMode( lua_State *L ); int lcoreEndBlendMode( lua_State* L );
int lcoreBeginScissorMode( lua_State *L ); int lcoreBeginScissorMode( lua_State* L );
int lcoreEndScissorMode( lua_State *L ); int lcoreEndScissorMode( lua_State* L );
/* Shader management functions. */ /* Shader management functions. */
int lcoreLoadShader( lua_State *L ); int lcoreLoadShader( lua_State* L );
int lcoreLoadShaderFromMemory( lua_State *L ); int lcoreLoadShaderFromMemory( lua_State* L );
int lcoreIsShaderReady( lua_State *L ); int lcoreIsShaderReady( lua_State* L );
int lcoreGetShaderId( lua_State *L ); int lcoreGetShaderId( lua_State* L );
int lcoreGetShaderLocation( lua_State *L ); int lcoreGetShaderLocation( lua_State* L );
int lcoreGetShaderLocationAttrib( lua_State *L ); int lcoreGetShaderLocationAttrib( lua_State* L );
int lcoreSetShaderLocationIndex( lua_State *L ); int lcoreSetShaderLocationIndex( lua_State* L );
int lcoreGetShaderLocationIndex( lua_State *L ); int lcoreGetShaderLocationIndex( lua_State* L );
int lcoreSetShaderValueMatrix( lua_State *L ); int lcoreSetShaderValueMatrix( lua_State* L );
int lcoreSetShaderValueTexture( lua_State *L ); int lcoreSetShaderValueTexture( lua_State* L );
int lcoreSetShaderValue( lua_State *L ); int lcoreSetShaderValue( lua_State* L );
int lcoreSetShaderValueV( lua_State *L ); int lcoreSetShaderValueV( lua_State* L );
int lcoreUnloadShader( lua_State *L ); int lcoreUnloadShader( lua_State* L );
/* Screen-space-related functions. */ /* Screen-space-related functions. */
int lcoreGetMouseRay( lua_State *L ); int lcoreGetMouseRay( lua_State* L );
int lcoreGetCameraMatrix( lua_State *L ); int lcoreGetCameraMatrix( lua_State* L );
int lcoreGetCameraMatrix2D( lua_State *L ); int lcoreGetCameraMatrix2D( lua_State* L );
int lcoreGetWorldToScreen( lua_State *L ); int lcoreGetWorldToScreen( lua_State* L );
int lcoreGetWorldToScreenEx( lua_State *L ); int lcoreGetWorldToScreenEx( lua_State* L );
int lcoreGetWorldToScreen2D( lua_State *L ); int lcoreGetWorldToScreen2D( lua_State* L );
int lcoreGetScreenToWorld2D( lua_State *L ); int lcoreGetScreenToWorld2D( lua_State* L );
/* Timing-related functions. */ /* Timing-related functions. */
int lcoreSetTargetFPS( lua_State *L ); int lcoreSetTargetFPS( lua_State* L );
int lcoreGetFPS( lua_State *L ); int lcoreGetFPS( lua_State* L );
int lcoreGetFrameTime( lua_State *L ); int lcoreGetFrameTime( lua_State* L );
int lcoreGetTime( lua_State *L ); int lcoreGetTime( lua_State* L );
/* Random values generation functions. */ /* Random values generation functions. */
int lcoreSetRandomSeed( lua_State *L ); int lcoreSetRandomSeed( lua_State* L );
int lcoreGetRandomValue( lua_State *L ); int lcoreGetRandomValue( lua_State* L );
int lcoreLoadRandomSequence( lua_State *L ); int lcoreLoadRandomSequence( lua_State* L );
/* Misc. functions */ /* Misc. functions */
int lcoreTakeScreenshot( lua_State *L ); int lcoreTakeScreenshot( lua_State* L );
int lcoreSetConfigFlags( lua_State *L ); int lcoreSetConfigFlags( lua_State* L );
int lcoreTraceLog( lua_State *L ); int lcoreTraceLog( lua_State* L );
int lcoreSetTraceLogLevel( lua_State *L ); int lcoreSetTraceLogLevel( lua_State* L );
int lcoreSetLogLevelInvalid( lua_State *L ); int lcoreSetLogLevelInvalid( lua_State* L );
int lcoreGetLogLevelInvalid( lua_State *L ); int lcoreGetLogLevelInvalid( lua_State* L );
int lcoreOpenURL( lua_State *L ); int lcoreOpenURL( lua_State* L );
int lcoreIsGCUnloadEnabled( lua_State *L ); int lcoreIsGCUnloadEnabled( lua_State* L );
int lcoreSetGCUnload( lua_State *L ); int lcoreSetGCUnload( lua_State* L );
/* Files management functions. */ /* Files management functions. */
int lcoreLoadFileData( lua_State *L ); int lcoreLoadFileData( lua_State* L );
int lcoreSaveFileData( lua_State *L ); int lcoreSaveFileData( lua_State* L );
int lcoreExportDataAsCode( lua_State *L ); int lcoreExportDataAsCode( lua_State* L );
int lcoreLoadFileText( lua_State *L ); int lcoreLoadFileText( lua_State* L );
int lcoreSaveFileText( lua_State *L ); int lcoreSaveFileText( lua_State* L );
/* Files system functions. */ /* Files system functions. */
int lcoreGetBasePath( lua_State *L ); int lcoreGetBasePath( lua_State* L );
int lcoreFileExists( lua_State *L ); int lcoreFileExists( lua_State* L );
int lcoreDirectoryExists( lua_State *L ); int lcoreDirectoryExists( lua_State* L );
int lcoreIsFileExtension( lua_State *L ); int lcoreIsFileExtension( lua_State* L );
int lcoreGetFileLength( lua_State *L ); int lcoreGetFileLength( lua_State* L );
int lcoreGetFileExtension( lua_State *L ); int lcoreGetFileExtension( lua_State* L );
int lcoreGetFileName( lua_State *L ); int lcoreGetFileName( lua_State* L );
int lcoreGetFileNameWithoutExt( lua_State *L ); int lcoreGetFileNameWithoutExt( lua_State* L );
int lcoreGetDirectoryPath( lua_State *L ); int lcoreGetDirectoryPath( lua_State* L );
int lcoreGetPrevDirectoryPath( lua_State *L ); int lcoreGetPrevDirectoryPath( lua_State* L );
int lcoreGetWorkingDirectory( lua_State *L ); int lcoreGetWorkingDirectory( lua_State* L );
int lcoreGetApplicationDirectory( lua_State *L ); int lcoreGetApplicationDirectory( lua_State* L );
int lcoreLoadDirectoryFiles( lua_State *L ); int lcoreLoadDirectoryFiles( lua_State* L );
int lcoreLoadDirectoryFilesEx( lua_State *L ); int lcoreLoadDirectoryFilesEx( lua_State* L );
int lcoreChangeDirectory( lua_State *L ); int lcoreChangeDirectory( lua_State* L );
int lcoreIsPathFile( lua_State *L ); int lcoreIsPathFile( lua_State* L );
int lcoreIsFileDropped( lua_State *L ); int lcoreIsFileDropped( lua_State* L );
int lcoreLoadDroppedFiles( lua_State *L ); int lcoreLoadDroppedFiles( lua_State* L );
int lcoreGetFileModTime( lua_State *L ); int lcoreGetFileModTime( lua_State* L );
/* Compression/Encoding functionality. */ /* Compression/Encoding functionality. */
int lcoreCompressData( lua_State *L ); int lcoreCompressData( lua_State* L );
int lcoreDecompressData( lua_State *L ); int lcoreDecompressData( lua_State* L );
int lcoreEncodeDataBase64( lua_State *L ); int lcoreEncodeDataBase64( lua_State* L );
int lcoreDecodeDataBase64( lua_State *L ); int lcoreDecodeDataBase64( lua_State* L );
/* Input-related functions: keyboard. */ /* Input-related functions: keyboard. */
int lcoreIsKeyPressed( lua_State *L ); int lcoreIsKeyPressed( lua_State* L );
int lcoreIsKeyDown( lua_State *L ); int lcoreIsKeyDown( lua_State* L );
int lcoreIsKeyReleased( lua_State *L ); int lcoreIsKeyReleased( lua_State* L );
int lcoreIsKeyUp( lua_State *L ); int lcoreIsKeyUp( lua_State* L );
int lcoreGetKeyPressed( lua_State *L ); int lcoreGetKeyPressed( lua_State* L );
int lcoreGetCharPressed( lua_State *L ); int lcoreGetCharPressed( lua_State* L );
int lcoreSetExitKey( lua_State *L ); int lcoreSetExitKey( lua_State* L );
int lcoreGetKeyName( lua_State *L ); int lcoreGetKeyName( lua_State* L );
int lcoreGetKeyScancode( lua_State *L ); int lcoreGetKeyScancode( lua_State* L );
/* Input-related functions: gamepads. */ /* Input-related functions: gamepads. */
int lcoreIsGamepadAvailable( lua_State *L ); int lcoreIsGamepadAvailable( lua_State* L );
int lcoreGetGamepadName( lua_State *L ); int lcoreGetGamepadName( lua_State* L );
int lcoreIsGamepadButtonPressed( lua_State *L ); int lcoreIsGamepadButtonPressed( lua_State* L );
int lcoreIsGamepadButtonDown( lua_State *L ); int lcoreIsGamepadButtonDown( lua_State* L );
int lcoreIsGamepadButtonReleased( lua_State *L ); int lcoreIsGamepadButtonReleased( lua_State* L );
int lcoreGetGamepadAxisCount( lua_State *L ); int lcoreGetGamepadAxisCount( lua_State* L );
int lcoreGetGamepadAxisMovement( lua_State *L ); int lcoreGetGamepadAxisMovement( lua_State* L );
int lcoreSetGamepadMappings( lua_State *L ); int lcoreSetGamepadMappings( lua_State* L );
/* Input-related functions: mouse. */ /* Input-related functions: mouse. */
int lcoreIsMouseButtonPressed( lua_State *L ); int lcoreIsMouseButtonPressed( lua_State* L );
int lcoreIsMouseButtonDown( lua_State *L ); int lcoreIsMouseButtonDown( lua_State* L );
int lcoreIsMouseButtonReleased( lua_State *L ); int lcoreIsMouseButtonReleased( lua_State* L );
int lcoreIsMouseButtonUp( lua_State *L ); int lcoreIsMouseButtonUp( lua_State* L );
int lcoreGetMousePosition( lua_State *L ); int lcoreGetMousePosition( lua_State* L );
int lcoreGetMouseDelta( lua_State *L ); int lcoreGetMouseDelta( lua_State* L );
int lcoreSetMousePosition( lua_State *L ); int lcoreSetMousePosition( lua_State* L );
int lcoreSetMouseOffset( lua_State *L ); int lcoreSetMouseOffset( lua_State* L );
int lcoreSetMouseScale( lua_State *L ); int lcoreSetMouseScale( lua_State* L );
int lcoreGetMouseWheelMove( lua_State *L ); int lcoreGetMouseWheelMove( lua_State* L );
int lcoreSetMouseCursor( lua_State *L ); int lcoreSetMouseCursor( lua_State* L );
/* Input-related functions: touch. */ /* Input-related functions: touch. */
int lcoreGetTouchPosition( lua_State *L ); int lcoreGetTouchPosition( lua_State* L );
int lcoreGetTouchPointId( lua_State *L ); int lcoreGetTouchPointId( lua_State* L );
int lcoreGetTouchPointCount( lua_State *L ); int lcoreGetTouchPointCount( lua_State* L );
/* Input-related functions: gestures. */ /* Input-related functions: gestures. */
int lcoreSetGesturesEnabled( lua_State *L ); int lcoreSetGesturesEnabled( lua_State* L );
int lcoreIsGestureDetected( lua_State *L ); int lcoreIsGestureDetected( lua_State* L );
int lcoreGetGestureDetected( lua_State *L ); int lcoreGetGestureDetected( lua_State* L );
int lcoreGetGestureHoldDuration( lua_State *L ); int lcoreGetGestureHoldDuration( lua_State* L );
int lcoreGetGestureDragVector( lua_State *L ); int lcoreGetGestureDragVector( lua_State* L );
int lcoreGetGestureDragAngle( lua_State *L ); int lcoreGetGestureDragAngle( lua_State* L );
int lcoreGetGesturePinchVector( lua_State *L ); int lcoreGetGesturePinchVector( lua_State* L );
int lcoreGetGesturePinchAngle( lua_State *L ); int lcoreGetGesturePinchAngle( lua_State* L );
/* Camera2D System functions. */ /* Camera2D System functions. */
int lcoreCreateCamera2D( lua_State *L ); int lcoreCreateCamera2D( lua_State* L );
int lcoreSetCamera2DTarget( lua_State *L ); int lcoreSetCamera2DTarget( lua_State* L );
int lcoreSetCamera2DOffset( lua_State *L ); int lcoreSetCamera2DOffset( lua_State* L );
int lcoreSetCamera2DRotation( lua_State *L ); int lcoreSetCamera2DRotation( lua_State* L );
int lcoreSetCamera2DZoom( lua_State *L ); int lcoreSetCamera2DZoom( lua_State* L );
int lcoreGetCamera2DTarget( lua_State *L ); int lcoreGetCamera2DTarget( lua_State* L );
int lcoreGetCamera2DOffset( lua_State *L ); int lcoreGetCamera2DOffset( lua_State* L );
int lcoreGetCamera2DRotation( lua_State *L ); int lcoreGetCamera2DRotation( lua_State* L );
int lcoreGetCamera2DZoom( lua_State *L ); int lcoreGetCamera2DZoom( lua_State* L );
/* Camera3D System functions. */ /* Camera3D System functions. */
int lcoreCreateCamera3D( lua_State *L ); int lcoreCreateCamera3D( lua_State* L );
int lcoreSetCamera3DPosition( lua_State *L ); int lcoreSetCamera3DPosition( lua_State* L );
int lcoreSetCamera3DTarget( lua_State *L ); int lcoreSetCamera3DTarget( lua_State* L );
int lcoreSetCamera3DUp( lua_State *L ); int lcoreSetCamera3DUp( lua_State* L );
int lcoreSetCamera3DFovy( lua_State *L ); int lcoreSetCamera3DFovy( lua_State* L );
int lcoreSetCamera3DProjection( lua_State *L ); int lcoreSetCamera3DProjection( lua_State* L );
int lcoreGetCamera3DPosition( lua_State *L ); int lcoreGetCamera3DPosition( lua_State* L );
int lcoreGetCamera3DTarget( lua_State *L ); int lcoreGetCamera3DTarget( lua_State* L );
int lcoreGetCamera3DUp( lua_State *L ); int lcoreGetCamera3DUp( lua_State* L );
int lcoreGetCamera3DFovy( lua_State *L ); int lcoreGetCamera3DFovy( lua_State* L );
int lcoreGetCamera3DProjection( lua_State *L ); int lcoreGetCamera3DProjection( lua_State* L );
int lcoreGetCamera3DForward( lua_State *L ); int lcoreGetCamera3DForward( lua_State* L );
int lcoreGetCamera3DUpNormalized( lua_State *L ); int lcoreGetCamera3DUpNormalized( lua_State* L );
int lcoreGetCamera3DRight( lua_State *L ); int lcoreGetCamera3DRight( lua_State* L );
int lcoreCamera3DMoveForward( lua_State *L ); int lcoreCamera3DMoveForward( lua_State* L );
int lcoreCamera3DMoveUp( lua_State *L ); int lcoreCamera3DMoveUp( lua_State* L );
int lcoreCamera3DMoveRight( lua_State *L ); int lcoreCamera3DMoveRight( lua_State* L );
int lcoreCamera3DMoveToTarget( lua_State *L ); int lcoreCamera3DMoveToTarget( lua_State* L );
int lcoreCamera3DYaw( lua_State *L ); int lcoreCamera3DYaw( lua_State* L );
int lcoreCamera3DPitch( lua_State *L ); int lcoreCamera3DPitch( lua_State* L );
int lcoreCamera3DRoll( lua_State *L ); int lcoreCamera3DRoll( lua_State* L );
int lcoreGetCamera3DViewMatrix( lua_State *L ); int lcoreGetCamera3DViewMatrix( lua_State* L );
int lcoreGetCamera3DProjectionMatrix( lua_State *L ); int lcoreGetCamera3DProjectionMatrix( lua_State* L );
int lcoreUpdateCamera3D( lua_State *L ); int lcoreUpdateCamera3D( lua_State* L );
int lcoreUpdateCamera3DPro( lua_State *L ); int lcoreUpdateCamera3DPro( lua_State* L );
/* Buffer management functions. */ /* Buffer management functions. */
int lcoreLoadBuffer( lua_State *L ); int lcoreLoadBuffer( lua_State* L );
int lcoreLoadBufferFromFile( lua_State *L ); int lcoreLoadBufferFromFile( lua_State* L );
int lcoreLoadBufferFromString( lua_State *L ); int lcoreLoadBufferFromString( lua_State* L );
int lcoreUnloadBuffer( lua_State *L ); int lcoreUnloadBuffer( lua_State* L );
int lcoreGetBufferData( lua_State *L ); int lcoreGetBufferData( lua_State* L );
int lcoreGetBufferType( lua_State *L ); int lcoreGetBufferType( lua_State* L );
int lcoreGetBufferSize( lua_State *L ); int lcoreGetBufferSize( lua_State* L );
int lcoreGetBufferElementSize( lua_State *L ); int lcoreGetBufferElementSize( lua_State* L );
int lcoreGetBufferLength( lua_State *L ); int lcoreGetBufferLength( lua_State* L );
int lcoreExportBuffer( lua_State *L ); int lcoreExportBuffer( lua_State* L );

View File

@@ -1,4 +1,4 @@
#pragma once #pragma once
/* Framebuffer management. */ /* Framebuffer management. */
int lglBlitFramebuffer( lua_State *L ); int lglBlitFramebuffer( lua_State* L );

View File

@@ -1,15 +1,15 @@
#pragma once #pragma once
/* Light management functions. */ /* Light management functions. */
int llightsCreateLight( lua_State *L ); int llightsCreateLight( lua_State* L );
int llightsUpdateLightValues( lua_State *L ); int llightsUpdateLightValues( lua_State* L );
int llightsSetLightType( lua_State *L ); int llightsSetLightType( lua_State* L );
int llightsSetLightPosition( lua_State *L ); int llightsSetLightPosition( lua_State* L );
int llightsSetLightTarget( lua_State *L ); int llightsSetLightTarget( lua_State* L );
int llightsSetLightColor( lua_State *L ); int llightsSetLightColor( lua_State* L );
int llightsSetLightEnabled( lua_State *L ); int llightsSetLightEnabled( lua_State* L );
int llightsGetLightType( lua_State *L ); int llightsGetLightType( lua_State* L );
int llightsGetLightPosition( lua_State *L ); int llightsGetLightPosition( lua_State* L );
int llightsGetLightTarget( lua_State *L ); int llightsGetLightTarget( lua_State* L );
int llightsGetLightColor( lua_State *L ); int llightsGetLightColor( lua_State* L );
int llightsIsLightEnabled( lua_State *L ); int llightsIsLightEnabled( lua_State* L );

View File

@@ -1,158 +1,158 @@
#pragma once #pragma once
/* Matrix operations */ /* Matrix operations */
int lrlglMatrixMode( lua_State *L ); int lrlglMatrixMode( lua_State* L );
int lrlglPushMatrix( lua_State *L ); int lrlglPushMatrix( lua_State* L );
int lrlglPopMatrix( lua_State *L ); int lrlglPopMatrix( lua_State* L );
int lrlglLoadIdentity( lua_State *L ); int lrlglLoadIdentity( lua_State* L );
int lrlglTranslatef( lua_State *L ); int lrlglTranslatef( lua_State* L );
int lrlglRotatef( lua_State *L ); int lrlglRotatef( lua_State* L );
int lrlglScalef( lua_State *L ); int lrlglScalef( lua_State* L );
int lrlglMultMatrixf( lua_State *L ); 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 );
/* 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 );
int lrlglVertex2f( lua_State *L ); int lrlglVertex2f( lua_State* L );
int lrlglVertex3f( lua_State *L ); int lrlglVertex3f( lua_State* L );
int lrlglTexCoord2f( lua_State *L ); int lrlglTexCoord2f( lua_State* L );
int lrlglNormal3f( lua_State *L ); int lrlglNormal3f( lua_State* L );
int lrlglColor4ub( lua_State *L ); int lrlglColor4ub( lua_State* L );
int lrlglColor3f( lua_State *L ); int lrlglColor3f( lua_State* L );
int lrlglColor4f( lua_State *L ); int lrlglColor4f( lua_State* L );
/* Vertex buffers state */ /* Vertex buffers state */
int lrlglEnableVertexArray( lua_State *L ); int lrlglEnableVertexArray( lua_State* L );
int lrlglDisableVertexArray( lua_State *L ); int lrlglDisableVertexArray( lua_State* L );
int lrlglEnableVertexBuffer( lua_State *L ); int lrlglEnableVertexBuffer( lua_State* L );
int lrlglDisableVertexBuffer( lua_State *L ); int lrlglDisableVertexBuffer( lua_State* L );
int lrlglEnableVertexBufferElement( lua_State *L ); int lrlglEnableVertexBufferElement( lua_State* L );
int lrlglDisableVertexBufferElement( lua_State *L ); int lrlglDisableVertexBufferElement( lua_State* L );
int lrlglEnableVertexAttribute( lua_State *L ); int lrlglEnableVertexAttribute( lua_State* L );
int lrlglDisableVertexAttribute( lua_State *L ); int lrlglDisableVertexAttribute( lua_State* L );
/* Textures state */ /* Textures state */
int lrlglActiveTextureSlot( lua_State *L ); int lrlglActiveTextureSlot( lua_State* L );
int lrlglEnableTexture( lua_State *L ); int lrlglEnableTexture( lua_State* L );
int lrlglDisableTexture( lua_State *L ); int lrlglDisableTexture( lua_State* L );
int lrlglEnableTextureCubemap( lua_State *L ); int lrlglEnableTextureCubemap( lua_State* L );
int lrlglDisableTextureCubemap( lua_State *L ); int lrlglDisableTextureCubemap( lua_State* L );
int lrlglTextureParameters( lua_State *L ); int lrlglTextureParameters( lua_State* L );
int lrlglCubemapParameters( lua_State *L ); int lrlglCubemapParameters( lua_State* L );
/* Shader state. */ /* Shader state. */
int lrlglEnableShader( lua_State *L ); int lrlglEnableShader( lua_State* L );
int lrlglDisableShader( lua_State *L ); 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 lrlglActiveDrawBuffers( lua_State *L ); int lrlglActiveDrawBuffers( 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 );
int lrlglEnableDepthTest( lua_State *L ); int lrlglEnableDepthTest( lua_State* L );
int lrlglDisableDepthTest( lua_State *L ); int lrlglDisableDepthTest( lua_State* L );
int lrlglEnableDepthMask( lua_State *L ); 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 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 );
int lrlglScissor( lua_State *L ); int lrlglScissor( lua_State* L );
int lrlglEnableWireMode( lua_State *L ); int lrlglEnableWireMode( lua_State* L );
int lrlglDisableWireMode( lua_State *L ); int lrlglDisableWireMode( lua_State* L );
int lrlglSetLineWidth( lua_State *L ); int lrlglSetLineWidth( lua_State* L );
int lrlglGetLineWidth( lua_State *L ); int lrlglGetLineWidth( lua_State* L );
int lrlglEnableSmoothLines( lua_State *L ); int lrlglEnableSmoothLines( lua_State* L );
int lrlglDisableSmoothLines( lua_State *L ); int lrlglDisableSmoothLines( lua_State* L );
int lrlglEnableStereoRender( lua_State *L ); int lrlglEnableStereoRender( lua_State* L );
int lrlglDisableStereoRender( lua_State *L ); int lrlglDisableStereoRender( lua_State* L );
int lrlglIsStereoRenderEnabled( lua_State *L ); int lrlglIsStereoRenderEnabled( lua_State* L );
int lrlglClearColor( lua_State *L ); int lrlglClearColor( lua_State* L );
int lrlglClearScreenBuffers( lua_State *L ); int lrlglClearScreenBuffers( lua_State* L );
int lrlglCheckErrors( lua_State *L ); int lrlglCheckErrors( lua_State* L );
int lrlglSetBlendMode( lua_State *L ); int lrlglSetBlendMode( lua_State* L );
int lrlglSetBlendFactors( lua_State *L ); int lrlglSetBlendFactors( lua_State* L );
int lrlglSetBlendFactorsSeparate( lua_State *L ); int lrlglSetBlendFactorsSeparate( lua_State* L );
/* Initialization functions */ /* Initialization functions */
int lrlglGetVersion( lua_State *L ); int lrlglGetVersion( lua_State* L );
int lrlglSetFramebufferWidth( lua_State *L ); int lrlglSetFramebufferWidth( lua_State* L );
int lrlglGetFramebufferWidth( lua_State *L ); int lrlglGetFramebufferWidth( lua_State* L );
int lrlglSetFramebufferHeight( lua_State *L ); int lrlglSetFramebufferHeight( lua_State* L );
int lrlglGetFramebufferHeight( lua_State *L ); int lrlglGetFramebufferHeight( lua_State* L );
int lrlglGetTextureIdDefault( lua_State *L ); int lrlglGetTextureIdDefault( lua_State* L );
int lrlglGetShaderIdDefault( lua_State *L ); int lrlglGetShaderIdDefault( lua_State* L );
int lrlglGetShaderLocsDefault( lua_State *L ); int lrlglGetShaderLocsDefault( lua_State* L );
/* Render batch management */ /* Render batch management */
int lrlglLoadRenderBatch( lua_State *L ); int lrlglLoadRenderBatch( lua_State* L );
int lrlglUnloadRenderBatch( lua_State *L ); int lrlglUnloadRenderBatch( lua_State* L );
int lrlglDrawRenderBatch( lua_State *L ); int lrlglDrawRenderBatch( lua_State* L );
int lrlglSetRenderBatchActive( lua_State *L ); int lrlglSetRenderBatchActive( lua_State* L );
int lrlglDrawRenderBatchActive( lua_State *L ); int lrlglDrawRenderBatchActive( lua_State* L );
int lrlglCheckRenderBatchLimit( lua_State *L ); int lrlglCheckRenderBatchLimit( lua_State* L );
int lrlglSetTexture( lua_State *L ); int lrlglSetTexture( lua_State* L );
/* Vertex buffers management */ /* Vertex buffers management */
int lrlglLoadVertexArray( lua_State *L ); int lrlglLoadVertexArray( lua_State* L );
int lrlglLoadVertexBuffer( lua_State *L ); int lrlglLoadVertexBuffer( lua_State* L );
int lrlglLoadVertexBufferElement( lua_State *L ); int lrlglLoadVertexBufferElement( lua_State* L );
int lrlglUpdateVertexBuffer( lua_State *L ); int lrlglUpdateVertexBuffer( lua_State* L );
int lrlglUpdateVertexBufferElements( lua_State *L ); int lrlglUpdateVertexBufferElements( lua_State* L );
int lrlglUnloadVertexArray( lua_State *L ); int lrlglUnloadVertexArray( lua_State* L );
int lrlglUnloadVertexBuffer( lua_State *L ); int lrlglUnloadVertexBuffer( lua_State* L );
int lrlglSetVertexAttribute( lua_State *L ); int lrlglSetVertexAttribute( lua_State* L );
int lrlglSetVertexAttributeDivisor( lua_State *L ); int lrlglSetVertexAttributeDivisor( lua_State* L );
int lrlglSetVertexAttributeDefault( lua_State *L ); int lrlglSetVertexAttributeDefault( lua_State* L );
int lrlglDrawVertexArray( lua_State *L ); int lrlglDrawVertexArray( lua_State* L );
int lrlglDrawVertexArrayElements( lua_State *L ); int lrlglDrawVertexArrayElements( lua_State* L );
int lrlglDrawVertexArrayInstanced( lua_State *L ); int lrlglDrawVertexArrayInstanced( lua_State* L );
int lrlglDrawVertexArrayElementsInstanced( lua_State *L ); int lrlglDrawVertexArrayElementsInstanced( lua_State* L );
/* Textures management */ /* Textures management */
int lrlglLoadTexture( lua_State *L ); int lrlglLoadTexture( lua_State* L );
int lrlglLoadTextureDepth( lua_State *L ); int lrlglLoadTextureDepth( lua_State* L );
int lrlglLoadTextureCubemap( lua_State *L ); int lrlglLoadTextureCubemap( lua_State* L );
int lrlglUpdateTexture( lua_State *L ); int lrlglUpdateTexture( lua_State* L );
int lrlglGetGlTextureFormats( lua_State *L ); int lrlglGetGlTextureFormats( lua_State* L );
int lrlglGetPixelFormatName( lua_State *L ); int lrlglGetPixelFormatName( lua_State* L );
int lrlglUnloadTexture( lua_State *L ); int lrlglUnloadTexture( lua_State* L );
int lrlglGenTextureMipmaps( lua_State *L ); int lrlglGenTextureMipmaps( lua_State* L );
int lrlglReadTexturePixels( lua_State *L ); int lrlglReadTexturePixels( lua_State* L );
int lrlglReadScreenPixels( lua_State *L ); int lrlglReadScreenPixels( lua_State* L );
/* Framebuffer management (fbo) */ /* Framebuffer management (fbo) */
int lrlglLoadFramebuffer( lua_State *L ); int lrlglLoadFramebuffer( lua_State* L );
int lrlglFramebufferAttach( lua_State *L ); int lrlglFramebufferAttach( lua_State* L );
int lrlglFramebufferComplete( lua_State *L ); int lrlglFramebufferComplete( lua_State* L );
int lrlglUnloadFramebuffer( lua_State *L ); int lrlglUnloadFramebuffer( lua_State* L );
/* Shaders management */ /* Shaders management */
int lrlglLoadShaderCode( lua_State *L ); int lrlglLoadShaderCode( lua_State* L );
int lrlglCompileShader( lua_State *L ); int lrlglCompileShader( lua_State* L );
int lrlglLoadShaderProgram( lua_State *L ); int lrlglLoadShaderProgram( lua_State* L );
int lrlglUnloadShaderProgram( lua_State *L ); int lrlglUnloadShaderProgram( lua_State* L );
int lrlglGetLocationUniform( lua_State *L ); 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 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 */
int lrlglLoadComputeShaderProgram( lua_State *L ); int lrlglLoadComputeShaderProgram( lua_State* L );
int lrlglComputeShaderDispatch( lua_State *L ); int lrlglComputeShaderDispatch( lua_State* L );
/* Shader buffer storage object management (ssbo) */ /* Shader buffer storage object management (ssbo) */
int lrlglLoadShaderBuffer( lua_State *L ); int lrlglLoadShaderBuffer( lua_State* L );
int lrlglUnloadShaderBuffer( lua_State *L ); int lrlglUnloadShaderBuffer( lua_State* L );
int lrlglUpdateShaderBuffer( lua_State *L ); int lrlglUpdateShaderBuffer( lua_State* L );
int lrlglBindShaderBuffer( lua_State *L ); int lrlglBindShaderBuffer( lua_State* L );
int lrlglReadShaderBuffer( lua_State *L ); int lrlglReadShaderBuffer( lua_State* L );
int lrlglCopyShaderBuffer( lua_State *L ); int lrlglCopyShaderBuffer( lua_State* L );
int lrlglGetShaderBufferSize( lua_State *L ); int lrlglGetShaderBufferSize( lua_State* L );
/* Buffer management */ /* Buffer management */
int lrlglBindImageTexture( lua_State *L ); int lrlglBindImageTexture( lua_State* L );
/* Matrix state management */ /* Matrix state management */
int lrlglGetMatrixModelview( lua_State *L ); int lrlglGetMatrixModelview( lua_State* L );
int lrlglGetMatrixProjection( lua_State *L ); int lrlglGetMatrixProjection( lua_State* L );
int lrlglGetMatrixTransform( lua_State *L ); int lrlglGetMatrixTransform( lua_State* L );
int lrlglGetMatrixProjectionStereo( lua_State *L ); int lrlglGetMatrixProjectionStereo( lua_State* L );
int lrlglGetMatrixViewOffsetStereo( lua_State *L ); int lrlglGetMatrixViewOffsetStereo( lua_State* L );
int lrlglSetMatrixProjection( lua_State *L ); int lrlglSetMatrixProjection( lua_State* L );
int lrlglSetMatrixModelview( lua_State *L ); int lrlglSetMatrixModelview( lua_State* L );
int lrlglSetMatrixProjectionStereo( lua_State *L ); int lrlglSetMatrixProjectionStereo( lua_State* L );
int lrlglSetMatrixViewOffsetStereo( lua_State *L ); int lrlglSetMatrixViewOffsetStereo( lua_State* L );

View File

@@ -14,18 +14,18 @@ enum BufferType {
typedef struct { typedef struct {
int type; int type;
size_t size; size_t size;
void *data; void* data;
} Buffer; } Buffer;
/* Global assing functions. */ /* Global assing functions. */
void assignGlobalInt( int value, const char *name ); void assignGlobalInt( int value, const char* name );
void assignGlobalFloat( float value, const char *name ); void assignGlobalFloat( float value, const char* name );
void assignGlobalDouble( double value, const char *name ); void assignGlobalDouble( double value, const char* name );
void assignGlobalColor( Color color, const char *name ); void assignGlobalColor( Color color, const char* name );
void assingGlobalFunction( const char *name, int ( *functionPtr )( lua_State* ) ); void assingGlobalFunction( const char* name, int ( *functionPtr )( lua_State* ) );
bool luaInit( int argn, const char **argc ); bool luaInit( int argn, const char** argc );
int luaTraceback( lua_State *L ); int luaTraceback( lua_State* L );
bool luaCallMain(); bool luaCallMain();
void luaCallUpdate(); void luaCallUpdate();
void luaCallDraw(); void luaCallDraw();
@@ -34,67 +34,67 @@ void luaRegister();
void platformDefineGlobals(); void platformDefineGlobals();
void luaPlatformRegister(); void luaPlatformRegister();
/* Lua get types. */ /* Lua get types. */
bool uluaGetBoolean( lua_State *L, int index ); bool uluaGetBoolean( lua_State* L, int index );
Color uluaGetColor( lua_State *L, int index ); Color uluaGetColor( lua_State* L, int index );
Vector2 uluaGetVector2( lua_State *L, int index ); Vector2 uluaGetVector2( lua_State* L, int index );
Vector3 uluaGetVector3( lua_State *L, int index ); Vector3 uluaGetVector3( lua_State* L, int index );
Vector4 uluaGetVector4( lua_State *L, int index ); Vector4 uluaGetVector4( lua_State* L, int index );
Rectangle uluaGetRectangle( lua_State *L, int index ); Rectangle uluaGetRectangle( lua_State* L, int index );
Quaternion uluaGetQuaternion( lua_State *L, int index ); Quaternion uluaGetQuaternion( lua_State* L, int index );
Matrix uluaGetMatrix( lua_State *L, int index ); Matrix uluaGetMatrix( lua_State* L, int index );
BoundingBox uluaGetBoundingBox( lua_State *L, int index ); BoundingBox uluaGetBoundingBox( lua_State* L, int index );
Ray uluaGetRay( lua_State *L, int index ); Ray uluaGetRay( lua_State* L, int index );
NPatchInfo uluaGetNPatchInfo( lua_State *L, int index ); NPatchInfo uluaGetNPatchInfo( lua_State* L, int index );
BoneInfo uluaGetBoneInfo( lua_State *L, int index ); BoneInfo uluaGetBoneInfo( lua_State* L, int index );
Transform uluaGetTransform( lua_State *L, int index ); Transform uluaGetTransform( lua_State* L, int index );
Buffer* uluaGetBuffer( lua_State *L, int index ); Buffer* uluaGetBuffer( lua_State* L, int index );
Image* uluaGetImage( lua_State *L, int index ); Image* uluaGetImage( lua_State* L, int index );
Texture* uluaGetTexture( lua_State *L, int index ); Texture* uluaGetTexture( lua_State* L, int index );
RenderTexture* uluaGetRenderTexture( lua_State *L, int index ); RenderTexture* uluaGetRenderTexture( lua_State* L, int index );
Shader* uluaGetShader( lua_State *L, int index ); Shader* uluaGetShader( lua_State* L, int index );
Mesh* uluaGetMesh( lua_State *L, int index ); Mesh* uluaGetMesh( lua_State* L, int index );
Camera2D* uluaGetCamera2D( lua_State *L, int index ); Camera2D* uluaGetCamera2D( lua_State* L, int index );
Camera3D* uluaGetCamera3D( lua_State *L, int index ); Camera3D* uluaGetCamera3D( lua_State* L, int index );
Font* uluaGetFont( lua_State *L, int index ); Font* uluaGetFont( lua_State* L, int index );
GlyphInfo* uluaGetGlyphInfo( lua_State *L, int index ); GlyphInfo* uluaGetGlyphInfo( lua_State* L, int index );
Wave* uluaGetWave( lua_State *L, int index ); Wave* uluaGetWave( lua_State* L, int index );
Sound* uluaGetSound( lua_State *L, int index ); Sound* uluaGetSound( lua_State* L, int index );
Music* uluaGetMusic( lua_State *L, int index ); Music* uluaGetMusic( lua_State* L, int index );
Light* uluaGetLight( lua_State *L, int index ); Light* uluaGetLight( lua_State* L, int index );
Material* uluaGetMaterial( lua_State *L, int index ); Material* uluaGetMaterial( lua_State* L, int index );
Model* uluaGetModel( lua_State *L, int index ); Model* uluaGetModel( lua_State* L, int index );
ModelAnimation* uluaGetModelAnimation( lua_State *L, int index ); ModelAnimation* uluaGetModelAnimation( lua_State* L, int index );
rlRenderBatch* uluaGetRLRenderBatch( lua_State *L, int index ); rlRenderBatch* uluaGetRLRenderBatch( lua_State* L, int index );
/* Lua push types. */ /* Lua push types. */
void uluaPushColor( lua_State *L, Color color ); void uluaPushColor( lua_State* L, Color color );
void uluaPushVector2( lua_State *L, Vector2 vector ); void uluaPushVector2( lua_State* L, Vector2 vector );
void uluaPushVector3( lua_State *L, Vector3 vector ); void uluaPushVector3( lua_State* L, Vector3 vector );
void uluaPushVector4( lua_State *L, Vector4 vector ); void uluaPushVector4( lua_State* L, Vector4 vector );
void uluaPushRectangle( lua_State *L, Rectangle rect ); void uluaPushRectangle( lua_State* L, Rectangle rect );
void uluaPushQuaternion( lua_State *L, Quaternion quaternion ); void uluaPushQuaternion( lua_State* L, Quaternion quaternion );
void uluaPushMatrix( lua_State *L, Matrix matrix ); void uluaPushMatrix( lua_State* L, Matrix matrix );
void uluaPushRay( lua_State *L, Ray ray ); void uluaPushRay( lua_State* L, Ray ray );
void uluaPushRayCollision( lua_State *L, RayCollision rayCol ); void uluaPushRayCollision( lua_State* L, RayCollision rayCol );
void uluaPushBoundingBox( lua_State *L, BoundingBox box ); void uluaPushBoundingBox( lua_State* L, BoundingBox box );
void uluaPushBoneInfo( lua_State *L, BoneInfo boneInfo ); void uluaPushBoneInfo( lua_State* L, BoneInfo boneInfo );
void uluaPushTransform( lua_State *L, Transform transform ); void uluaPushTransform( lua_State* L, Transform transform );
void uluaPushBuffer( lua_State *L, Buffer buffer ); void uluaPushBuffer( lua_State* L, Buffer buffer );
void uluaPushImage( lua_State *L, Image image ); void uluaPushImage( lua_State* L, Image image );
void uluaPushTexture( lua_State *L, Texture texture ); void uluaPushTexture( lua_State* L, Texture texture );
void uluaPushRenderTexture( lua_State *L, RenderTexture renderTexture ); void uluaPushRenderTexture( lua_State* L, RenderTexture renderTexture );
void uluaPushCamera2D( lua_State *L, Camera2D camera ); void uluaPushCamera2D( lua_State* L, Camera2D camera );
void uluaPushCamera3D( lua_State *L, Camera3D camera ); void uluaPushCamera3D( lua_State* L, Camera3D camera );
void uluaPushShader( lua_State *L, Shader shader ); void uluaPushShader( lua_State* L, Shader shader );
void uluaPushFont( lua_State *L, Font font ); void uluaPushFont( lua_State* L, Font font );
void uluaPushGlyphInfo( lua_State *L, GlyphInfo glyph ); void uluaPushGlyphInfo( lua_State* L, GlyphInfo glyph );
void uluaPushWave( lua_State *L, Wave wave ); void uluaPushWave( lua_State* L, Wave wave );
void uluaPushSound( lua_State *L, Sound sound ); void uluaPushSound( lua_State* L, Sound sound );
void uluaPushMusic( lua_State *L, Music music ); void uluaPushMusic( lua_State* L, Music music );
void uluaPushLight( lua_State *L, Light light ); void uluaPushLight( lua_State* L, Light light );
void uluaPushMaterial( lua_State *L, Material material ); void uluaPushMaterial( lua_State* L, Material material );
void uluaPushMesh( lua_State *L, Mesh mesh ); void uluaPushMesh( lua_State* L, Mesh mesh );
void uluaPushModel( lua_State *L, Model model ); void uluaPushModel( lua_State* L, Model model );
void uluaPushModelAnimation( lua_State *L, ModelAnimation modelAnimation ); void uluaPushModelAnimation( lua_State* L, ModelAnimation modelAnimation );
void uluaPushRLRenderBatch( lua_State *L, rlRenderBatch renderBatch ); void uluaPushRLRenderBatch( lua_State* L, rlRenderBatch renderBatch );
/* Utils. */ /* Utils. */
int uluaGetTableLen( lua_State *L, int index ); int uluaGetTableLen( lua_State* L, int index );

View File

@@ -1,118 +1,118 @@
#pragma once #pragma once
/* Internals. */ /* Internals. */
void unloadMaterial( Material *material ); void unloadMaterial( Material* material );
/* Deleted from raylib. Need for freeing models. */ /* Deleted from raylib. Need for freeing models. */
void DrawBillboardProNoRatio( Camera camera, Texture2D texture, Rectangle source, Vector3 position, Vector3 up, Vector2 size, Vector2 origin, float rotation, Color tint ); void DrawBillboardProNoRatio( Camera camera, Texture2D texture, Rectangle source, Vector3 position, Vector3 up, Vector2 size, Vector2 origin, float rotation, Color tint );
void DrawBillboardRecNoRatio( Camera camera, Texture2D texture, Rectangle source, Vector3 position, Vector2 size, Color tint ); void DrawBillboardRecNoRatio( Camera camera, Texture2D texture, Rectangle source, Vector3 position, Vector2 size, Color tint );
/* Basic geometric 3D shapes drawing functions. */ /* Basic geometric 3D shapes drawing functions. */
int lmodelsDrawLine3D( lua_State *L ); int lmodelsDrawLine3D( lua_State* L );
int lmodelsDrawPoint3D( lua_State *L ); int lmodelsDrawPoint3D( lua_State* L );
int lmodelsDrawCircle3D( lua_State *L ); int lmodelsDrawCircle3D( lua_State* L );
int lmodelsDrawTriangle3D( lua_State *L ); int lmodelsDrawTriangle3D( lua_State* L );
int lmodelsDrawCube( lua_State *L ); int lmodelsDrawCube( lua_State* L );
int lmodelsDrawCubeWires( lua_State *L ); int lmodelsDrawCubeWires( lua_State* L );
int lmodelsDrawSphere( lua_State *L ); int lmodelsDrawSphere( lua_State* L );
int lmodelsDrawSphereEx( lua_State *L ); int lmodelsDrawSphereEx( lua_State* L );
int lmodelsDrawSphereWires( lua_State *L ); int lmodelsDrawSphereWires( lua_State* L );
int lmodelsDrawCylinder( lua_State *L ); int lmodelsDrawCylinder( lua_State* L );
int lmodelsDrawCylinderEx( lua_State *L ); int lmodelsDrawCylinderEx( lua_State* L );
int lmodelsDrawCylinderWires( lua_State *L ); int lmodelsDrawCylinderWires( lua_State* L );
int lmodelsDrawCylinderWiresEx( lua_State *L ); int lmodelsDrawCylinderWiresEx( lua_State* L );
int lmodelsDrawCapsule( lua_State *L ); int lmodelsDrawCapsule( lua_State* L );
int lmodelsDrawCapsuleWires( lua_State *L ); int lmodelsDrawCapsuleWires( lua_State* L );
int lmodelsDrawPlane( lua_State *L ); int lmodelsDrawPlane( lua_State* L );
int lmodelDrawQuad3DTexture( lua_State *L ); int lmodelDrawQuad3DTexture( lua_State* L );
int lmodelsDrawRay( lua_State *L ); int lmodelsDrawRay( lua_State* L );
int lmodelsDrawGrid( lua_State *L ); int lmodelsDrawGrid( lua_State* L );
/* Model management functions. */ /* Model management functions. */
int lmodelsLoadModel( lua_State *L ); int lmodelsLoadModel( lua_State* L );
int lmodelsLoadModelFromMesh( lua_State *L ); int lmodelsLoadModelFromMesh( lua_State* L );
int lmodelsIsModelReady( lua_State *L ); int lmodelsIsModelReady( lua_State* L );
int lmodelsUnloadModel( lua_State *L ); int lmodelsUnloadModel( lua_State* L );
int lmodelsGetModelBoundingBox( lua_State *L ); int lmodelsGetModelBoundingBox( lua_State* L );
int lmodelsSetModelTransform( lua_State *L ); int lmodelsSetModelTransform( lua_State* L );
int lmodelsSetModelMesh( lua_State *L ); int lmodelsSetModelMesh( lua_State* L );
int lmodelsSetModelMaterial( lua_State *L ); int lmodelsSetModelMaterial( lua_State* L );
int lmodelsSetModelMeshMaterial( lua_State *L ); int lmodelsSetModelMeshMaterial( lua_State* L );
int lmodelsSetModelBone( lua_State *L ); int lmodelsSetModelBone( lua_State* L );
int lmodelsSetModelBindPose( lua_State *L ); int lmodelsSetModelBindPose( lua_State* L );
int lmodelsGetModelTransform( lua_State *L ); int lmodelsGetModelTransform( lua_State* L );
int lmodelsGetModelMeshCount( lua_State *L ); int lmodelsGetModelMeshCount( lua_State* L );
int lmodelsGetModelMaterialCount( lua_State *L ); int lmodelsGetModelMaterialCount( lua_State* L );
int lmodelsGetModelMesh( lua_State *L ); int lmodelsGetModelMesh( lua_State* L );
int lmodelsGetModelMaterial( lua_State *L ); int lmodelsGetModelMaterial( lua_State* L );
int lmodelsGetModelBoneCount( lua_State *L ); int lmodelsGetModelBoneCount( lua_State* L );
int lmodelsGetModelBone( lua_State *L ); int lmodelsGetModelBone( lua_State* L );
int lmodelsGetModelBindPose( lua_State *L ); int lmodelsGetModelBindPose( lua_State* L );
/* Model drawing functions. */ /* Model drawing functions. */
int lmodelsDrawModel( lua_State *L ); int lmodelsDrawModel( lua_State* L );
int lmodelsDrawModelEx( lua_State *L ); int lmodelsDrawModelEx( lua_State* L );
int lmodelsDrawModelWires( lua_State *L ); int lmodelsDrawModelWires( lua_State* L );
int lmodelsDrawModelWiresEx( lua_State *L ); int lmodelsDrawModelWiresEx( lua_State* L );
int lmodelsDrawBoundingBox( lua_State *L ); int lmodelsDrawBoundingBox( lua_State* L );
int lmodelsDrawBillboard( lua_State *L ); int lmodelsDrawBillboard( lua_State* L );
int lmodelsDrawBillboardRec( lua_State *L ); int lmodelsDrawBillboardRec( lua_State* L );
int lmodelsDrawBillboardPro( lua_State *L ); int lmodelsDrawBillboardPro( lua_State* L );
/* Mesh management functions. */ /* Mesh management functions. */
int lmodelsUpdateMesh( lua_State *L ); int lmodelsUpdateMesh( lua_State* L );
int lmodelsUnloadMesh( lua_State *L ); int lmodelsUnloadMesh( lua_State* L );
int lmodelsDrawMesh( lua_State *L ); int lmodelsDrawMesh( lua_State* L );
int lmodelsDrawMeshInstanced( lua_State *L ); int lmodelsDrawMeshInstanced( lua_State* L );
int lmodelsSetMeshColor( lua_State *L ); int lmodelsSetMeshColor( lua_State* L );
int lmodelsExportMesh( lua_State *L ); int lmodelsExportMesh( lua_State* L );
int lmodelsGetMeshBoundingBox( lua_State *L ); int lmodelsGetMeshBoundingBox( lua_State* L );
int lmodelsGenMeshTangents( lua_State *L ); int lmodelsGenMeshTangents( lua_State* L );
/* Mesh generation functions. */ /* Mesh generation functions. */
int lmodelsGenMeshPoly( lua_State *L ); int lmodelsGenMeshPoly( lua_State* L );
int lmodelsGenMeshPlane( lua_State *L ); int lmodelsGenMeshPlane( lua_State* L );
int lmodelsGenMeshCube( lua_State *L ); int lmodelsGenMeshCube( lua_State* L );
int lmodelsGenMeshSphere( lua_State *L ); int lmodelsGenMeshSphere( lua_State* L );
int lmodelsGenMeshCylinder( lua_State *L ); int lmodelsGenMeshCylinder( lua_State* L );
int lmodelsGenMeshCone( lua_State *L ); int lmodelsGenMeshCone( lua_State* L );
int lmodelsGenMeshTorus( lua_State *L ); int lmodelsGenMeshTorus( lua_State* L );
int lmodelsGenMeshKnot( lua_State *L ); int lmodelsGenMeshKnot( lua_State* L );
int lmodelsGenMeshHeightmap( lua_State *L ); int lmodelsGenMeshHeightmap( lua_State* L );
int lmodelsGenMeshCubicmap( lua_State *L ); int lmodelsGenMeshCubicmap( lua_State* L );
int lmodelsGenMeshCustom( lua_State *L ); int lmodelsGenMeshCustom( lua_State* L );
/* Material management functions. */ /* Material management functions. */
int lmodelsLoadMaterials( lua_State *L ); int lmodelsLoadMaterials( lua_State* L );
int lmodelsGetMaterialDefault( lua_State *L ); int lmodelsGetMaterialDefault( lua_State* L );
int lmodelsLoadMaterialDefault( lua_State *L ); int lmodelsLoadMaterialDefault( lua_State* L );
int lmodelsCreateMaterial( lua_State *L ); int lmodelsCreateMaterial( lua_State* L );
int lmodelsIsMaterialReady( lua_State *L ); int lmodelsIsMaterialReady( lua_State* L );
int lmodelsUnloadMaterial( lua_State *L ); int lmodelsUnloadMaterial( lua_State* L );
int lmodelsSetMaterialTexture( lua_State *L ); int lmodelsSetMaterialTexture( lua_State* L );
int lmodelsSetMaterialColor( lua_State *L ); int lmodelsSetMaterialColor( lua_State* L );
int lmodelsSetMaterialValue( lua_State *L ); int lmodelsSetMaterialValue( lua_State* L );
int lmodelsSetMaterialShader( lua_State *L ); int lmodelsSetMaterialShader( lua_State* L );
int lmodelsSetMaterialParams( lua_State *L ); int lmodelsSetMaterialParams( lua_State* L );
int lmodelsGetMaterialTexture( lua_State *L ); int lmodelsGetMaterialTexture( lua_State* L );
int lmodelsGetMaterialColor( lua_State *L ); int lmodelsGetMaterialColor( lua_State* L );
int lmodelsGetMaterialValue( lua_State *L ); int lmodelsGetMaterialValue( lua_State* L );
int lmodelsGetMaterialShader( lua_State *L ); int lmodelsGetMaterialShader( lua_State* L );
int lmodelsGetMaterialParams( lua_State *L ); int lmodelsGetMaterialParams( lua_State* L );
/* Model animations management functions. */ /* Model animations management functions. */
int lmodelsLoadModelAnimations( lua_State *L ); int lmodelsLoadModelAnimations( lua_State* L );
int lmodelsUpdateModelAnimation( lua_State *L ); int lmodelsUpdateModelAnimation( lua_State* L );
int lmodelsUnloadModelAnimation( lua_State *L ); int lmodelsUnloadModelAnimation( lua_State* L );
int lmodelsUnloadModelAnimations( lua_State *L ); int lmodelsUnloadModelAnimations( lua_State* L );
int lmodelsIsModelAnimationValid( lua_State *L ); int lmodelsIsModelAnimationValid( lua_State* L );
int lmodelsSetModelAnimationBone( lua_State *L ); int lmodelsSetModelAnimationBone( lua_State* L );
int lmodelsSetModelAnimationFramePose( lua_State *L ); int lmodelsSetModelAnimationFramePose( lua_State* L );
int lmodelsSetModelAnimationName( lua_State *L ); int lmodelsSetModelAnimationName( lua_State* L );
int lmodelsGetModelAnimationBoneCount( lua_State *L ); int lmodelsGetModelAnimationBoneCount( lua_State* L );
int lmodelsGetModelAnimationFrameCount( lua_State *L ); int lmodelsGetModelAnimationFrameCount( lua_State* L );
int lmodelsGetModelAnimationBone( lua_State *L ); int lmodelsGetModelAnimationBone( lua_State* L );
int lmodelsGetModelAnimationFramePose( lua_State *L ); int lmodelsGetModelAnimationFramePose( lua_State* L );
int lmodelsGetModelAnimationName( lua_State *L ); int lmodelsGetModelAnimationName( lua_State* L );
/* Collision detection functions. */ /* Collision detection functions. */
int lmodelsCheckCollisionSpheres( lua_State *L ); int lmodelsCheckCollisionSpheres( lua_State* L );
int lmodelsCheckCollisionBoxes( lua_State *L ); int lmodelsCheckCollisionBoxes( lua_State* L );
int lmodelsCheckCollisionBoxSphere( lua_State *L ); int lmodelsCheckCollisionBoxSphere( lua_State* L );
int lmodelsGetRayCollisionSphere( lua_State *L ); int lmodelsGetRayCollisionSphere( lua_State* L );
int lmodelsGetRayCollisionBox( lua_State *L ); int lmodelsGetRayCollisionBox( lua_State* L );
int lmodelsGetRayCollisionMesh( lua_State *L ); int lmodelsGetRayCollisionMesh( lua_State* L );
int lmodelsGetRayCollisionTriangle( lua_State *L ); int lmodelsGetRayCollisionTriangle( lua_State* L );
int lmodelsGetRayCollisionQuad( lua_State *L ); int lmodelsGetRayCollisionQuad( lua_State* L );

View File

@@ -6,7 +6,7 @@
// typedef struct { // typedef struct {
// int SDL_eventQueueLen; // int SDL_eventQueueLen;
// SDL_Event **SDL_eventQueue; // SDL_Event** SDL_eventQueue;
// } SDL_State; // } SDL_State;
// extern SDL_State *SDL_state; // extern SDL_State *SDL_state;

View File

@@ -1,44 +1,44 @@
#pragma once #pragma once
/* Linear Easing functions. */ /* Linear Easing functions. */
int leasingsEaseLinear( lua_State *L ); int leasingsEaseLinear( lua_State* L );
/* Sine Easing functions. */ /* Sine Easing functions. */
int leasingsEaseSineIn( lua_State *L ); int leasingsEaseSineIn( lua_State* L );
int leasingsEaseSineOut( lua_State *L ); int leasingsEaseSineOut( lua_State* L );
int leasingsEaseSineInOut( lua_State *L ); int leasingsEaseSineInOut( lua_State* L );
/* Circular Easing functions. */ /* Circular Easing functions. */
int leasingsEaseCircIn( lua_State *L ); int leasingsEaseCircIn( lua_State* L );
int leasingsEaseCircOut( lua_State *L ); int leasingsEaseCircOut( lua_State* L );
int leasingsEaseCircInOut( lua_State *L ); int leasingsEaseCircInOut( lua_State* L );
/* Cubic Easing functions. */ /* Cubic Easing functions. */
int leasingsEaseCubicIn( lua_State *L ); int leasingsEaseCubicIn( lua_State* L );
int leasingsEaseCubicOut( lua_State *L ); int leasingsEaseCubicOut( lua_State* L );
int leasingsEaseCubicInOut( lua_State *L ); int leasingsEaseCubicInOut( lua_State* L );
/* Quadratic Easing functions. */ /* Quadratic Easing functions. */
int leasingsEaseQuadIn( lua_State *L ); int leasingsEaseQuadIn( lua_State* L );
int leasingsEaseQuadOut( lua_State *L ); int leasingsEaseQuadOut( lua_State* L );
int leasingsEaseQuadInOut( lua_State *L ); int leasingsEaseQuadInOut( lua_State* L );
/* Exponential Easing functions. */ /* Exponential Easing functions. */
int leasingsEaseExpoIn( lua_State *L ); int leasingsEaseExpoIn( lua_State* L );
int leasingsEaseExpoOut( lua_State *L ); int leasingsEaseExpoOut( lua_State* L );
int leasingsEaseExpoInOut( lua_State *L ); int leasingsEaseExpoInOut( lua_State* L );
/* Back Easing functions. */ /* Back Easing functions. */
int leasingsEaseBackIn( lua_State *L ); int leasingsEaseBackIn( lua_State* L );
int leasingsEaseBackOut( lua_State *L ); int leasingsEaseBackOut( lua_State* L );
int leasingsEaseBackInOut( lua_State *L ); int leasingsEaseBackInOut( lua_State* L );
/* Bounce Easing functions. */ /* Bounce Easing functions. */
int leasingsEaseBounceIn( lua_State *L ); int leasingsEaseBounceIn( lua_State* L );
int leasingsEaseBounceOut( lua_State *L ); int leasingsEaseBounceOut( lua_State* L );
int leasingsEaseBounceInOut( lua_State *L ); int leasingsEaseBounceInOut( lua_State* L );
/* Elastic Easing functions. */ /* Elastic Easing functions. */
int leasingsEaseElasticIn( lua_State *L ); int leasingsEaseElasticIn( lua_State* L );
int leasingsEaseElasticOut( lua_State *L ); int leasingsEaseElasticOut( lua_State* L );
int leasingsEaseElasticInOut( lua_State *L ); int leasingsEaseElasticInOut( lua_State* L );

View File

@@ -1,68 +1,68 @@
#pragma once #pragma once
/* Global gui state control functions. */ /* Global gui state control functions. */
int lguiGuiEnable( lua_State *L ); int lguiGuiEnable( lua_State* L );
int lguiGuiDisable( lua_State *L ); int lguiGuiDisable( lua_State* L );
int lguiGuiLock( lua_State *L ); int lguiGuiLock( lua_State* L );
int lguiGuiUnlock( lua_State *L ); int lguiGuiUnlock( lua_State* L );
int lguiGuiIsLocked( lua_State *L ); int lguiGuiIsLocked( lua_State* L );
int lguiGuiSetAlpha( lua_State *L ); int lguiGuiSetAlpha( lua_State* L );
int lguiGuiSetState( lua_State *L ); int lguiGuiSetState( lua_State* L );
int lguiGuiGetState( lua_State *L ); int lguiGuiGetState( lua_State* L );
/* Font set/get functions. */ /* Font set/get functions. */
int lguiGuiSetFont( lua_State *L ); int lguiGuiSetFont( lua_State* L );
int lguiGuiGetFont( lua_State *L ); int lguiGuiGetFont( lua_State* L );
/* Style set/get functions. */ /* Style set/get functions. */
int lguiGuiSetStyle( lua_State *L ); int lguiGuiSetStyle( lua_State* L );
int lguiGuiGetStyle( lua_State *L ); int lguiGuiGetStyle( lua_State* L );
/* Styles loading functions. */ /* Styles loading functions. */
int lguiGuiLoadStyle( lua_State *L ); int lguiGuiLoadStyle( lua_State* L );
int lguiGuiLoadStyleDefault( lua_State *L ); int lguiGuiLoadStyleDefault( lua_State* L );
/* Tooltips management functions. */ /* Tooltips management functions. */
int lguiGuiEnableTooltip( lua_State *L ); int lguiGuiEnableTooltip( lua_State* L );
int lguiGuiDisableTooltip( lua_State *L ); int lguiGuiDisableTooltip( lua_State* L );
int lguiGuiSetTooltip( lua_State *L ); int lguiGuiSetTooltip( lua_State* L );
/* Icons functionality. */ /* Icons functionality. */
int lguiGuiIconText( lua_State *L ); int lguiGuiIconText( lua_State* L );
int lguiGuiSetIconScale( lua_State *L ); int lguiGuiSetIconScale( lua_State* L );
int lguiGuiGetIcons( lua_State *L ); int lguiGuiGetIcons( lua_State* L );
int lguiGuiLoadIcons( lua_State *L ); int lguiGuiLoadIcons( lua_State* L );
int lguiGuiDrawIcon( lua_State *L ); int lguiGuiDrawIcon( lua_State* L );
/* Container/separator controls, useful for controls organization. */ /* Container/separator controls, useful for controls organization. */
int lguiGuiWindowBox( lua_State *L ); int lguiGuiWindowBox( lua_State* L );
int lguiGuiGroupBox( lua_State *L ); int lguiGuiGroupBox( lua_State* L );
int lguiGuiLine( lua_State *L ); int lguiGuiLine( lua_State* L );
int lguiGuiPanel( lua_State *L ); int lguiGuiPanel( lua_State* L );
int lguiGuiTabBar( lua_State *L ); int lguiGuiTabBar( lua_State* L );
int lguiGuiScrollPanel( lua_State *L ); int lguiGuiScrollPanel( lua_State* L );
/* Basic controls set. */ /* Basic controls set. */
int lguiGuiLabel( lua_State *L ); int lguiGuiLabel( lua_State* L );
int lguiGuiButton( lua_State *L ); int lguiGuiButton( lua_State* L );
int lguiGuiLabelButton( lua_State *L ); int lguiGuiLabelButton( lua_State* L );
int lguiGuiToggle( lua_State *L ); int lguiGuiToggle( lua_State* L );
int lguiGuiToggleGroup( lua_State *L ); int lguiGuiToggleGroup( lua_State* L );
int lguiGuiToggleSlider( lua_State *L ); int lguiGuiToggleSlider( lua_State* L );
int lguiGuiCheckBox( lua_State *L ); int lguiGuiCheckBox( lua_State* L );
int lguiGuiComboBox( lua_State *L ); int lguiGuiComboBox( lua_State* L );
int lguiGuiDropdownBox( lua_State *L ); int lguiGuiDropdownBox( lua_State* L );
int lguiGuiSpinner( lua_State *L ); int lguiGuiSpinner( lua_State* L );
int lguiGuiValueBox( lua_State *L ); int lguiGuiValueBox( lua_State* L );
int lguiGuiTextBox( lua_State *L ); int lguiGuiTextBox( lua_State* L );
int lguiGuiSlider( lua_State *L ); int lguiGuiSlider( lua_State* L );
int lguiGuiSliderBar( lua_State *L ); int lguiGuiSliderBar( lua_State* L );
int lguiGuiProgressBar( lua_State *L ); int lguiGuiProgressBar( lua_State* L );
int lguiGuiStatusBar( lua_State *L ); int lguiGuiStatusBar( lua_State* L );
int lguiGuiDummyRec( lua_State *L ); int lguiGuiDummyRec( lua_State* L );
int lguiGuiGrid( lua_State *L ); int lguiGuiGrid( lua_State* L );
int lguiGuiScrollBar( lua_State *L ); int lguiGuiScrollBar( lua_State* L );
/* Advance controls set. */ /* Advance controls set. */
int lguiGuiListView( lua_State *L ); int lguiGuiListView( lua_State* L );
int lguiGuiListViewEx( lua_State *L ); int lguiGuiListViewEx( lua_State* L );
int lguiGuiMessageBox( lua_State *L ); int lguiGuiMessageBox( lua_State* L );
int lguiGuiTextInputBox( lua_State *L ); int lguiGuiTextInputBox( lua_State* L );
int lguiGuiColorPicker( lua_State *L ); int lguiGuiColorPicker( lua_State* L );
int lguiGuiColorPanel( lua_State *L ); int lguiGuiColorPanel( lua_State* L );
int lguiGuiColorBarAlpha( lua_State *L ); int lguiGuiColorBarAlpha( lua_State* L );
int lguiGuiColorBarHue( lua_State *L ); int lguiGuiColorBarHue( lua_State* L );
int lguiGuiColorPickerHSV( lua_State *L ); int lguiGuiColorPickerHSV( lua_State* L );
int lguiGuiColorPanelHSV( lua_State *L ); int lguiGuiColorPanelHSV( lua_State* L );

View File

@@ -4,117 +4,117 @@ int imin( int a, int b );
int imax( int a, int b ); int imax( int a, int b );
/* Utils. */ /* Utils. */
int lmathClamp( lua_State *L ); int lmathClamp( lua_State* L );
int lmathLerp( lua_State *L ); int lmathLerp( lua_State* L );
int lmathNormalize( lua_State *L ); int lmathNormalize( lua_State* L );
int lmathRemap( lua_State *L ); int lmathRemap( lua_State* L );
int lmathWrap( lua_State *L ); int lmathWrap( lua_State* L );
int lmathFloatEquals( lua_State *L ); int lmathFloatEquals( lua_State* L );
/* Vector2. */ /* Vector2. */
int lmathVector2Zero( lua_State *L ); int lmathVector2Zero( lua_State* L );
int lmathVector2One( lua_State *L ); int lmathVector2One( lua_State* L );
int lmathVector2Add( lua_State *L ); int lmathVector2Add( lua_State* L );
int lmathVector2AddValue( lua_State *L ); int lmathVector2AddValue( lua_State* L );
int lmathVector2Subtract( lua_State *L ); int lmathVector2Subtract( lua_State* L );
int lmathVector2SubtractValue( lua_State *L ); int lmathVector2SubtractValue( lua_State* L );
int lmathVector2Length( lua_State *L ); int lmathVector2Length( lua_State* L );
int lmathVector2LengthSqr( lua_State *L ); int lmathVector2LengthSqr( lua_State* L );
int lmathVector2DotProduct( lua_State *L ); int lmathVector2DotProduct( lua_State* L );
int lmathVector2Distance( lua_State *L ); int lmathVector2Distance( lua_State* L );
int lmathVector2DistanceSqr( lua_State *L ); int lmathVector2DistanceSqr( lua_State* L );
int lmathVector2Angle( lua_State *L ); int lmathVector2Angle( lua_State* L );
int lmathVector2LineAngle( lua_State *L ); int lmathVector2LineAngle( lua_State* L );
int lmathVector2Scale( lua_State *L ); int lmathVector2Scale( lua_State* L );
int lmathVector2Multiply( lua_State *L ); int lmathVector2Multiply( lua_State* L );
int lmathVector2Negate( lua_State *L ); int lmathVector2Negate( lua_State* L );
int lmathVector2Divide( lua_State *L ); int lmathVector2Divide( lua_State* L );
int lmathVector2Normalize( lua_State *L ); int lmathVector2Normalize( lua_State* L );
int lmathVector2Transform( lua_State *L ); int lmathVector2Transform( lua_State* L );
int lmathVector2Lerp( lua_State *L ); int lmathVector2Lerp( lua_State* L );
int lmathVector2Reflect( lua_State *L ); int lmathVector2Reflect( lua_State* L );
int lmathVector2Rotate( lua_State *L ); int lmathVector2Rotate( lua_State* L );
int lmathVector2MoveTowards( lua_State *L ); int lmathVector2MoveTowards( lua_State* L );
int lmathVector2Invert( lua_State *L ); int lmathVector2Invert( lua_State* L );
int lmathVector2Clamp( lua_State *L ); int lmathVector2Clamp( lua_State* L );
int lmathVector2ClampValue( lua_State *L ); int lmathVector2ClampValue( lua_State* L );
int lmathVector2Equals( lua_State *L ); int lmathVector2Equals( lua_State* L );
/* Vector3. */ /* Vector3. */
int lmathVector3Zero( lua_State *L ); int lmathVector3Zero( lua_State* L );
int lmathVector3One( lua_State *L ); int lmathVector3One( lua_State* L );
int lmathVector3Add( lua_State *L ); int lmathVector3Add( lua_State* L );
int lmathVector3AddValue( lua_State *L ); int lmathVector3AddValue( lua_State* L );
int lmathVector3Subtract( lua_State *L ); int lmathVector3Subtract( lua_State* L );
int lmathVector3SubtractValue( lua_State *L ); int lmathVector3SubtractValue( lua_State* L );
int lmathVector3Scale( lua_State *L ); int lmathVector3Scale( lua_State* L );
int lmathVector3Multiply( lua_State *L ); int lmathVector3Multiply( lua_State* L );
int lmathVector3CrossProduct( lua_State *L ); int lmathVector3CrossProduct( lua_State* L );
int lmathVector3Perpendicular( lua_State *L ); int lmathVector3Perpendicular( lua_State* L );
int lmathVector3Length( lua_State *L ); int lmathVector3Length( lua_State* L );
int lmathVector3LengthSqr( lua_State *L ); int lmathVector3LengthSqr( lua_State* L );
int lmathVector3DotProduct( lua_State *L ); int lmathVector3DotProduct( lua_State* L );
int lmathVector3Distance( lua_State *L ); int lmathVector3Distance( lua_State* L );
int lmathVector3DistanceSqr( lua_State *L ); int lmathVector3DistanceSqr( lua_State* L );
int lmathVector3Angle( lua_State *L ); int lmathVector3Angle( lua_State* L );
int lmathVector3Negate( lua_State *L ); int lmathVector3Negate( lua_State* L );
int lmathVector3Divide( lua_State *L ); int lmathVector3Divide( lua_State* L );
int lmathVector3Normalize( lua_State *L ); int lmathVector3Normalize( lua_State* L );
int lmathVector3OrthoNormalize( lua_State *L ); int lmathVector3OrthoNormalize( lua_State* L );
int lmathVector3Transform( lua_State *L ); int lmathVector3Transform( lua_State* L );
int lmathVector3RotateByQuaternion( lua_State *L ); int lmathVector3RotateByQuaternion( lua_State* L );
int lmathVector3RotateByAxisAngle( lua_State *L ); int lmathVector3RotateByAxisAngle( lua_State* L );
int lmathVector3Lerp( lua_State *L ); int lmathVector3Lerp( lua_State* L );
int lmathVector3Reflect( lua_State *L ); int lmathVector3Reflect( lua_State* L );
int lmathVector3Min( lua_State *L ); int lmathVector3Min( lua_State* L );
int lmathVector3Max( lua_State *L ); int lmathVector3Max( lua_State* L );
int lmathVector3Barycenter( lua_State *L ); int lmathVector3Barycenter( lua_State* L );
int lmathVector3Unproject( lua_State *L ); int lmathVector3Unproject( lua_State* L );
int lmathVector3Invert( lua_State *L ); int lmathVector3Invert( lua_State* L );
int lmathVector3Clamp( lua_State *L ); int lmathVector3Clamp( lua_State* L );
int lmathVector3ClampValue( lua_State *L ); int lmathVector3ClampValue( lua_State* L );
int lmathVector3Equals( lua_State *L ); int lmathVector3Equals( lua_State* L );
int lmathVector3Refract( lua_State *L ); int lmathVector3Refract( lua_State* L );
/* Matrix. */ /* Matrix. */
int lmathMatrixDeterminant( lua_State *L ); int lmathMatrixDeterminant( lua_State* L );
int lmathMatrixTrace( lua_State *L ); int lmathMatrixTrace( lua_State* L );
int lmathMatrixTranspose( lua_State *L ); int lmathMatrixTranspose( lua_State* L );
int lmathMatrixInvert( lua_State *L ); int lmathMatrixInvert( lua_State* L );
int lmathMatrixIdentity( lua_State *L ); int lmathMatrixIdentity( lua_State* L );
int lmathMatrixAdd( lua_State *L ); int lmathMatrixAdd( lua_State* L );
int lmathMatrixSubtract( lua_State *L ); int lmathMatrixSubtract( lua_State* L );
int lmathMatrixMultiply( lua_State *L ); int lmathMatrixMultiply( lua_State* L );
int lmathMatrixTranslate( lua_State *L ); int lmathMatrixTranslate( lua_State* L );
int lmathMatrixRotate( lua_State *L ); int lmathMatrixRotate( lua_State* L );
int lmathMatrixRotateX( lua_State *L ); int lmathMatrixRotateX( lua_State* L );
int lmathMatrixRotateY( lua_State *L ); int lmathMatrixRotateY( lua_State* L );
int lmathMatrixRotateZ( lua_State *L ); int lmathMatrixRotateZ( lua_State* L );
int lmathMatrixRotateXYZ( lua_State *L ); int lmathMatrixRotateXYZ( lua_State* L );
int lmathMatrixRotateZYX( lua_State *L ); int lmathMatrixRotateZYX( lua_State* L );
int lmathMatrixScale( lua_State *L ); int lmathMatrixScale( lua_State* L );
int lmathMatrixFrustum( lua_State *L ); int lmathMatrixFrustum( lua_State* L );
int lmathMatrixPerspective( lua_State *L ); int lmathMatrixPerspective( lua_State* L );
int lmathMatrixOrtho( lua_State *L ); int lmathMatrixOrtho( lua_State* L );
int lmathMatrixLookAt( lua_State *L ); int lmathMatrixLookAt( lua_State* L );
/* Quaternion. */ /* Quaternion. */
int lmathQuaternionAdd( lua_State *L ); int lmathQuaternionAdd( lua_State* L );
int lmathQuaternionAddValue( lua_State *L ); int lmathQuaternionAddValue( lua_State* L );
int lmathQuaternionSubtract( lua_State *L ); int lmathQuaternionSubtract( lua_State* L );
int lmathQuaternionSubtractValue( lua_State *L ); int lmathQuaternionSubtractValue( lua_State* L );
int lmathQuaternionIdentity( lua_State *L ); int lmathQuaternionIdentity( lua_State* L );
int lmathQuaternionLength( lua_State *L ); int lmathQuaternionLength( lua_State* L );
int lmathQuaternionNormalize( lua_State *L ); int lmathQuaternionNormalize( lua_State* L );
int lmathQuaternionInvert( lua_State *L ); int lmathQuaternionInvert( lua_State* L );
int lmathQuaternionMultiply( lua_State *L ); int lmathQuaternionMultiply( lua_State* L );
int lmathQuaternionScale( lua_State *L ); int lmathQuaternionScale( lua_State* L );
int lmathQuaternionDivide( lua_State *L ); int lmathQuaternionDivide( lua_State* L );
int lmathQuaternionLerp( lua_State *L ); int lmathQuaternionLerp( lua_State* L );
int lmathQuaternionNlerp( lua_State *L ); int lmathQuaternionNlerp( lua_State* L );
int lmathQuaternionSlerp( lua_State *L ); int lmathQuaternionSlerp( lua_State* L );
int lmathQuaternionFromVector3ToVector3( lua_State *L ); int lmathQuaternionFromVector3ToVector3( lua_State* L );
int lmathQuaternionFromMatrix( lua_State *L ); int lmathQuaternionFromMatrix( lua_State* L );
int lmathQuaternionToMatrix( lua_State *L ); int lmathQuaternionToMatrix( lua_State* L );
int lmathQuaternionFromAxisAngle( lua_State *L ); int lmathQuaternionFromAxisAngle( lua_State* L );
int lmathQuaternionToAxisAngle( lua_State *L ); int lmathQuaternionToAxisAngle( lua_State* L );
int lmathQuaternionFromEuler( lua_State *L ); int lmathQuaternionFromEuler( lua_State* L );
int lmathQuaternionToEuler( lua_State *L ); int lmathQuaternionToEuler( lua_State* L );
int lmathQuaternionTransform( lua_State *L ); int lmathQuaternionTransform( lua_State* L );
int lmathQuaternionEquals( lua_State *L ); int lmathQuaternionEquals( lua_State* L );

View File

@@ -1,61 +1,61 @@
#pragma once #pragma once
/* Basic shapes drawing functions. */ /* Basic shapes drawing functions. */
int lshapesSetShapesTexture( lua_State *L ); int lshapesSetShapesTexture( lua_State* L );
int lshapesDrawPixel( lua_State *L ); int lshapesDrawPixel( lua_State* L );
int lshapesDrawLine( lua_State *L ); int lshapesDrawLine( lua_State* L );
int lshapesDrawLineBezier( lua_State *L ); int lshapesDrawLineBezier( lua_State* L );
int lshapesDrawLineStrip( lua_State *L ); int lshapesDrawLineStrip( lua_State* L );
int lshapesDrawCircle( lua_State *L ); int lshapesDrawCircle( lua_State* L );
int lshapesDrawCircleSector( lua_State *L ); int lshapesDrawCircleSector( lua_State* L );
int lshapesDrawCircleSectorLines( lua_State *L ); int lshapesDrawCircleSectorLines( lua_State* L );
int lshapesDrawCircleGradient( lua_State *L ); int lshapesDrawCircleGradient( lua_State* L );
int lshapesDrawCircleLines( lua_State *L ); int lshapesDrawCircleLines( lua_State* L );
int lshapesDrawEllipse( lua_State *L ); int lshapesDrawEllipse( lua_State* L );
int lshapesDrawEllipseLines( lua_State *L ); int lshapesDrawEllipseLines( lua_State* L );
int lshapesDrawRing( lua_State *L ); int lshapesDrawRing( lua_State* L );
int lshapesDrawRingLines( lua_State *L ); int lshapesDrawRingLines( lua_State* L );
int lshapesDrawRectangle( lua_State *L ); int lshapesDrawRectangle( lua_State* L );
int lshapesDrawRectanglePro( lua_State *L ); int lshapesDrawRectanglePro( lua_State* L );
int lshapesDrawRectangleGradientV( lua_State *L ); int lshapesDrawRectangleGradientV( lua_State* L );
int lshapesDrawRectangleGradientH( lua_State *L ); int lshapesDrawRectangleGradientH( lua_State* L );
int lshapesDrawRectangleGradientEx( lua_State *L ); int lshapesDrawRectangleGradientEx( lua_State* L );
int lshapesDrawRectangleLines( lua_State *L ); int lshapesDrawRectangleLines( lua_State* L );
int lshapesDrawRectangleLinesEx( lua_State *L ); int lshapesDrawRectangleLinesEx( lua_State* L );
int lshapesDrawRectangleRounded( lua_State *L ); int lshapesDrawRectangleRounded( lua_State* L );
int lshapesDrawRectangleRoundedLines( lua_State *L ); int lshapesDrawRectangleRoundedLines( lua_State* L );
int lshapesDrawTriangle( lua_State *L ); int lshapesDrawTriangle( lua_State* L );
int lshapesDrawTriangleLines( lua_State *L ); int lshapesDrawTriangleLines( lua_State* L );
int lshapesDrawTriangleFan( lua_State *L ); int lshapesDrawTriangleFan( lua_State* L );
int lshapesDrawTriangleStrip( lua_State *L ); int lshapesDrawTriangleStrip( lua_State* L );
int lshapesDrawPoly( lua_State *L ); int lshapesDrawPoly( lua_State* L );
int lshapesDrawPolyLines( lua_State *L ); int lshapesDrawPolyLines( lua_State* L );
int lshapesDrawPolyLinesEx( lua_State *L ); int lshapesDrawPolyLinesEx( lua_State* L );
/* Splines drawing functions. */ /* Splines drawing functions. */
int lshapesDrawSplineLinear( lua_State *L ); int lshapesDrawSplineLinear( lua_State* L );
int lshapesDrawSplineBasis( lua_State *L ); int lshapesDrawSplineBasis( lua_State* L );
int lshapesDrawSplineCatmullRom( lua_State *L ); int lshapesDrawSplineCatmullRom( lua_State* L );
int lshapesDrawSplineBezierQuadratic( lua_State *L ); int lshapesDrawSplineBezierQuadratic( lua_State* L );
int lshapesDrawSplineBezierCubic( lua_State *L ); int lshapesDrawSplineBezierCubic( lua_State* L );
int lshapesDrawSplineSegmentLinear( lua_State *L ); int lshapesDrawSplineSegmentLinear( lua_State* L );
int lshapesDrawSplineSegmentBasis( lua_State *L ); int lshapesDrawSplineSegmentBasis( lua_State* L );
int lshapesDrawSplineSegmentCatmullRom( lua_State *L ); int lshapesDrawSplineSegmentCatmullRom( lua_State* L );
int lshapesDrawSplineSegmentBezierQuadratic( lua_State *L ); int lshapesDrawSplineSegmentBezierQuadratic( lua_State* L );
int lshapesDrawSplineSegmentBezierCubic( lua_State *L ); int lshapesDrawSplineSegmentBezierCubic( lua_State* L );
/* Basic Spline segment point evaluation functions, for a given t [0.0f .. 1.0f]. */ /* Basic Spline segment point evaluation functions, for a given t [0.0f .. 1.0f]. */
int lshapesGetSplinePointLinear( lua_State *L ); int lshapesGetSplinePointLinear( lua_State* L );
int lshapesGetSplinePointBasis( lua_State *L ); int lshapesGetSplinePointBasis( lua_State* L );
int lshapesGetSplinePointCatmullRom( lua_State *L ); int lshapesGetSplinePointCatmullRom( lua_State* L );
int lshapesGetSplinePointBezierQuad( lua_State *L ); int lshapesGetSplinePointBezierQuad( lua_State* L );
int lshapesGetSplinePointBezierCubic( lua_State *L ); int lshapesGetSplinePointBezierCubic( lua_State* L );
/* Basic shapes collision detection functions. */ /* Basic shapes collision detection functions. */
int lshapesCheckCollisionRecs( lua_State *L ); int lshapesCheckCollisionRecs( lua_State* L );
int lshapesCheckCollisionCircles( lua_State *L ); int lshapesCheckCollisionCircles( lua_State* L );
int lshapesCheckCollisionCircleRec( lua_State *L ); int lshapesCheckCollisionCircleRec( lua_State* L );
int lshapesCheckCollisionPointRec( lua_State *L ); int lshapesCheckCollisionPointRec( lua_State* L );
int lshapesCheckCollisionPointCircle( lua_State *L ); int lshapesCheckCollisionPointCircle( lua_State* L );
int lshapesCheckCollisionPointTriangle( lua_State *L ); int lshapesCheckCollisionPointTriangle( lua_State* L );
int lshapesCheckCollisionPointPoly( lua_State *L ); int lshapesCheckCollisionPointPoly( lua_State* L );
int lshapesCheckCollisionLines( lua_State *L ); int lshapesCheckCollisionLines( lua_State* L );
int lshapesCheckCollisionPointLine( lua_State *L ); int lshapesCheckCollisionPointLine( lua_State* L );
int lshapesGetCollisionRec( lua_State *L ); int lshapesGetCollisionRec( lua_State* L );

View File

@@ -5,17 +5,17 @@
#endif #endif
typedef struct { typedef struct {
char *exePath; char* exePath;
bool hasWindow; bool hasWindow;
bool run; bool run;
bool gcUnload; bool gcUnload;
lua_State *luaState; lua_State* luaState;
Vector2 resolution; Vector2 resolution;
int logLevelInvalid; int logLevelInvalid;
Font defaultFont; Font defaultFont;
Material defaultMaterial; Material defaultMaterial;
Texture defaultTexture; Texture defaultTexture;
int *RLGLcurrentShaderLocs; int* RLGLcurrentShaderLocs;
/* Events. */ /* Events. */
#ifdef PLATFORM_DESKTOP #ifdef PLATFORM_DESKTOP
/* Window events. */ /* Window events. */
@@ -38,12 +38,12 @@ typedef struct {
GLFWpentabletproximityfun glfwtabletProximityCallback; GLFWpentabletproximityfun glfwtabletProximityCallback;
#elif PLATFORM_DESKTOP_SDL #elif PLATFORM_DESKTOP_SDL
int SDL_eventQueueLen; int SDL_eventQueueLen;
SDL_Event *SDL_eventQueue; SDL_Event* SDL_eventQueue;
#endif #endif
} State; } State;
extern State *state; extern State *state;
bool stateInit( int argn, const char **argc, const char *exePath ); bool stateInit( int argn, const char** argc, const char* exePath );
void stateInitInterpret( int argn, const char **argc ); void stateInitInterpret( int argn, const char** argc );
void stateFree(); void stateFree();

View File

@@ -2,57 +2,57 @@
void unloadGlyphInfo( GlyphInfo *glyph ); void unloadGlyphInfo( GlyphInfo *glyph );
/* Font loading/unloading functions. */ /* Font loading/unloading functions. */
int ltextGetFontDefault( lua_State *L ); int ltextGetFontDefault( lua_State* L );
int ltextLoadFont( lua_State *L ); int ltextLoadFont( lua_State* L );
int ltextLoadFontEx( lua_State *L ); int ltextLoadFontEx( lua_State* L );
int ltextLoadFontFromImage( lua_State *L ); int ltextLoadFontFromImage( lua_State* L );
int ltextLoadFontFromMemory( lua_State *L ); int ltextLoadFontFromMemory( lua_State* L );
int ltextLoadFontFromData( lua_State *L ); int ltextLoadFontFromData( lua_State* L );
int ltextIsFontReady( lua_State *L ); int ltextIsFontReady( lua_State* L );
int ltextLoadFontData( lua_State *L ); int ltextLoadFontData( lua_State* L );
int ltextGenImageFontAtlas( lua_State *L ); int ltextGenImageFontAtlas( lua_State* L );
int ltextUnloadFont( lua_State *L ); int ltextUnloadFont( lua_State* L );
int ltextExportFontAsCode( lua_State *L ); int ltextExportFontAsCode( lua_State* L );
/* Text drawing functions. */ /* Text drawing functions. */
int ltextDrawFPS( lua_State *L ); int ltextDrawFPS( lua_State* L );
int ltextDrawText( lua_State *L ); int ltextDrawText( lua_State* L );
int ltextDrawTextEx( lua_State *L ); int ltextDrawTextEx( lua_State* L );
int ltextDrawTextPro( lua_State *L ); int ltextDrawTextPro( lua_State* L );
int ltextDrawTextCodepoint( lua_State *L ); int ltextDrawTextCodepoint( lua_State* L );
int ltextDrawTextCodepoints( lua_State *L ); int ltextDrawTextCodepoints( lua_State* L );
int ltextDrawTextBoxed( lua_State *L ); int ltextDrawTextBoxed( lua_State* L );
int ltextDrawTextBoxedTinted( lua_State *L ); int ltextDrawTextBoxedTinted( lua_State* L );
/* Text font info functions. */ /* Text font info functions. */
int ltextSetTextLineSpacing( lua_State *L ); int ltextSetTextLineSpacing( lua_State* L );
int ltextMeasureText( lua_State *L ); int ltextMeasureText( lua_State* L );
int ltextGetGlyphIndex( lua_State *L ); int ltextGetGlyphIndex( lua_State* L );
int ltextGetGlyphInfo( lua_State *L ); int ltextGetGlyphInfo( lua_State* L );
int ltextGetGlyphInfoByIndex( lua_State *L ); int ltextGetGlyphInfoByIndex( lua_State* L );
int ltextGetGlyphAtlasRec( lua_State *L ); int ltextGetGlyphAtlasRec( lua_State* L );
int ltextGetGlyphAtlasRecByIndex( lua_State *L ); int ltextGetGlyphAtlasRecByIndex( lua_State* L );
int ltextGetFontBaseSize( lua_State *L ); int ltextGetFontBaseSize( lua_State* L );
int ltextGetFontGlyphCount( lua_State *L ); int ltextGetFontGlyphCount( lua_State* L );
int ltextGetFontGlyphPadding( lua_State *L ); int ltextGetFontGlyphPadding( lua_State* L );
int ltextGetFontTexture( lua_State *L ); int ltextGetFontTexture( lua_State* L );
/* GlyphInfo management functions. */ /* GlyphInfo management functions. */
int ltextLoadGlyphInfo( lua_State *L ); int ltextLoadGlyphInfo( lua_State* L );
int ltextUnloadGlyphInfo( lua_State *L ); int ltextUnloadGlyphInfo( lua_State* L );
int ltextSetGlyphInfoValue( lua_State *L ); int ltextSetGlyphInfoValue( lua_State* L );
int ltextSetGlyphInfoOffset( lua_State *L ); int ltextSetGlyphInfoOffset( lua_State* L );
int ltextSetGlyphInfoAdvanceX( lua_State *L ); int ltextSetGlyphInfoAdvanceX( lua_State* L );
int ltextSetGlyphInfoImage( lua_State *L ); int ltextSetGlyphInfoImage( lua_State* L );
int ltextGetGlyphInfoValue( lua_State *L ); int ltextGetGlyphInfoValue( lua_State* L );
int ltextGetGlyphInfoOffset( lua_State *L ); int ltextGetGlyphInfoOffset( lua_State* L );
int ltextGetGlyphInfoAdvanceX( lua_State *L ); int ltextGetGlyphInfoAdvanceX( lua_State* L );
int ltextGetGlyphInfoImage( lua_State *L ); int ltextGetGlyphInfoImage( lua_State* L );
/* Text codepoints management functions (unicode characters). */ /* Text codepoints management functions (unicode characters). */
int ltextLoadUTF8( lua_State *L ); int ltextLoadUTF8( lua_State* L );
int ltextLoadCodepoints( lua_State *L ); int ltextLoadCodepoints( lua_State* L );
int ltextGetCodepointCount( lua_State *L ); int ltextGetCodepointCount( lua_State* L );
int ltextGetCodepoint( lua_State *L ); int ltextGetCodepoint( lua_State* L );
int ltextGetCodepointNext( lua_State *L ); int ltextGetCodepointNext( lua_State* L );
int ltextGetCodepointPrevious( lua_State *L ); int ltextGetCodepointPrevious( lua_State* L );
int ltextCodepointToUTF8( lua_State *L ); int ltextCodepointToUTF8( lua_State* L );
/* Text strings management functions (no UTF-8 strings, only byte chars) */ /* Text strings management functions (no UTF-8 strings, only byte chars) */
int ltextTextInsert( lua_State *L ); int ltextTextInsert( lua_State* L );
int ltextTextSplit( lua_State *L ); int ltextTextSplit( lua_State* L );

View File

@@ -1,120 +1,120 @@
#pragma once #pragma once
/* Image loading functions. */ /* Image loading functions. */
int ltexturesLoadImage( lua_State *L ); int ltexturesLoadImage( lua_State* L );
int ltexturesLoadImageRaw( lua_State *L ); int ltexturesLoadImageRaw( lua_State* L );
int ltexturesLoadImageSvg( lua_State *L ); int ltexturesLoadImageSvg( lua_State* L );
int ltexturesLoadImageAnim( lua_State *L ); int ltexturesLoadImageAnim( lua_State* L );
int ltexturesLoadImageFromMemory( lua_State *L ); int ltexturesLoadImageFromMemory( lua_State* L );
int ltexturesLoadImageFromData( lua_State *L ); int ltexturesLoadImageFromData( lua_State* L );
int ltexturesLoadImageFromTexture( lua_State *L ); int ltexturesLoadImageFromTexture( lua_State* L );
int ltexturesLoadImageFromScreen( lua_State *L ); int ltexturesLoadImageFromScreen( lua_State* L );
int ltextureIsImageReady( lua_State *L ); int ltextureIsImageReady( lua_State* L );
int ltextureUnloadImage( lua_State *L ); int ltextureUnloadImage( lua_State* L );
int ltexturesExportImage( lua_State *L ); int ltexturesExportImage( lua_State* L );
int ltexturesExportImageToMemory( lua_State *L ); int ltexturesExportImageToMemory( lua_State* L );
int ltexturesExportImageAsCode( lua_State *L ); int ltexturesExportImageAsCode( lua_State* L );
/* Image generation functions. */ /* Image generation functions. */
int ltexturesGenImageColor( lua_State *L ); int ltexturesGenImageColor( lua_State* L );
int ltexturesGenImageGradientLinear( lua_State *L ); int ltexturesGenImageGradientLinear( lua_State* L );
int ltexturesGenImageGradientRadial( lua_State *L ); int ltexturesGenImageGradientRadial( lua_State* L );
int ltexturesGenImageGradientSquare( lua_State *L ); int ltexturesGenImageGradientSquare( lua_State* L );
int ltexturesGenImageChecked( lua_State *L ); int ltexturesGenImageChecked( lua_State* L );
int ltexturesGenImageWhiteNoise( lua_State *L ); int ltexturesGenImageWhiteNoise( lua_State* L );
int ltexturesGenImagePerlinNoise( lua_State *L ); int ltexturesGenImagePerlinNoise( lua_State* L );
int ltexturesGenImageCellular( lua_State *L ); int ltexturesGenImageCellular( lua_State* L );
int ltexturesGenImageText( lua_State *L ); int ltexturesGenImageText( lua_State* L );
/* Image manipulation functions. */ /* Image manipulation functions. */
int ltexturesImageCopy( lua_State *L ); int ltexturesImageCopy( lua_State* L );
int ltexturesImageFromImage( lua_State *L ); int ltexturesImageFromImage( lua_State* L );
int ltexturesImageText( lua_State *L ); int ltexturesImageText( lua_State* L );
int ltexturesImageFormat( lua_State *L ); int ltexturesImageFormat( lua_State* L );
int ltexturesImageToPOT( lua_State *L ); int ltexturesImageToPOT( lua_State* L );
int ltexturesImageCrop( lua_State *L ); int ltexturesImageCrop( lua_State* L );
int ltexturesImageAlphaCrop( lua_State *L ); int ltexturesImageAlphaCrop( lua_State* L );
int ltexturesImageAlphaClear( lua_State *L ); int ltexturesImageAlphaClear( lua_State* L );
int ltexturesImageAlphaMask( lua_State *L ); int ltexturesImageAlphaMask( lua_State* L );
int ltexturesImageAlphaPremultiply( lua_State *L ); int ltexturesImageAlphaPremultiply( lua_State* L );
int ltexturesImageBlurGaussian( lua_State *L ); int ltexturesImageBlurGaussian( lua_State* L );
int ltexturesImageResize( lua_State *L ); int ltexturesImageResize( lua_State* L );
int ltexturesImageResizeNN( lua_State *L ); int ltexturesImageResizeNN( lua_State* L );
int ltexturesImageResizeCanvas( lua_State *L ); int ltexturesImageResizeCanvas( lua_State* L );
int ltexturesImageMipmaps( lua_State *L ); int ltexturesImageMipmaps( lua_State* L );
int ltexturesImageDither( lua_State *L ); int ltexturesImageDither( lua_State* L );
int ltexturesImageFlipVertical( lua_State *L ); int ltexturesImageFlipVertical( lua_State* L );
int ltexturesImageFlipHorizontal( lua_State *L ); int ltexturesImageFlipHorizontal( lua_State* L );
int ltexturesImageRotate( lua_State *L ); int ltexturesImageRotate( lua_State* L );
int ltexturesImageRotateCW( lua_State *L ); int ltexturesImageRotateCW( lua_State* L );
int ltexturesImageRotateCCW( lua_State *L ); int ltexturesImageRotateCCW( lua_State* L );
int ltexturesImageColorTint( lua_State *L ); int ltexturesImageColorTint( lua_State* L );
int ltexturesImageColorInvert( lua_State *L ); int ltexturesImageColorInvert( lua_State* L );
int ltexturesImageColorGrayscale( lua_State *L ); int ltexturesImageColorGrayscale( lua_State* L );
int ltexturesImageColorContrast( lua_State *L ); int ltexturesImageColorContrast( lua_State* L );
int ltexturesImageColorBrightness( lua_State *L ); int ltexturesImageColorBrightness( lua_State* L );
int ltexturesImageColorReplace( lua_State *L ); int ltexturesImageColorReplace( lua_State* L );
int ltexturesLoadImageColors( lua_State *L ); int ltexturesLoadImageColors( lua_State* L );
int ltexturesLoadImagePalette( lua_State *L ); int ltexturesLoadImagePalette( lua_State* L );
int ltexturesGetImageAlphaBorder( lua_State *L ); int ltexturesGetImageAlphaBorder( lua_State* L );
int ltexturesGetImageColor( lua_State *L ); int ltexturesGetImageColor( lua_State* L );
/* Image configuration functions. */ /* Image configuration functions. */
int ltexturesGetImageData( lua_State *L ); int ltexturesGetImageData( lua_State* L );
int ltexturesGetImageSize( lua_State *L ); int ltexturesGetImageSize( lua_State* L );
int ltexturesGetImageMipmaps( lua_State *L ); int ltexturesGetImageMipmaps( lua_State* L );
int ltexturesGetImageFormat( lua_State *L ); int ltexturesGetImageFormat( lua_State* L );
/* Image drawing functions. */ /* Image drawing functions. */
int ltexturesImageClearBackground( lua_State *L ); int ltexturesImageClearBackground( lua_State* L );
int ltexturesImageDrawPixel( lua_State *L ); int ltexturesImageDrawPixel( lua_State* L );
int ltexturesImageDrawLine( lua_State *L ); int ltexturesImageDrawLine( lua_State* L );
int ltexturesImageDrawCircle( lua_State *L ); int ltexturesImageDrawCircle( lua_State* L );
int ltexturesImageDrawCircleLines( lua_State *L ); int ltexturesImageDrawCircleLines( lua_State* L );
int ltexturesImageDrawRectangle( lua_State *L ); int ltexturesImageDrawRectangle( lua_State* L );
int ltexturesImageDrawRectangleLines( lua_State *L ); int ltexturesImageDrawRectangleLines( lua_State* L );
int ltexturesImageDraw( lua_State *L ); int ltexturesImageDraw( lua_State* L );
int ltexturesImageDrawTextEx( lua_State *L ); int ltexturesImageDrawTextEx( lua_State* L );
/* Texture loading functions. */ /* Texture loading functions. */
int ltexturesGetTextureDefault( lua_State *L ); int ltexturesGetTextureDefault( lua_State* L );
int ltexturesLoadTexture( lua_State *L ); int ltexturesLoadTexture( lua_State* L );
int ltexturesLoadTextureFromImage( lua_State *L ); int ltexturesLoadTextureFromImage( lua_State* L );
int ltexturesLoadTextureCubemap( lua_State *L ); int ltexturesLoadTextureCubemap( lua_State* L );
int ltexturesLoadTextureFromData( lua_State *L ); int ltexturesLoadTextureFromData( lua_State* L );
int ltexturesLoadRenderTexture( lua_State *L ); int ltexturesLoadRenderTexture( lua_State* L );
int ltexturesLoadRenderTextureFromData( lua_State *L ); int ltexturesLoadRenderTextureFromData( lua_State* L );
int ltexturesIsTextureReady( lua_State *L ); int ltexturesIsTextureReady( lua_State* L );
int ltextureUnloadTexture( lua_State *L ); int ltextureUnloadTexture( lua_State* L );
int ltexturesIsRenderTextureReady( lua_State *L ); int ltexturesIsRenderTextureReady( lua_State* L );
int ltextureUnloadRenderTexture( lua_State *L ); int ltextureUnloadRenderTexture( lua_State* L );
int ltexturesUpdateTexture( lua_State *L ); int ltexturesUpdateTexture( lua_State* L );
int ltexturesUpdateTextureRec( lua_State *L ); int ltexturesUpdateTextureRec( lua_State* L );
/* Texture configuration functions. */ /* Texture configuration functions. */
int ltexturesGenTextureMipmaps( lua_State *L ); int ltexturesGenTextureMipmaps( lua_State* L );
int ltexturesSetTextureFilter( lua_State *L ); int ltexturesSetTextureFilter( lua_State* L );
int ltexturesSetTextureWrap( lua_State *L ); int ltexturesSetTextureWrap( lua_State* L );
int ltexturesGetTextureId( lua_State *L ); int ltexturesGetTextureId( lua_State* L );
int ltexturesGetTextureSize( lua_State *L ); int ltexturesGetTextureSize( lua_State* L );
int ltexturesGetTextureMipmaps( lua_State *L ); int ltexturesGetTextureMipmaps( lua_State* L );
int ltexturesGetTextureFormat( lua_State *L ); int ltexturesGetTextureFormat( lua_State* L );
/* Texture drawing functions. */ /* Texture drawing functions. */
int ltexturesDrawTexture( lua_State *L ); int ltexturesDrawTexture( lua_State* L );
int ltexturesDrawTextureRec( lua_State *L ); int ltexturesDrawTextureRec( lua_State* L );
int ltexturesDrawTexturePro( lua_State *L ); int ltexturesDrawTexturePro( lua_State* L );
int ltexturesDrawTextureNPatch( lua_State *L ); int ltexturesDrawTextureNPatch( lua_State* L );
int ltexturesDrawTextureNPatchRepeat( lua_State *L ); int ltexturesDrawTextureNPatchRepeat( lua_State* L );
/* RenderTexture configuration functions. */ /* RenderTexture configuration functions. */
int ltexturesGetRenderTextureId( lua_State *L ); int ltexturesGetRenderTextureId( lua_State* L );
int ltexturesGetRenderTextureTexture( lua_State *L ); int ltexturesGetRenderTextureTexture( lua_State* L );
int ltexturesGetRenderTextureDepthTexture( lua_State *L ); int ltexturesGetRenderTextureDepthTexture( lua_State* L );
/* Color/pixel related functions. */ /* Color/pixel related functions. */
int ltexturesFade( lua_State *L ); int ltexturesFade( lua_State* L );
int ltexturesColorToInt( lua_State *L ); int ltexturesColorToInt( lua_State* L );
int ltexturesColorNormalize( lua_State *L ); int ltexturesColorNormalize( lua_State* L );
int ltexturesColorFromNormalized( lua_State *L ); int ltexturesColorFromNormalized( lua_State* L );
int ltexturesColorToHSV( lua_State *L ); int ltexturesColorToHSV( lua_State* L );
int ltexturesColorFromHSV( lua_State *L ); int ltexturesColorFromHSV( lua_State* L );
int ltexturesColorTint( lua_State *L ); int ltexturesColorTint( lua_State* L );
int ltexturesColorBrightness( lua_State *L ); int ltexturesColorBrightness( lua_State* L );
int ltexturesColorContrast( lua_State *L ); int ltexturesColorContrast( lua_State* L );
int ltexturesColorAlpha( lua_State *L ); int ltexturesColorAlpha( lua_State* L );
int ltexturesColorAlphaBlend( lua_State *L ); int ltexturesColorAlphaBlend( lua_State* L );
int ltexturesGetColor( lua_State *L ); int ltexturesGetColor( lua_State* L );
int ltexturesGetPixelColor( lua_State *L ); int ltexturesGetPixelColor( lua_State* L );
int ltexturesGetPixelDataSize( lua_State *L ); int ltexturesGetPixelDataSize( lua_State* L );

View File

@@ -12,7 +12,7 @@
Initialize audio device and context Initialize audio device and context
*/ */
int laudioInitAudioDevice( lua_State *L ) { int laudioInitAudioDevice( lua_State* L ) {
InitAudioDevice(); InitAudioDevice();
return 0; return 0;
@@ -23,7 +23,7 @@ int laudioInitAudioDevice( lua_State *L ) {
Close the audio device and context Close the audio device and context
*/ */
int laudioCloseAudioDevice( lua_State *L ) { int laudioCloseAudioDevice( lua_State* L ) {
CloseAudioDevice(); CloseAudioDevice();
return 0; return 0;
@@ -36,7 +36,7 @@ Check if audio device has been initialized successfully
- Success return bool - Success return bool
*/ */
int laudioIsAudioDeviceReady( lua_State *L ) { int laudioIsAudioDeviceReady( lua_State* L ) {
lua_pushboolean( L, IsAudioDeviceReady() ); lua_pushboolean( L, IsAudioDeviceReady() );
return 1; return 1;
@@ -47,7 +47,7 @@ int laudioIsAudioDeviceReady( lua_State *L ) {
Set master volume (listener) Set master volume (listener)
*/ */
int laudioSetMasterVolume( lua_State *L ) { int laudioSetMasterVolume( lua_State* L ) {
float volume = luaL_checknumber( L, 1 ); float volume = luaL_checknumber( L, 1 );
SetMasterVolume( volume ); SetMasterVolume( volume );
@@ -62,7 +62,7 @@ Get master volume (listener)
- Success return float - Success return float
*/ */
int laudioGetMasterVolume( lua_State *L ) { int laudioGetMasterVolume( lua_State* L ) {
lua_pushnumber( L, GetMasterVolume() ); lua_pushnumber( L, GetMasterVolume() );
return 1; return 1;
@@ -80,7 +80,7 @@ Load sound from file
- Failure return nil - Failure return nil
- Success return Sound - Success return Sound
*/ */
int laudioLoadSound( lua_State *L ) { int laudioLoadSound( lua_State* L ) {
if ( FileExists( luaL_checkstring( L, 1 ) ) ) { if ( FileExists( luaL_checkstring( L, 1 ) ) ) {
uluaPushSound( L, LoadSound( lua_tostring( L, 1 ) ) ); uluaPushSound( L, LoadSound( lua_tostring( L, 1 ) ) );
@@ -100,7 +100,7 @@ Load wave data from file
- Failure return nil - Failure return nil
- Success return Wave - Success return Wave
*/ */
int laudioLoadWave( lua_State *L ) { int laudioLoadWave( lua_State* L ) {
if ( FileExists( luaL_checkstring( L, 1 ) ) ) { if ( FileExists( luaL_checkstring( L, 1 ) ) ) {
uluaPushWave( L, LoadWave( lua_tostring( L, 1 ) ) ); uluaPushWave( L, LoadWave( lua_tostring( L, 1 ) ) );
@@ -119,7 +119,7 @@ Load wave from memory buffer, fileType refers to extension: i.e. '.wav'
- Success return Wave - Success return Wave
*/ */
int laudioLoadWaveFromMemory( lua_State *L ) { int laudioLoadWaveFromMemory( lua_State* L ) {
const char* fileType = luaL_checkstring( L, 1 ); const char* fileType = luaL_checkstring( L, 1 );
Buffer* buffer = uluaGetBuffer( L, 2 ); Buffer* buffer = uluaGetBuffer( L, 2 );
@@ -135,8 +135,8 @@ Checks if wave data is ready
- Success return bool - Success return bool
*/ */
int laudioIsWaveReady( lua_State *L ) { int laudioIsWaveReady( lua_State* L ) {
Wave *wave = uluaGetWave( L, 1 ); Wave* wave = uluaGetWave( L, 1 );
lua_pushboolean( L, IsWaveReady( *wave ) ); lua_pushboolean( L, IsWaveReady( *wave ) );
@@ -150,8 +150,8 @@ Load sound from wave data
- Success return Sound - Success return Sound
*/ */
int laudioLoadSoundFromWave( lua_State *L ) { int laudioLoadSoundFromWave( lua_State* L ) {
Wave *wave = uluaGetWave( L, 1 ); Wave* wave = uluaGetWave( L, 1 );
uluaPushSound( L, LoadSoundFromWave( *wave ) ); uluaPushSound( L, LoadSoundFromWave( *wave ) );
@@ -165,8 +165,8 @@ Create a new sound that shares the same sample data as the source sound, does no
- Success return Sound - Success return Sound
*/ */
int laudioLoadSoundAlias( lua_State *L ) { int laudioLoadSoundAlias( lua_State* L ) {
Sound *source = uluaGetSound( L, 1 ); Sound* source = uluaGetSound( L, 1 );
uluaPushSound( L, LoadSoundAlias( *source ) ); uluaPushSound( L, LoadSoundAlias( *source ) );
@@ -180,8 +180,8 @@ Checks if a sound is ready
- Success return bool - Success return bool
*/ */
int laudioIsSoundReady( lua_State *L ) { int laudioIsSoundReady( lua_State* L ) {
Sound *sound = uluaGetSound( L, 1 ); Sound* sound = uluaGetSound( L, 1 );
lua_pushboolean( L, IsSoundReady( *sound ) ); lua_pushboolean( L, IsSoundReady( *sound ) );
@@ -193,8 +193,8 @@ int laudioIsSoundReady( lua_State *L ) {
Unload wave data Unload wave data
*/ */
int laudioUnloadWave( lua_State *L ) { int laudioUnloadWave( lua_State* L ) {
Wave *wave = uluaGetWave( L, 1 ); Wave* wave = uluaGetWave( L, 1 );
UnloadWave( *wave ); UnloadWave( *wave );
@@ -206,8 +206,8 @@ int laudioUnloadWave( lua_State *L ) {
Unload sound Unload sound
*/ */
int laudioUnloadSound( lua_State *L ) { int laudioUnloadSound( lua_State* L ) {
Sound *sound = uluaGetSound( L, 1 ); Sound* sound = uluaGetSound( L, 1 );
UnloadSound( *sound ); UnloadSound( *sound );
@@ -219,8 +219,8 @@ int laudioUnloadSound( lua_State *L ) {
Unload a sound alias (does not deallocate sample data) Unload a sound alias (does not deallocate sample data)
*/ */
int laudioUnloadSoundAlias( lua_State *L ) { int laudioUnloadSoundAlias( lua_State* L ) {
Sound *alias = uluaGetSound( L, 1 ); Sound* alias = uluaGetSound( L, 1 );
UnloadSoundAlias( *alias ); UnloadSoundAlias( *alias );
@@ -234,8 +234,8 @@ Export wave data to file, returns true on success
- Success return bool - Success return bool
*/ */
int laudioExportWave( lua_State *L ) { int laudioExportWave( lua_State* L ) {
Wave *wave = uluaGetWave( L, 1 ); Wave* wave = uluaGetWave( L, 1 );
lua_pushboolean( L, ExportWave( *wave, luaL_checkstring( L, 2 ) ) ); lua_pushboolean( L, ExportWave( *wave, luaL_checkstring( L, 2 ) ) );
@@ -249,8 +249,8 @@ Export wave sample data to code (.h), returns true on success
- Success return true - Success return true
*/ */
int laudioExportWaveAsCode( lua_State *L ) { int laudioExportWaveAsCode( lua_State* L ) {
Wave *wave = uluaGetWave( L, 1 ); Wave* wave = uluaGetWave( L, 1 );
lua_pushboolean( L, ExportWaveAsCode( *wave, luaL_checkstring( L, 2 ) ) ); lua_pushboolean( L, ExportWaveAsCode( *wave, luaL_checkstring( L, 2 ) ) );
@@ -266,8 +266,8 @@ int laudioExportWaveAsCode( lua_State *L ) {
Play a sound Play a sound
*/ */
int laudioPlaySound( lua_State *L ) { int laudioPlaySound( lua_State* L ) {
Sound *sound = uluaGetSound( L, 1 ); Sound* sound = uluaGetSound( L, 1 );
PlaySound( *sound ); PlaySound( *sound );
@@ -279,8 +279,8 @@ int laudioPlaySound( lua_State *L ) {
Stop playing a sound Stop playing a sound
*/ */
int laudioStopSound( lua_State *L ) { int laudioStopSound( lua_State* L ) {
Sound *sound = uluaGetSound( L, 1 ); Sound* sound = uluaGetSound( L, 1 );
StopSound( *sound ); StopSound( *sound );
@@ -292,8 +292,8 @@ int laudioStopSound( lua_State *L ) {
Pause a sound Pause a sound
*/ */
int laudioPauseSound( lua_State *L ) { int laudioPauseSound( lua_State* L ) {
Sound *sound = uluaGetSound( L, 1 ); Sound* sound = uluaGetSound( L, 1 );
PauseSound( *sound ); PauseSound( *sound );
@@ -305,8 +305,8 @@ int laudioPauseSound( lua_State *L ) {
Resume a paused sound Resume a paused sound
*/ */
int laudioResumeSound( lua_State *L ) { int laudioResumeSound( lua_State* L ) {
Sound *sound = uluaGetSound( L, 1 ); Sound* sound = uluaGetSound( L, 1 );
ResumeSound( *sound ); ResumeSound( *sound );
@@ -320,8 +320,8 @@ Check if a sound is currently playing
- Success return bool - Success return bool
*/ */
int laudioIsSoundPlaying( lua_State *L ) { int laudioIsSoundPlaying( lua_State* L ) {
Sound *sound = uluaGetSound( L, 1 ); Sound* sound = uluaGetSound( L, 1 );
lua_pushboolean( L, IsSoundPlaying( *sound ) ); lua_pushboolean( L, IsSoundPlaying( *sound ) );
@@ -333,8 +333,8 @@ int laudioIsSoundPlaying( lua_State *L ) {
Set volume for a sound (1.0 is max level) Set volume for a sound (1.0 is max level)
*/ */
int laudioSetSoundVolume( lua_State *L ) { int laudioSetSoundVolume( lua_State* L ) {
Sound *sound = uluaGetSound( L, 1 ); Sound* sound = uluaGetSound( L, 1 );
float volume = luaL_checknumber( L, 2 ); float volume = luaL_checknumber( L, 2 );
SetSoundVolume( *sound, volume ); SetSoundVolume( *sound, volume );
@@ -347,8 +347,8 @@ int laudioSetSoundVolume( lua_State *L ) {
Set pitch for a sound (1.0 is base level) Set pitch for a sound (1.0 is base level)
*/ */
int laudioSetSoundPitch( lua_State *L ) { int laudioSetSoundPitch( lua_State* L ) {
Sound *sound = uluaGetSound( L, 1 ); Sound* sound = uluaGetSound( L, 1 );
float pitch = luaL_checknumber( L, 2 ); float pitch = luaL_checknumber( L, 2 );
SetSoundPitch( *sound, pitch ); SetSoundPitch( *sound, pitch );
@@ -361,8 +361,8 @@ int laudioSetSoundPitch( lua_State *L ) {
Set pan for a sound (0.5 is center) Set pan for a sound (0.5 is center)
*/ */
int laudioSetSoundPan( lua_State *L ) { int laudioSetSoundPan( lua_State* L ) {
Sound *sound = uluaGetSound( L, 1 ); Sound* sound = uluaGetSound( L, 1 );
float pan = luaL_checknumber( L, 2 ); float pan = luaL_checknumber( L, 2 );
SetSoundPan( *sound, pan ); SetSoundPan( *sound, pan );
@@ -375,8 +375,8 @@ int laudioSetSoundPan( lua_State *L ) {
Convert wave data to desired format Convert wave data to desired format
*/ */
int laudioWaveFormat( lua_State *L ) { int laudioWaveFormat( lua_State* L ) {
Wave *wave = uluaGetWave( L, 1 ); Wave* wave = uluaGetWave( L, 1 );
int sampleRate = luaL_checkinteger( L, 2 ); int sampleRate = luaL_checkinteger( L, 2 );
int sampleSize = luaL_checkinteger( L, 3 ); int sampleSize = luaL_checkinteger( L, 3 );
int channels = luaL_checkinteger( L, 4 ); int channels = luaL_checkinteger( L, 4 );
@@ -393,8 +393,8 @@ Copy a wave to a new wave
- Success return Wave - Success return Wave
*/ */
int laudioWaveCopy( lua_State *L ) { int laudioWaveCopy( lua_State* L ) {
Wave *wave = uluaGetWave( L, 1 ); Wave* wave = uluaGetWave( L, 1 );
uluaPushWave( L, WaveCopy( *wave ) ); uluaPushWave( L, WaveCopy( *wave ) );
@@ -406,8 +406,8 @@ int laudioWaveCopy( lua_State *L ) {
Crop a wave to defined samples range Crop a wave to defined samples range
*/ */
int laudioWaveCrop( lua_State *L ) { int laudioWaveCrop( lua_State* L ) {
Wave *wave = uluaGetWave( L, 1 ); Wave* wave = uluaGetWave( L, 1 );
int initSample = luaL_checkinteger( L, 2 ); int initSample = luaL_checkinteger( L, 2 );
int finalSample = luaL_checkinteger( L, 3 ); int finalSample = luaL_checkinteger( L, 3 );
@@ -427,7 +427,7 @@ Load music stream from file
- Success return Music - Success return Music
*/ */
int laudioLoadMusicStream( lua_State *L ) { int laudioLoadMusicStream( lua_State* L ) {
if ( FileExists( luaL_checkstring( L, 1 ) ) ) { if ( FileExists( luaL_checkstring( L, 1 ) ) ) {
uluaPushMusic( L, LoadMusicStream( lua_tostring( L, 1 ) ) ); uluaPushMusic( L, LoadMusicStream( lua_tostring( L, 1 ) ) );
@@ -462,8 +462,8 @@ Checks if a music stream is ready
- Success return bool - Success return bool
*/ */
int laudioIsMusicReady( lua_State *L ) { int laudioIsMusicReady( lua_State* L ) {
Music *music = uluaGetMusic( L, 1 ); Music* music = uluaGetMusic( L, 1 );
lua_pushboolean( L, IsMusicReady( *music ) ); lua_pushboolean( L, IsMusicReady( *music ) );
@@ -475,8 +475,8 @@ int laudioIsMusicReady( lua_State *L ) {
Unload music stream Unload music stream
*/ */
int laudioUnloadMusicStream( lua_State *L ) { int laudioUnloadMusicStream( lua_State* L ) {
Music *music = uluaGetMusic( L, 1 ); Music* music = uluaGetMusic( L, 1 );
UnloadMusicStream( *music ); UnloadMusicStream( *music );
@@ -488,8 +488,8 @@ int laudioUnloadMusicStream( lua_State *L ) {
Start music playing Start music playing
*/ */
int laudioPlayMusicStream( lua_State *L ) { int laudioPlayMusicStream( lua_State* L ) {
Music *music = uluaGetMusic( L, 1 ); Music* music = uluaGetMusic( L, 1 );
PlayMusicStream( *music ); PlayMusicStream( *music );
@@ -503,8 +503,8 @@ Check if music is playing
- Success return bool - Success return bool
*/ */
int laudioIsMusicStreamPlaying( lua_State *L ) { int laudioIsMusicStreamPlaying( lua_State* L ) {
Music *music = uluaGetMusic( L, 1 ); Music* music = uluaGetMusic( L, 1 );
lua_pushboolean( L, IsMusicStreamPlaying( *music ) ); lua_pushboolean( L, IsMusicStreamPlaying( *music ) );
@@ -516,8 +516,8 @@ int laudioIsMusicStreamPlaying( lua_State *L ) {
Updates buffers for music streaming Updates buffers for music streaming
*/ */
int laudioUpdateMusicStream( lua_State *L ) { int laudioUpdateMusicStream( lua_State* L ) {
Music *music = uluaGetMusic( L, 1 ); Music* music = uluaGetMusic( L, 1 );
UpdateMusicStream( *music ); UpdateMusicStream( *music );
@@ -529,8 +529,8 @@ int laudioUpdateMusicStream( lua_State *L ) {
Stop music playing Stop music playing
*/ */
int laudioStopMusicStream( lua_State *L ) { int laudioStopMusicStream( lua_State* L ) {
Music *music = uluaGetMusic( L, 1 ); Music* music = uluaGetMusic( L, 1 );
StopMusicStream( *music ); StopMusicStream( *music );
@@ -542,8 +542,8 @@ int laudioStopMusicStream( lua_State *L ) {
Pause music playing Pause music playing
*/ */
int laudioPauseMusicStream( lua_State *L ) { int laudioPauseMusicStream( lua_State* L ) {
Music *music = uluaGetMusic( L, 1 ); Music* music = uluaGetMusic( L, 1 );
PauseMusicStream( *music ); PauseMusicStream( *music );
@@ -555,8 +555,8 @@ int laudioPauseMusicStream( lua_State *L ) {
Resume playing paused music Resume playing paused music
*/ */
int laudioResumeMusicStream( lua_State *L ) { int laudioResumeMusicStream( lua_State* L ) {
Music *music = uluaGetMusic( L, 1 ); Music* music = uluaGetMusic( L, 1 );
ResumeMusicStream( *music ); ResumeMusicStream( *music );
@@ -568,8 +568,8 @@ int laudioResumeMusicStream( lua_State *L ) {
Seek music to a position (in seconds) Seek music to a position (in seconds)
*/ */
int laudioSeekMusicStream( lua_State *L ) { int laudioSeekMusicStream( lua_State* L ) {
Music *music = uluaGetMusic( L, 1 ); Music* music = uluaGetMusic( L, 1 );
float position = luaL_checknumber( L, 2 ); float position = luaL_checknumber( L, 2 );
SeekMusicStream( *music, position ); SeekMusicStream( *music, position );
@@ -582,8 +582,8 @@ int laudioSeekMusicStream( lua_State *L ) {
Set volume for music (1.0 is max level) Set volume for music (1.0 is max level)
*/ */
int laudioSetMusicVolume( lua_State *L ) { int laudioSetMusicVolume( lua_State* L ) {
Music *music = uluaGetMusic( L, 1 ); Music* music = uluaGetMusic( L, 1 );
float volume = luaL_checknumber( L, 2 ); float volume = luaL_checknumber( L, 2 );
SetMusicVolume( *music, volume ); SetMusicVolume( *music, volume );
@@ -596,8 +596,8 @@ int laudioSetMusicVolume( lua_State *L ) {
Set pitch for a music (1.0 is base level) Set pitch for a music (1.0 is base level)
*/ */
int laudioSetMusicPitch( lua_State *L ) { int laudioSetMusicPitch( lua_State* L ) {
Music *music = uluaGetMusic( L, 1 ); Music* music = uluaGetMusic( L, 1 );
float pitch = luaL_checknumber( L, 2 ); float pitch = luaL_checknumber( L, 2 );
SetMusicPitch( *music, pitch ); SetMusicPitch( *music, pitch );
@@ -610,8 +610,8 @@ int laudioSetMusicPitch( lua_State *L ) {
Set pan for a music (0.5 is center) Set pan for a music (0.5 is center)
*/ */
int laudioSetMusicPan( lua_State *L ) { int laudioSetMusicPan( lua_State* L ) {
Music *music = uluaGetMusic( L, 1 ); Music* music = uluaGetMusic( L, 1 );
float pan = luaL_checknumber( L, 2 ); float pan = luaL_checknumber( L, 2 );
SetMusicPitch( *music, pan ); SetMusicPitch( *music, pan );
@@ -624,8 +624,8 @@ int laudioSetMusicPan( lua_State *L ) {
Set looping for a music Set looping for a music
*/ */
int laudioSetMusicLooping( lua_State *L ) { int laudioSetMusicLooping( lua_State* L ) {
Music *music = uluaGetMusic( L, 1 ); Music* music = uluaGetMusic( L, 1 );
bool looping = uluaGetBoolean( L, 2 ); bool looping = uluaGetBoolean( L, 2 );
music->looping = looping; music->looping = looping;
@@ -640,8 +640,8 @@ Get looping of a music
- Success return bool - Success return bool
*/ */
int laudioGetMusicLooping( lua_State *L ) { int laudioGetMusicLooping( lua_State* L ) {
Music *music = uluaGetMusic( L, 1 ); Music* music = uluaGetMusic( L, 1 );
lua_pushboolean( L, music->looping ); lua_pushboolean( L, music->looping );
@@ -655,8 +655,8 @@ Get music time length (in seconds)
- Success return float - Success return float
*/ */
int laudioGetMusicTimeLength( lua_State *L ) { int laudioGetMusicTimeLength( lua_State* L ) {
Music *music = uluaGetMusic( L, 1 ); Music* music = uluaGetMusic( L, 1 );
lua_pushnumber( L, GetMusicTimeLength( *music ) ); lua_pushnumber( L, GetMusicTimeLength( *music ) );
@@ -670,8 +670,8 @@ Get current music time played (in seconds)
- Success return float - Success return float
*/ */
int laudioGetMusicTimePlayed( lua_State *L ) { int laudioGetMusicTimePlayed( lua_State* L ) {
Music *music = uluaGetMusic( L, 1 ); Music* music = uluaGetMusic( L, 1 );
lua_pushnumber( L, GetMusicTimePlayed( *music ) ); lua_pushnumber( L, GetMusicTimePlayed( *music ) );

File diff suppressed because it is too large Load Diff

View File

@@ -15,7 +15,7 @@ Ease linear
- Success return float - Success return float
*/ */
int leasingsEaseLinear( lua_State *L ) { int leasingsEaseLinear( lua_State* L ) {
float t = luaL_checknumber( L, 1 ); float t = luaL_checknumber( L, 1 );
float b = luaL_checknumber( L, 2 ); float b = luaL_checknumber( L, 2 );
float c = luaL_checknumber( L, 3 ); float c = luaL_checknumber( L, 3 );
@@ -37,7 +37,7 @@ Ease sine in
- Success return float - Success return float
*/ */
int leasingsEaseSineIn( lua_State *L ) { int leasingsEaseSineIn( lua_State* L ) {
float t = luaL_checknumber( L, 1 ); float t = luaL_checknumber( L, 1 );
float b = luaL_checknumber( L, 2 ); float b = luaL_checknumber( L, 2 );
float c = luaL_checknumber( L, 3 ); float c = luaL_checknumber( L, 3 );
@@ -55,7 +55,7 @@ Ease sine out
- Success return float - Success return float
*/ */
int leasingsEaseSineOut( lua_State *L ) { int leasingsEaseSineOut( lua_State* L ) {
float t = luaL_checknumber( L, 1 ); float t = luaL_checknumber( L, 1 );
float b = luaL_checknumber( L, 2 ); float b = luaL_checknumber( L, 2 );
float c = luaL_checknumber( L, 3 ); float c = luaL_checknumber( L, 3 );
@@ -73,7 +73,7 @@ Ease sine in out
- Success return float - Success return float
*/ */
int leasingsEaseSineInOut( lua_State *L ) { int leasingsEaseSineInOut( lua_State* L ) {
float t = luaL_checknumber( L, 1 ); float t = luaL_checknumber( L, 1 );
float b = luaL_checknumber( L, 2 ); float b = luaL_checknumber( L, 2 );
float c = luaL_checknumber( L, 3 ); float c = luaL_checknumber( L, 3 );
@@ -95,7 +95,7 @@ Ease circle in
- Success return float - Success return float
*/ */
int leasingsEaseCircIn( lua_State *L ) { int leasingsEaseCircIn( lua_State* L ) {
float t = luaL_checknumber( L, 1 ); float t = luaL_checknumber( L, 1 );
float b = luaL_checknumber( L, 2 ); float b = luaL_checknumber( L, 2 );
float c = luaL_checknumber( L, 3 ); float c = luaL_checknumber( L, 3 );
@@ -113,7 +113,7 @@ Ease circle out
- Success return float - Success return float
*/ */
int leasingsEaseCircOut( lua_State *L ) { int leasingsEaseCircOut( lua_State* L ) {
float t = luaL_checknumber( L, 1 ); float t = luaL_checknumber( L, 1 );
float b = luaL_checknumber( L, 2 ); float b = luaL_checknumber( L, 2 );
float c = luaL_checknumber( L, 3 ); float c = luaL_checknumber( L, 3 );
@@ -131,7 +131,7 @@ Ease circle in out
- Success return float - Success return float
*/ */
int leasingsEaseCircInOut( lua_State *L ) { int leasingsEaseCircInOut( lua_State* L ) {
float t = luaL_checknumber( L, 1 ); float t = luaL_checknumber( L, 1 );
float b = luaL_checknumber( L, 2 ); float b = luaL_checknumber( L, 2 );
float c = luaL_checknumber( L, 3 ); float c = luaL_checknumber( L, 3 );
@@ -153,7 +153,7 @@ Ease cubic in
- Success return float - Success return float
*/ */
int leasingsEaseCubicIn( lua_State *L ) { int leasingsEaseCubicIn( lua_State* L ) {
float t = luaL_checknumber( L, 1 ); float t = luaL_checknumber( L, 1 );
float b = luaL_checknumber( L, 2 ); float b = luaL_checknumber( L, 2 );
float c = luaL_checknumber( L, 3 ); float c = luaL_checknumber( L, 3 );
@@ -171,7 +171,7 @@ Ease cubic out
- Success return float - Success return float
*/ */
int leasingsEaseCubicOut( lua_State *L ) { int leasingsEaseCubicOut( lua_State* L ) {
float t = luaL_checknumber( L, 1 ); float t = luaL_checknumber( L, 1 );
float b = luaL_checknumber( L, 2 ); float b = luaL_checknumber( L, 2 );
float c = luaL_checknumber( L, 3 ); float c = luaL_checknumber( L, 3 );
@@ -189,7 +189,7 @@ Ease cubic in out
- Success return float - Success return float
*/ */
int leasingsEaseCubicInOut( lua_State *L ) { int leasingsEaseCubicInOut( lua_State* L ) {
float t = luaL_checknumber( L, 1 ); float t = luaL_checknumber( L, 1 );
float b = luaL_checknumber( L, 2 ); float b = luaL_checknumber( L, 2 );
float c = luaL_checknumber( L, 3 ); float c = luaL_checknumber( L, 3 );
@@ -211,7 +211,7 @@ Ease quadratic in
- Success return float - Success return float
*/ */
int leasingsEaseQuadIn( lua_State *L ) { int leasingsEaseQuadIn( lua_State* L ) {
float t = luaL_checknumber( L, 1 ); float t = luaL_checknumber( L, 1 );
float b = luaL_checknumber( L, 2 ); float b = luaL_checknumber( L, 2 );
float c = luaL_checknumber( L, 3 ); float c = luaL_checknumber( L, 3 );
@@ -229,7 +229,7 @@ Ease quadratic out
- Success return float - Success return float
*/ */
int leasingsEaseQuadOut( lua_State *L ) { int leasingsEaseQuadOut( lua_State* L ) {
float t = luaL_checknumber( L, 1 ); float t = luaL_checknumber( L, 1 );
float b = luaL_checknumber( L, 2 ); float b = luaL_checknumber( L, 2 );
float c = luaL_checknumber( L, 3 ); float c = luaL_checknumber( L, 3 );
@@ -247,7 +247,7 @@ Ease quadratic in out
- Success return float - Success return float
*/ */
int leasingsEaseQuadInOut( lua_State *L ) { int leasingsEaseQuadInOut( lua_State* L ) {
float t = luaL_checknumber( L, 1 ); float t = luaL_checknumber( L, 1 );
float b = luaL_checknumber( L, 2 ); float b = luaL_checknumber( L, 2 );
float c = luaL_checknumber( L, 3 ); float c = luaL_checknumber( L, 3 );
@@ -269,7 +269,7 @@ Ease exponential in
- Success return float - Success return float
*/ */
int leasingsEaseExpoIn( lua_State *L ) { int leasingsEaseExpoIn( lua_State* L ) {
float t = luaL_checknumber( L, 1 ); float t = luaL_checknumber( L, 1 );
float b = luaL_checknumber( L, 2 ); float b = luaL_checknumber( L, 2 );
float c = luaL_checknumber( L, 3 ); float c = luaL_checknumber( L, 3 );
@@ -287,7 +287,7 @@ Ease exponential out
- Success return float - Success return float
*/ */
int leasingsEaseExpoOut( lua_State *L ) { int leasingsEaseExpoOut( lua_State* L ) {
float t = luaL_checknumber( L, 1 ); float t = luaL_checknumber( L, 1 );
float b = luaL_checknumber( L, 2 ); float b = luaL_checknumber( L, 2 );
float c = luaL_checknumber( L, 3 ); float c = luaL_checknumber( L, 3 );
@@ -305,7 +305,7 @@ Ease exponential in out
- Success return float - Success return float
*/ */
int leasingsEaseExpoInOut( lua_State *L ) { int leasingsEaseExpoInOut( lua_State* L ) {
float t = luaL_checknumber( L, 1 ); float t = luaL_checknumber( L, 1 );
float b = luaL_checknumber( L, 2 ); float b = luaL_checknumber( L, 2 );
float c = luaL_checknumber( L, 3 ); float c = luaL_checknumber( L, 3 );
@@ -327,7 +327,7 @@ Ease back in
- Success return float - Success return float
*/ */
int leasingsEaseBackIn( lua_State *L ) { int leasingsEaseBackIn( lua_State* L ) {
float t = luaL_checknumber( L, 1 ); float t = luaL_checknumber( L, 1 );
float b = luaL_checknumber( L, 2 ); float b = luaL_checknumber( L, 2 );
float c = luaL_checknumber( L, 3 ); float c = luaL_checknumber( L, 3 );
@@ -345,7 +345,7 @@ Ease back out
- Success return float - Success return float
*/ */
int leasingsEaseBackOut( lua_State *L ) { int leasingsEaseBackOut( lua_State* L ) {
float t = luaL_checknumber( L, 1 ); float t = luaL_checknumber( L, 1 );
float b = luaL_checknumber( L, 2 ); float b = luaL_checknumber( L, 2 );
float c = luaL_checknumber( L, 3 ); float c = luaL_checknumber( L, 3 );
@@ -363,7 +363,7 @@ Ease back in out
- Success return float - Success return float
*/ */
int leasingsEaseBackInOut( lua_State *L ) { int leasingsEaseBackInOut( lua_State* L ) {
float t = luaL_checknumber( L, 1 ); float t = luaL_checknumber( L, 1 );
float b = luaL_checknumber( L, 2 ); float b = luaL_checknumber( L, 2 );
float c = luaL_checknumber( L, 3 ); float c = luaL_checknumber( L, 3 );
@@ -385,7 +385,7 @@ Ease bounce in
- Success return float - Success return float
*/ */
int leasingsEaseBounceIn( lua_State *L ) { int leasingsEaseBounceIn( lua_State* L ) {
float t = luaL_checknumber( L, 1 ); float t = luaL_checknumber( L, 1 );
float b = luaL_checknumber( L, 2 ); float b = luaL_checknumber( L, 2 );
float c = luaL_checknumber( L, 3 ); float c = luaL_checknumber( L, 3 );
@@ -403,7 +403,7 @@ Ease bounce out
- Success return float - Success return float
*/ */
int leasingsEaseBounceOut( lua_State *L ) { int leasingsEaseBounceOut( lua_State* L ) {
float t = luaL_checknumber( L, 1 ); float t = luaL_checknumber( L, 1 );
float b = luaL_checknumber( L, 2 ); float b = luaL_checknumber( L, 2 );
float c = luaL_checknumber( L, 3 ); float c = luaL_checknumber( L, 3 );
@@ -421,7 +421,7 @@ Ease bounce in out
- Success return float - Success return float
*/ */
int leasingsEaseBounceInOut( lua_State *L ) { int leasingsEaseBounceInOut( lua_State* L ) {
float t = luaL_checknumber( L, 1 ); float t = luaL_checknumber( L, 1 );
float b = luaL_checknumber( L, 2 ); float b = luaL_checknumber( L, 2 );
float c = luaL_checknumber( L, 3 ); float c = luaL_checknumber( L, 3 );
@@ -443,7 +443,7 @@ Ease elastic in
- Success return float - Success return float
*/ */
int leasingsEaseElasticIn( lua_State *L ) { int leasingsEaseElasticIn( lua_State* L ) {
float t = luaL_checknumber( L, 1 ); float t = luaL_checknumber( L, 1 );
float b = luaL_checknumber( L, 2 ); float b = luaL_checknumber( L, 2 );
float c = luaL_checknumber( L, 3 ); float c = luaL_checknumber( L, 3 );
@@ -461,7 +461,7 @@ Ease elastic out
- Success return float - Success return float
*/ */
int leasingsEaseElasticOut( lua_State *L ) { int leasingsEaseElasticOut( lua_State* L ) {
float t = luaL_checknumber( L, 1 ); float t = luaL_checknumber( L, 1 );
float b = luaL_checknumber( L, 2 ); float b = luaL_checknumber( L, 2 );
float c = luaL_checknumber( L, 3 ); float c = luaL_checknumber( L, 3 );
@@ -479,7 +479,7 @@ Ease elastic in out
- Success return float - Success return float
*/ */
int leasingsEaseElasticInOut( lua_State *L ) { int leasingsEaseElasticInOut( lua_State* L ) {
float t = luaL_checknumber( L, 1 ); float t = luaL_checknumber( L, 1 );
float b = luaL_checknumber( L, 2 ); float b = luaL_checknumber( L, 2 );
float c = luaL_checknumber( L, 3 ); float c = luaL_checknumber( L, 3 );

View File

@@ -14,7 +14,7 @@
Copy a block of pixels from one framebuffer object to another. Copy a block of pixels from one framebuffer object to another.
Use -1 RenderTexture for window framebuffer Use -1 RenderTexture for window framebuffer
*/ */
int lglBlitFramebuffer( lua_State *L ) { int lglBlitFramebuffer( lua_State* L ) {
#if defined( PLATFORM_DESKTOP ) || defined( PLATFORM_DESKTOP_SDL ) #if defined( PLATFORM_DESKTOP ) || defined( PLATFORM_DESKTOP_SDL )
if ( !( lua_isuserdata( L, 1 ) || lua_isnil( L, 1 ) ) || !( lua_isuserdata( L, 2 ) || lua_isnil( L, 2 ) ) ) { if ( !( lua_isuserdata( L, 1 ) || lua_isnil( L, 1 ) ) || !( lua_isuserdata( L, 2 ) || lua_isnil( L, 2 ) ) ) {
TraceLog( state->logLevelInvalid, "%s", "Argument needs to be RenderTexture or nil" ); TraceLog( state->logLevelInvalid, "%s", "Argument needs to be RenderTexture or nil" );
@@ -30,7 +30,7 @@ int lglBlitFramebuffer( lua_State *L ) {
glBindFramebuffer( GL_READ_FRAMEBUFFER, 0 ); glBindFramebuffer( GL_READ_FRAMEBUFFER, 0 );
} }
else { else {
RenderTexture *srcTex = uluaGetRenderTexture( L, 1 ); RenderTexture* srcTex = uluaGetRenderTexture( L, 1 );
glBindFramebuffer( GL_READ_FRAMEBUFFER, srcTex->id ); glBindFramebuffer( GL_READ_FRAMEBUFFER, srcTex->id );
} }
@@ -38,7 +38,7 @@ int lglBlitFramebuffer( lua_State *L ) {
glBindFramebuffer( GL_DRAW_FRAMEBUFFER, 0 ); glBindFramebuffer( GL_DRAW_FRAMEBUFFER, 0 );
} }
else { else {
RenderTexture *dstTex = uluaGetRenderTexture( L, 2 ); RenderTexture* dstTex = uluaGetRenderTexture( L, 2 );
glBindFramebuffer( GL_DRAW_FRAMEBUFFER, dstTex->id ); glBindFramebuffer( GL_DRAW_FRAMEBUFFER, dstTex->id );
} }

View File

@@ -18,12 +18,12 @@ Create a light and get shader locations
- Success return Light - Success return Light
*/ */
int llightsCreateLight( lua_State *L ) { int llightsCreateLight( lua_State* L ) {
int type = luaL_checkinteger( L, 1 ); int type = luaL_checkinteger( L, 1 );
Vector3 position = uluaGetVector3( L, 2 ); Vector3 position = uluaGetVector3( L, 2 );
Vector3 target = uluaGetVector3( L, 3 ); Vector3 target = uluaGetVector3( L, 3 );
Color color = uluaGetColor( L, 4 ); Color color = uluaGetColor( L, 4 );
Shader *shader = uluaGetShader( L, 5 ); Shader* shader = uluaGetShader( L, 5 );
uluaPushLight( L, CreateLight( type, position, target, color, *shader ) ); uluaPushLight( L, CreateLight( type, position, target, color, *shader ) );
@@ -35,9 +35,9 @@ int llightsCreateLight( lua_State *L ) {
Send light properties to shader Send light properties to shader
*/ */
int llightsUpdateLightValues( lua_State *L ) { int llightsUpdateLightValues( lua_State* L ) {
Shader *shader = uluaGetShader( L, 1 ); Shader* shader = uluaGetShader( L, 1 );
Light *light = uluaGetLight( L, 2 ); Light* light = uluaGetLight( L, 2 );
UpdateLightValues( *shader, *light ); UpdateLightValues( *shader, *light );
@@ -49,8 +49,8 @@ int llightsUpdateLightValues( lua_State *L ) {
Set light type Set light type
*/ */
int llightsSetLightType( lua_State *L ) { int llightsSetLightType( lua_State* L ) {
Light *light = uluaGetLight( L, 1 ); Light* light = uluaGetLight( L, 1 );
int type = luaL_checkinteger( L, 2 ); int type = luaL_checkinteger( L, 2 );
light->type = type; light->type = type;
@@ -63,8 +63,8 @@ int llightsSetLightType( lua_State *L ) {
Set light position Set light position
*/ */
int llightsSetLightPosition( lua_State *L ) { int llightsSetLightPosition( lua_State* L ) {
Light *light = uluaGetLight( L, 1 ); Light* light = uluaGetLight( L, 1 );
Vector3 position = uluaGetVector3( L, 2 ); Vector3 position = uluaGetVector3( L, 2 );
light->position = position; light->position = position;
@@ -77,8 +77,8 @@ int llightsSetLightPosition( lua_State *L ) {
Set light target Set light target
*/ */
int llightsSetLightTarget( lua_State *L ) { int llightsSetLightTarget( lua_State* L ) {
Light *light = uluaGetLight( L, 1 ); Light* light = uluaGetLight( L, 1 );
Vector3 target = uluaGetVector3( L, 2 ); Vector3 target = uluaGetVector3( L, 2 );
light->target = target; light->target = target;
@@ -91,8 +91,8 @@ int llightsSetLightTarget( lua_State *L ) {
Set light color Set light color
*/ */
int llightsSetLightColor( lua_State *L ) { int llightsSetLightColor( lua_State* L ) {
Light *light = uluaGetLight( L, 1 ); Light* light = uluaGetLight( L, 1 );
Color color = uluaGetColor( L, 2 ); Color color = uluaGetColor( L, 2 );
light->color = color; light->color = color;
@@ -105,8 +105,8 @@ int llightsSetLightColor( lua_State *L ) {
Set light enabled Set light enabled
*/ */
int llightsSetLightEnabled( lua_State *L ) { int llightsSetLightEnabled( lua_State* L ) {
Light *light = uluaGetLight( L, 1 ); Light* light = uluaGetLight( L, 1 );
bool enabled = uluaGetBoolean( L, 2 ); bool enabled = uluaGetBoolean( L, 2 );
light->enabled = enabled; light->enabled = enabled;
@@ -121,8 +121,8 @@ Get light type
- Success return int - Success return int
*/ */
int llightsGetLightType( lua_State *L ) { int llightsGetLightType( lua_State* L ) {
Light *light = uluaGetLight( L, 1 ); Light* light = uluaGetLight( L, 1 );
lua_pushinteger( L, light->type ); lua_pushinteger( L, light->type );
@@ -136,8 +136,8 @@ Get light position
- Success return Vector3 - Success return Vector3
*/ */
int llightsGetLightPosition( lua_State *L ) { int llightsGetLightPosition( lua_State* L ) {
Light *light = uluaGetLight( L, 1 ); Light* light = uluaGetLight( L, 1 );
uluaPushVector3( L, light->position ); uluaPushVector3( L, light->position );
@@ -151,8 +151,8 @@ Get light target
- Success return Vector3 - Success return Vector3
*/ */
int llightsGetLightTarget( lua_State *L ) { int llightsGetLightTarget( lua_State* L ) {
Light *light = uluaGetLight( L, 1 ); Light* light = uluaGetLight( L, 1 );
uluaPushVector3( L, light->target ); uluaPushVector3( L, light->target );
@@ -166,8 +166,8 @@ Get light color
- Success return Color - Success return Color
*/ */
int llightsGetLightColor( lua_State *L ) { int llightsGetLightColor( lua_State* L ) {
Light *light = uluaGetLight( L, 1 ); Light* light = uluaGetLight( L, 1 );
uluaPushColor( L, light->color ); uluaPushColor( L, light->color );
@@ -181,8 +181,8 @@ Get light enabled
- Success return bool - Success return bool
*/ */
int llightsIsLightEnabled( lua_State *L ) { int llightsIsLightEnabled( lua_State* L ) {
Light *light = uluaGetLight( L, 1 ); Light* light = uluaGetLight( L, 1 );
lua_pushboolean( L, light->enabled ); lua_pushboolean( L, light->enabled );

View File

@@ -25,16 +25,16 @@
/* Define types. */ /* Define types. */
/* Buffer. */ /* Buffer. */
static int gcBuffer( lua_State *L ) { static int gcBuffer( lua_State* L ) {
if ( state->gcUnload ) { if ( state->gcUnload ) {
Buffer *buffer = luaL_checkudata( L, 1, "Buffer" ); Buffer* buffer = luaL_checkudata( L, 1, "Buffer" );
unloadBuffer( buffer ); unloadBuffer( buffer );
} }
return 0; return 0;
} }
static void defineBuffer() { static void defineBuffer() {
lua_State *L = state->luaState; lua_State* L = state->luaState;
luaL_newmetatable( L, "Buffer" ); luaL_newmetatable( L, "Buffer" );
lua_pushvalue( L, -1 ); lua_pushvalue( L, -1 );
@@ -44,16 +44,16 @@ static void defineBuffer() {
} }
/* Image */ /* Image */
static int gcImage( lua_State *L ) { static int gcImage( lua_State* L ) {
if ( state->gcUnload ) { if ( state->gcUnload ) {
Image *image = luaL_checkudata( L, 1, "Image" ); Image* image = luaL_checkudata( L, 1, "Image" );
UnloadImage( *image ); UnloadImage( *image );
} }
return 0; return 0;
} }
static void defineImage() { static void defineImage() {
lua_State *L = state->luaState; lua_State* L = state->luaState;
luaL_newmetatable( L, "Image" ); luaL_newmetatable( L, "Image" );
lua_pushvalue( L, -1 ); lua_pushvalue( L, -1 );
@@ -63,16 +63,16 @@ static void defineImage() {
} }
/* Texture */ /* Texture */
static int gcTexture( lua_State *L ) { static int gcTexture( lua_State* L ) {
if ( state->gcUnload ) { if ( state->gcUnload ) {
Texture *texture = luaL_checkudata( L, 1, "Texture" ); Texture* texture = luaL_checkudata( L, 1, "Texture" );
UnloadTexture( *texture ); UnloadTexture( *texture );
} }
return 0; return 0;
} }
static void defineTexture() { static void defineTexture() {
lua_State *L = state->luaState; lua_State* L = state->luaState;
luaL_newmetatable( L, "Texture" ); luaL_newmetatable( L, "Texture" );
lua_pushvalue( L, -1 ); lua_pushvalue( L, -1 );
@@ -82,16 +82,16 @@ static void defineTexture() {
} }
/* RenderRexture. */ /* RenderRexture. */
static int gcRenderTexture( lua_State *L ) { static int gcRenderTexture( lua_State* L ) {
if ( state->gcUnload ) { if ( state->gcUnload ) {
RenderTexture *renderTexture = luaL_checkudata( L, 1, "RenderTexture" ); RenderTexture* renderTexture = luaL_checkudata( L, 1, "RenderTexture" );
UnloadRenderTexture( *renderTexture ); UnloadRenderTexture( *renderTexture );
} }
return 0; return 0;
} }
static void defineRenderTexture() { static void defineRenderTexture() {
lua_State *L = state->luaState; lua_State* L = state->luaState;
luaL_newmetatable( L, "RenderTexture" ); luaL_newmetatable( L, "RenderTexture" );
lua_pushvalue( L, -1 ); lua_pushvalue( L, -1 );
@@ -102,7 +102,7 @@ static void defineRenderTexture() {
/* Camera2D. */ /* Camera2D. */
static void defineCamera2D() { static void defineCamera2D() {
lua_State *L = state->luaState; lua_State* L = state->luaState;
luaL_newmetatable( L, "Camera2D" ); luaL_newmetatable( L, "Camera2D" );
lua_pushvalue( L, -1 ); lua_pushvalue( L, -1 );
@@ -111,7 +111,7 @@ static void defineCamera2D() {
/* Camera3D. */ /* Camera3D. */
static void defineCamera3D() { static void defineCamera3D() {
lua_State *L = state->luaState; lua_State* L = state->luaState;
luaL_newmetatable( L, "Camera3D" ); luaL_newmetatable( L, "Camera3D" );
lua_pushvalue( L, -1 ); lua_pushvalue( L, -1 );
@@ -119,16 +119,16 @@ static void defineCamera3D() {
} }
/* Shader. */ /* Shader. */
static int gcShader( lua_State *L ) { static int gcShader( lua_State* L ) {
if ( state->gcUnload ) { if ( state->gcUnload ) {
Shader *shader = luaL_checkudata( L, 1, "Shader" ); Shader* shader = luaL_checkudata( L, 1, "Shader" );
UnloadShader( *shader ); UnloadShader( *shader );
} }
return 0; return 0;
} }
static void defineShader() { static void defineShader() {
lua_State *L = state->luaState; lua_State* L = state->luaState;
luaL_newmetatable( L, "Shader" ); luaL_newmetatable( L, "Shader" );
lua_pushvalue( L, -1 ); lua_pushvalue( L, -1 );
@@ -138,16 +138,16 @@ static void defineShader() {
} }
/* Font. */ /* Font. */
static int gcFont( lua_State *L ) { static int gcFont( lua_State* L ) {
if ( state->gcUnload ) { if ( state->gcUnload ) {
Font *font = luaL_checkudata( L, 1, "Font" ); Font* font = luaL_checkudata( L, 1, "Font" );
UnloadFont( *font ); UnloadFont( *font );
} }
return 0; return 0;
} }
static void defineFont() { static void defineFont() {
lua_State *L = state->luaState; lua_State* L = state->luaState;
luaL_newmetatable( L, "Font" ); luaL_newmetatable( L, "Font" );
lua_pushvalue( L, -1 ); lua_pushvalue( L, -1 );
@@ -157,16 +157,16 @@ static void defineFont() {
} }
/* GlyphInfo. */ /* GlyphInfo. */
static int gcGlyphInfo( lua_State *L ) { static int gcGlyphInfo( lua_State* L ) {
if ( state->gcUnload ) { if ( state->gcUnload ) {
GlyphInfo *glyph = luaL_checkudata( L, 1, "GlyphInfo" ); GlyphInfo* glyph = luaL_checkudata( L, 1, "GlyphInfo" );
unloadGlyphInfo( glyph ); unloadGlyphInfo( glyph );
} }
return 0; return 0;
} }
static void defineGlyphInfo() { static void defineGlyphInfo() {
lua_State *L = state->luaState; lua_State* L = state->luaState;
luaL_newmetatable( L, "GlyphInfo" ); luaL_newmetatable( L, "GlyphInfo" );
lua_pushvalue( L, -1 ); lua_pushvalue( L, -1 );
@@ -176,16 +176,16 @@ static void defineGlyphInfo() {
} }
/* Wave. */ /* Wave. */
static int gcWave( lua_State *L ) { static int gcWave( lua_State* L ) {
if ( state->gcUnload ) { if ( state->gcUnload ) {
Wave *wave = luaL_checkudata( L, 1, "Wave" ); Wave* wave = luaL_checkudata( L, 1, "Wave" );
UnloadWave( *wave ); UnloadWave( *wave );
} }
return 0; return 0;
} }
static void defineWave() { static void defineWave() {
lua_State *L = state->luaState; lua_State* L = state->luaState;
luaL_newmetatable( L, "Wave" ); luaL_newmetatable( L, "Wave" );
lua_pushvalue( L, -1 ); lua_pushvalue( L, -1 );
@@ -195,16 +195,16 @@ static void defineWave() {
} }
/* Sound. */ /* Sound. */
static int gcSound( lua_State *L ) { static int gcSound( lua_State* L ) {
if ( state->gcUnload ) { if ( state->gcUnload ) {
Sound *sound = luaL_checkudata( L, 1, "Sound" ); Sound* sound = luaL_checkudata( L, 1, "Sound" );
UnloadSound( *sound ); UnloadSound( *sound );
} }
return 0; return 0;
} }
static void defineSound() { static void defineSound() {
lua_State *L = state->luaState; lua_State* L = state->luaState;
luaL_newmetatable( L, "Sound" ); luaL_newmetatable( L, "Sound" );
lua_pushvalue( L, -1 ); lua_pushvalue( L, -1 );
@@ -214,16 +214,16 @@ static void defineSound() {
} }
/* Music. */ /* Music. */
static int gcMusic( lua_State *L ) { static int gcMusic( lua_State* L ) {
if ( state->gcUnload ) { if ( state->gcUnload ) {
Music *music = luaL_checkudata( L, 1, "Music" ); Music* music = luaL_checkudata( L, 1, "Music" );
UnloadMusicStream( *music ); UnloadMusicStream( *music );
} }
return 0; return 0;
} }
static void defineMusic() { static void defineMusic() {
lua_State *L = state->luaState; lua_State* L = state->luaState;
luaL_newmetatable( L, "Music" ); luaL_newmetatable( L, "Music" );
lua_pushvalue( L, -1 ); lua_pushvalue( L, -1 );
@@ -234,7 +234,7 @@ static void defineMusic() {
/* Light. */ /* Light. */
static void defineLight() { static void defineLight() {
lua_State *L = state->luaState; lua_State* L = state->luaState;
luaL_newmetatable( L, "Light" ); luaL_newmetatable( L, "Light" );
lua_pushvalue( L, -1 ); lua_pushvalue( L, -1 );
@@ -242,9 +242,9 @@ static void defineLight() {
} }
/* Material. */ /* Material. */
static int gcMaterial( lua_State *L ) { static int gcMaterial( lua_State* L ) {
if ( state->gcUnload ) { if ( state->gcUnload ) {
Material *material = luaL_checkudata( L, 1, "Material" ); Material* material = luaL_checkudata( L, 1, "Material" );
/* Custom UnloadMaterial since we don't want to free Shaders or Textures. */ /* Custom UnloadMaterial since we don't want to free Shaders or Textures. */
unloadMaterial( material ); unloadMaterial( material );
} }
@@ -252,7 +252,7 @@ static int gcMaterial( lua_State *L ) {
} }
static void defineMaterial() { static void defineMaterial() {
lua_State *L = state->luaState; lua_State* L = state->luaState;
luaL_newmetatable( L, "Material" ); luaL_newmetatable( L, "Material" );
lua_pushvalue( L, -1 ); lua_pushvalue( L, -1 );
@@ -262,16 +262,16 @@ static void defineMaterial() {
} }
/* Mesh. */ /* Mesh. */
static int gcMesh( lua_State *L ) { static int gcMesh( lua_State* L ) {
if ( state->gcUnload ) { if ( state->gcUnload ) {
Mesh *mesh = luaL_checkudata( L, 1, "Mesh" ); Mesh* mesh = luaL_checkudata( L, 1, "Mesh" );
UnloadMesh( *mesh ); UnloadMesh( *mesh );
} }
return 0; return 0;
} }
static void defineMesh() { static void defineMesh() {
lua_State *L = state->luaState; lua_State* L = state->luaState;
luaL_newmetatable( L, "Mesh" ); luaL_newmetatable( L, "Mesh" );
lua_pushvalue( L, -1 ); lua_pushvalue( L, -1 );
@@ -281,16 +281,16 @@ static void defineMesh() {
} }
/* Model. */ /* Model. */
static int gcModel( lua_State *L ) { static int gcModel( lua_State* L ) {
if ( state->gcUnload ) { if ( state->gcUnload ) {
Model *model = luaL_checkudata( L, 1, "Model" ); Model* model = luaL_checkudata( L, 1, "Model" );
UnloadModel( *model ); UnloadModel( *model );
} }
return 0; return 0;
} }
static void defineModel() { static void defineModel() {
lua_State *L = state->luaState; lua_State* L = state->luaState;
luaL_newmetatable( L, "Model" ); luaL_newmetatable( L, "Model" );
lua_pushvalue( L, -1 ); lua_pushvalue( L, -1 );
@@ -300,16 +300,16 @@ static void defineModel() {
} }
/* ModelAnimation. */ /* ModelAnimation. */
static int gcModelAnimation( lua_State *L ) { static int gcModelAnimation( lua_State* L ) {
if ( state->gcUnload ) { if ( state->gcUnload ) {
ModelAnimation *modelAnimation = luaL_checkudata( L, 1, "ModelAnimation" ); ModelAnimation* modelAnimation = luaL_checkudata( L, 1, "ModelAnimation" );
UnloadModelAnimation( *modelAnimation ); UnloadModelAnimation( *modelAnimation );
} }
return 0; return 0;
} }
static void defineModelAnimation() { static void defineModelAnimation() {
lua_State *L = state->luaState; lua_State* L = state->luaState;
luaL_newmetatable( L, "ModelAnimation" ); luaL_newmetatable( L, "ModelAnimation" );
lua_pushvalue( L, -1 ); lua_pushvalue( L, -1 );
@@ -319,16 +319,16 @@ static void defineModelAnimation() {
} }
/* rlRenderBatch. */ /* rlRenderBatch. */
static int gcRLRenderBatch( lua_State *L ) { static int gcRLRenderBatch( lua_State* L ) {
if ( state->gcUnload ) { if ( state->gcUnload ) {
rlRenderBatch *renderBatch = luaL_checkudata( L, 1, "rlRenderBatch" ); rlRenderBatch* renderBatch = luaL_checkudata( L, 1, "rlRenderBatch" );
rlUnloadRenderBatch( *renderBatch ); rlUnloadRenderBatch( *renderBatch );
} }
return 0; return 0;
} }
static void defineRLRenderBatch() { static void defineRLRenderBatch() {
lua_State *L = state->luaState; lua_State* L = state->luaState;
luaL_newmetatable( L, "rlRenderBatch" ); luaL_newmetatable( L, "rlRenderBatch" );
lua_pushvalue( L, -1 ); lua_pushvalue( L, -1 );
@@ -339,38 +339,38 @@ static void defineRLRenderBatch() {
/* Assing globals. */ /* Assing globals. */
void assignGlobalInt( int value, const char *name ) { void assignGlobalInt( int value, const char* name ) {
lua_State *L = state->luaState; lua_State* L = state->luaState;
lua_pushinteger( L, value ); lua_pushinteger( L, value );
lua_setfield( L, -2, name ); lua_setfield( L, -2, name );
} }
void assignGlobalFloat( float value, const char *name ) { void assignGlobalFloat( float value, const char* name ) {
lua_State *L = state->luaState; lua_State* L = state->luaState;
lua_pushnumber( L, value ); lua_pushnumber( L, value );
lua_setfield( L, -2, name ); lua_setfield( L, -2, name );
} }
void assignGlobalDouble( double value, const char *name ) { void assignGlobalDouble( double value, const char* name ) {
lua_State *L = state->luaState; lua_State* L = state->luaState;
lua_pushnumber( L, value ); lua_pushnumber( L, value );
lua_setfield( L, -2, name ); lua_setfield( L, -2, name );
} }
void assignGlobalColor( Color color, const char *name ) { void assignGlobalColor( Color color, const char* name ) {
lua_State *L = state->luaState; lua_State* L = state->luaState;
uluaPushColor( L, color ); uluaPushColor( L, color );
lua_setfield( L, -2, name ); lua_setfield( L, -2, name );
} }
void assingGlobalFunction( const char *name, int ( *functionPtr )( lua_State* ) ) { void assingGlobalFunction( const char* name, int ( *functionPtr )( lua_State* ) ) {
lua_State *L = state->luaState; lua_State* L = state->luaState;
lua_pushcfunction( L, functionPtr ); lua_pushcfunction( L, functionPtr );
lua_setfield( L, -2, name ); lua_setfield( L, -2, name );
} }
static void defineGlobals() { static void defineGlobals() {
lua_State *L = state->luaState; lua_State* L = state->luaState;
lua_newtable( L ); lua_newtable( L );
lua_setglobal( L, "RL" ); lua_setglobal( L, "RL" );
@@ -960,7 +960,7 @@ static void defineGlobals() {
} }
// Custom logging funtion. // Custom logging funtion.
static void logCustom( int logLevel, const char *text, va_list args ) { static void logCustom( int logLevel, const char* text, va_list args ) {
char string[ STRING_LEN ] = {'\0'}; char string[ STRING_LEN ] = {'\0'};
char msg[ STRING_LEN ] = {'\0'}; char msg[ STRING_LEN ] = {'\0'};
@@ -979,7 +979,7 @@ static void logCustom( int logLevel, const char *text, va_list args ) {
printf( "%s\n", msg ); printf( "%s\n", msg );
/* Call Lua log function if exists. */ /* Call Lua log function if exists. */
lua_State *L = state->luaState; lua_State* L = state->luaState;
/* Prevent calling lua log function when lua is already shutdown. */ /* Prevent calling lua log function when lua is already shutdown. */
if ( L != NULL ) { if ( L != NULL ) {
@@ -1004,9 +1004,9 @@ static void logCustom( int logLevel, const char *text, va_list args ) {
} }
} }
bool luaInit( int argn, const char **argc ) { bool luaInit( int argn, const char** argc ) {
state->luaState = luaL_newstate(); state->luaState = luaL_newstate();
lua_State *L = state->luaState; lua_State* L = state->luaState;
luaL_openlibs( L ); luaL_openlibs( L );
@@ -1057,7 +1057,7 @@ bool luaInit( int argn, const char **argc ) {
return true; return true;
} }
int luaTraceback( lua_State *L ) { int luaTraceback( lua_State* L ) {
lua_getglobal( L, "debug" ); lua_getglobal( L, "debug" );
if ( !lua_istable( L, -1 ) ) { if ( !lua_istable( L, -1 ) ) {
@@ -1078,7 +1078,7 @@ int luaTraceback( lua_State *L ) {
} }
bool luaCallMain() { bool luaCallMain() {
lua_State *L = state->luaState; lua_State* L = state->luaState;
char path[ STRING_LEN ] = { '\0' }; char path[ STRING_LEN ] = { '\0' };
@@ -1132,7 +1132,7 @@ void luaCallUpdate() {
#if defined PLATFORM_DESKTOP_SDL && defined LUA_EVENTS #if defined PLATFORM_DESKTOP_SDL && defined LUA_EVENTS
platformSendEvents(); platformSendEvents();
#endif #endif
lua_State *L = state->luaState; lua_State* L = state->luaState;
lua_pushcfunction( L, luaTraceback ); lua_pushcfunction( L, luaTraceback );
int tracebackidx = lua_gettop(L); int tracebackidx = lua_gettop(L);
@@ -1154,7 +1154,7 @@ void luaCallUpdate() {
} }
void luaCallDraw() { void luaCallDraw() {
lua_State *L = state->luaState; lua_State* L = state->luaState;
lua_pushcfunction( L, luaTraceback ); lua_pushcfunction( L, luaTraceback );
int tracebackidx = lua_gettop(L); int tracebackidx = lua_gettop(L);
@@ -1175,7 +1175,7 @@ void luaCallDraw() {
} }
void luaCallExit() { void luaCallExit() {
lua_State *L = state->luaState; lua_State* L = state->luaState;
lua_pushcfunction( L, luaTraceback ); lua_pushcfunction( L, luaTraceback );
int tracebackidx = lua_gettop(L); int tracebackidx = lua_gettop(L);
@@ -1193,7 +1193,7 @@ void luaCallExit() {
} }
void luaRegister() { void luaRegister() {
lua_State *L = state->luaState; lua_State* L = state->luaState;
lua_getglobal( L, "RL" ); lua_getglobal( L, "RL" );
/* Core. */ /* Core. */
@@ -2226,13 +2226,13 @@ void luaRegister() {
/* Lua util functions. */ /* Lua util functions. */
bool uluaGetBoolean( lua_State *L, int index ) { bool uluaGetBoolean( lua_State* L, int index ) {
luaL_checktype( L, index, LUA_TBOOLEAN ); luaL_checktype( L, index, LUA_TBOOLEAN );
return lua_toboolean( L, index ); return lua_toboolean( L, index );
} }
Color uluaGetColor( lua_State *L, int index ) { Color uluaGetColor( lua_State* L, int index ) {
luaL_checktype( L, index, LUA_TTABLE ); luaL_checktype( L, index, LUA_TTABLE );
Color color = { 0, 0, 0, 255 }; Color color = { 0, 0, 0, 255 };
@@ -2280,7 +2280,7 @@ Color uluaGetColor( lua_State *L, int index ) {
return color; return color;
} }
Vector2 uluaGetVector2( lua_State *L, int index ) { Vector2 uluaGetVector2( lua_State* L, int index ) {
luaL_checktype( L, index, LUA_TTABLE ); luaL_checktype( L, index, LUA_TTABLE );
Vector2 vector = { 0.0f, 0.0f }; Vector2 vector = { 0.0f, 0.0f };
@@ -2316,7 +2316,7 @@ Vector2 uluaGetVector2( lua_State *L, int index ) {
return vector; return vector;
} }
Vector3 uluaGetVector3( lua_State *L, int index ) { Vector3 uluaGetVector3( lua_State* L, int index ) {
luaL_checktype( L, index, LUA_TTABLE ); luaL_checktype( L, index, LUA_TTABLE );
Vector3 vector = { 0.0f, 0.0f, 0.0f }; Vector3 vector = { 0.0f, 0.0f, 0.0f };
@@ -2358,7 +2358,7 @@ Vector3 uluaGetVector3( lua_State *L, int index ) {
return vector; return vector;
} }
Vector4 uluaGetVector4( lua_State *L, int index ) { Vector4 uluaGetVector4( lua_State* L, int index ) {
luaL_checktype( L, index, LUA_TTABLE ); luaL_checktype( L, index, LUA_TTABLE );
Vector4 vector = { 0.0f, 0.0f, 0.0f, 0.0f }; Vector4 vector = { 0.0f, 0.0f, 0.0f, 0.0f };
@@ -2406,7 +2406,7 @@ Vector4 uluaGetVector4( lua_State *L, int index ) {
return vector; return vector;
} }
Rectangle uluaGetRectangle( lua_State *L, int index ) { Rectangle uluaGetRectangle( lua_State* L, int index ) {
luaL_checktype( L, index, LUA_TTABLE ); luaL_checktype( L, index, LUA_TTABLE );
Rectangle rect = { 0.0f, 0.0f, 0.0f, 0.0f }; Rectangle rect = { 0.0f, 0.0f, 0.0f, 0.0f };
@@ -2454,7 +2454,7 @@ Rectangle uluaGetRectangle( lua_State *L, int index ) {
return rect; return rect;
} }
Quaternion uluaGetQuaternion( lua_State *L, int index ) { Quaternion uluaGetQuaternion( lua_State* L, int index ) {
luaL_checktype( L, index, LUA_TTABLE ); luaL_checktype( L, index, LUA_TTABLE );
Quaternion quaternion = { 0.0f, 0.0f, 0.0f, 0.0f }; Quaternion quaternion = { 0.0f, 0.0f, 0.0f, 0.0f };
@@ -2502,7 +2502,7 @@ Quaternion uluaGetQuaternion( lua_State *L, int index ) {
return quaternion; return quaternion;
} }
Matrix uluaGetMatrix( lua_State *L, int index ) { Matrix uluaGetMatrix( lua_State* L, int index ) {
luaL_checktype( L, index, LUA_TTABLE ); luaL_checktype( L, index, LUA_TTABLE );
Matrix matrix = { 0.0f }; Matrix matrix = { 0.0f };
float m[4][4]; float m[4][4];
@@ -2547,7 +2547,7 @@ Matrix uluaGetMatrix( lua_State *L, int index ) {
return matrix; return matrix;
} }
BoundingBox uluaGetBoundingBox( lua_State *L, int index ) { BoundingBox uluaGetBoundingBox( lua_State* L, int index ) {
luaL_checktype( L, index, LUA_TTABLE ); luaL_checktype( L, index, LUA_TTABLE );
BoundingBox box = { .min = { 0.0, 0.0, 0.0 }, .max = { 0.0, 0.0, 0.0 } }; BoundingBox box = { .min = { 0.0, 0.0, 0.0 }, .max = { 0.0, 0.0, 0.0 } };
@@ -2583,7 +2583,7 @@ BoundingBox uluaGetBoundingBox( lua_State *L, int index ) {
return box; return box;
} }
Ray uluaGetRay( lua_State *L, int index ) { Ray uluaGetRay( lua_State* L, int index ) {
luaL_checktype( L, index, LUA_TTABLE ); luaL_checktype( L, index, LUA_TTABLE );
Ray ray = { .position = { 0.0, 0.0, 0.0 }, .direction = { 0.0, 0.0, 0.0 } }; Ray ray = { .position = { 0.0, 0.0, 0.0 }, .direction = { 0.0, 0.0, 0.0 } };
@@ -2619,7 +2619,7 @@ Ray uluaGetRay( lua_State *L, int index ) {
return ray; return ray;
} }
NPatchInfo uluaGetNPatchInfo( lua_State *L, int index ) { NPatchInfo uluaGetNPatchInfo( lua_State* L, int index ) {
luaL_checktype( L, index, LUA_TTABLE ); luaL_checktype( L, index, LUA_TTABLE );
NPatchInfo npatch = { .source = { 0.0, 0.0, 0.0, 0.0 }, .left = 0, .top = 0, .right = 0, .bottom = 0, .layout = NPATCH_NINE_PATCH }; NPatchInfo npatch = { .source = { 0.0, 0.0, 0.0, 0.0 }, .left = 0, .top = 0, .right = 0, .bottom = 0, .layout = NPATCH_NINE_PATCH };
@@ -2678,7 +2678,7 @@ NPatchInfo uluaGetNPatchInfo( lua_State *L, int index ) {
return npatch; return npatch;
} }
BoneInfo uluaGetBoneInfo( lua_State *L, int index ) { BoneInfo uluaGetBoneInfo( lua_State* L, int index ) {
luaL_checktype( L, index, LUA_TTABLE ); luaL_checktype( L, index, LUA_TTABLE );
BoneInfo bone = { 0 }; BoneInfo bone = { 0 };
@@ -2715,7 +2715,7 @@ BoneInfo uluaGetBoneInfo( lua_State *L, int index ) {
return bone; return bone;
} }
Transform uluaGetTransform( lua_State *L, int index ) { Transform uluaGetTransform( lua_State* L, int index ) {
luaL_checktype( L, index, LUA_TTABLE ); luaL_checktype( L, index, LUA_TTABLE );
Transform transform = { 0 }; Transform transform = { 0 };
@@ -2758,126 +2758,126 @@ Transform uluaGetTransform( lua_State *L, int index ) {
return transform; return transform;
} }
Buffer* uluaGetBuffer( lua_State *L, int index ) { Buffer* uluaGetBuffer( lua_State* L, int index ) {
if ( lua_islightuserdata( L, index ) ) { if ( lua_islightuserdata( L, index ) ) {
return (Buffer*)lua_touserdata( L, index ); return (Buffer*)lua_touserdata( L, index );
} }
return luaL_checkudata( L, index, "Buffer" ); return luaL_checkudata( L, index, "Buffer" );
} }
Image* uluaGetImage( lua_State *L, int index ) { Image* uluaGetImage( lua_State* L, int index ) {
if ( lua_islightuserdata( L, index ) ) { if ( lua_islightuserdata( L, index ) ) {
return (Image*)lua_touserdata( L, index ); return (Image*)lua_touserdata( L, index );
} }
return luaL_checkudata( L, index, "Image" ); return luaL_checkudata( L, index, "Image" );
} }
Texture* uluaGetTexture( lua_State *L, int index ) { Texture* uluaGetTexture( lua_State* L, int index ) {
if ( lua_islightuserdata( L, index ) ) { if ( lua_islightuserdata( L, index ) ) {
return (Texture*)lua_touserdata( L, index ); return (Texture*)lua_touserdata( L, index );
} }
return luaL_checkudata( L, index, "Texture" ); return luaL_checkudata( L, index, "Texture" );
} }
RenderTexture* uluaGetRenderTexture( lua_State *L, int index ) { RenderTexture* uluaGetRenderTexture( lua_State* L, int index ) {
if ( lua_islightuserdata( L, index ) ) { if ( lua_islightuserdata( L, index ) ) {
return (RenderTexture*)lua_touserdata( L, index ); return (RenderTexture*)lua_touserdata( L, index );
} }
return luaL_checkudata( L, index, "RenderTexture" ); return luaL_checkudata( L, index, "RenderTexture" );
} }
Shader* uluaGetShader( lua_State *L, int index ) { Shader* uluaGetShader( lua_State* L, int index ) {
if ( lua_islightuserdata( L, index ) ) { if ( lua_islightuserdata( L, index ) ) {
return (Shader*)lua_touserdata( L, index ); return (Shader*)lua_touserdata( L, index );
} }
return luaL_checkudata( L, index, "Shader" ); return luaL_checkudata( L, index, "Shader" );
} }
Mesh* uluaGetMesh( lua_State *L, int index ) { Mesh* uluaGetMesh( lua_State* L, int index ) {
if ( lua_islightuserdata( L, index ) ) { if ( lua_islightuserdata( L, index ) ) {
return (Mesh*)lua_touserdata( L, index ); return (Mesh*)lua_touserdata( L, index );
} }
return luaL_checkudata( L, index, "Mesh" ); return luaL_checkudata( L, index, "Mesh" );
} }
Camera2D* uluaGetCamera2D( lua_State *L, int index ) { Camera2D* uluaGetCamera2D( lua_State* L, int index ) {
if ( lua_islightuserdata( L, index ) ) { if ( lua_islightuserdata( L, index ) ) {
return (Camera2D*)lua_touserdata( L, index ); return (Camera2D*)lua_touserdata( L, index );
} }
return luaL_checkudata( L, index, "Camera2D" ); return luaL_checkudata( L, index, "Camera2D" );
} }
Camera3D* uluaGetCamera3D( lua_State *L, int index ) { Camera3D* uluaGetCamera3D( lua_State* L, int index ) {
if ( lua_islightuserdata( L, index ) ) { if ( lua_islightuserdata( L, index ) ) {
return (Camera3D*)lua_touserdata( L, index ); return (Camera3D*)lua_touserdata( L, index );
} }
return luaL_checkudata( L, index, "Camera3D" ); return luaL_checkudata( L, index, "Camera3D" );
} }
Font* uluaGetFont( lua_State *L, int index ) { Font* uluaGetFont( lua_State* L, int index ) {
if ( lua_islightuserdata( L, index ) ) { if ( lua_islightuserdata( L, index ) ) {
return (Font*)lua_touserdata( L, index ); return (Font*)lua_touserdata( L, index );
} }
return luaL_checkudata( L, index, "Font" ); return luaL_checkudata( L, index, "Font" );
} }
GlyphInfo* uluaGetGlyphInfo( lua_State *L, int index ) { GlyphInfo* uluaGetGlyphInfo( lua_State* L, int index ) {
if ( lua_islightuserdata( L, index ) ) { if ( lua_islightuserdata( L, index ) ) {
return (GlyphInfo*)lua_touserdata( L, index ); return (GlyphInfo*)lua_touserdata( L, index );
} }
return luaL_checkudata( L, index, "GlyphInfo" ); return luaL_checkudata( L, index, "GlyphInfo" );
} }
Wave* uluaGetWave( lua_State *L, int index ) { Wave* uluaGetWave( lua_State* L, int index ) {
if ( lua_islightuserdata( L, index ) ) { if ( lua_islightuserdata( L, index ) ) {
return (Wave*)lua_touserdata( L, index ); return (Wave*)lua_touserdata( L, index );
} }
return luaL_checkudata( L, index, "Wave" ); return luaL_checkudata( L, index, "Wave" );
} }
Sound* uluaGetSound( lua_State *L, int index ) { Sound* uluaGetSound( lua_State* L, int index ) {
if ( lua_islightuserdata( L, index ) ) { if ( lua_islightuserdata( L, index ) ) {
return (Sound*)lua_touserdata( L, index ); return (Sound*)lua_touserdata( L, index );
} }
return luaL_checkudata( L, index, "Sound" ); return luaL_checkudata( L, index, "Sound" );
} }
Music* uluaGetMusic( lua_State *L, int index ) { Music* uluaGetMusic( lua_State* L, int index ) {
if ( lua_islightuserdata( L, index ) ) { if ( lua_islightuserdata( L, index ) ) {
return (Music*)lua_touserdata( L, index ); return (Music*)lua_touserdata( L, index );
} }
return luaL_checkudata( L, index, "Music" ); return luaL_checkudata( L, index, "Music" );
} }
Light* uluaGetLight( lua_State *L, int index ) { Light* uluaGetLight( lua_State* L, int index ) {
if ( lua_islightuserdata( L, index ) ) { if ( lua_islightuserdata( L, index ) ) {
return (Light*)lua_touserdata( L, index ); return (Light*)lua_touserdata( L, index );
} }
return luaL_checkudata( L, index, "Light" ); return luaL_checkudata( L, index, "Light" );
} }
Material* uluaGetMaterial( lua_State *L, int index ) { Material* uluaGetMaterial( lua_State* L, int index ) {
if ( lua_islightuserdata( L, index ) ) { if ( lua_islightuserdata( L, index ) ) {
return (Material*)lua_touserdata( L, index ); return (Material*)lua_touserdata( L, index );
} }
return luaL_checkudata( L, index, "Material" ); return luaL_checkudata( L, index, "Material" );
} }
Model* uluaGetModel( lua_State *L, int index ) { Model* uluaGetModel( lua_State* L, int index ) {
if ( lua_islightuserdata( L, index ) ) { if ( lua_islightuserdata( L, index ) ) {
return (Model*)lua_touserdata( L, index ); return (Model*)lua_touserdata( L, index );
} }
return luaL_checkudata( L, index, "Model" ); return luaL_checkudata( L, index, "Model" );
} }
ModelAnimation* uluaGetModelAnimation( lua_State *L, int index ) { ModelAnimation* uluaGetModelAnimation( lua_State* L, int index ) {
if ( lua_islightuserdata( L, index ) ) { if ( lua_islightuserdata( L, index ) ) {
return (ModelAnimation*)lua_touserdata( L, index ); return (ModelAnimation*)lua_touserdata( L, index );
} }
return luaL_checkudata( L, index, "ModelAnimation" ); return luaL_checkudata( L, index, "ModelAnimation" );
} }
rlRenderBatch* uluaGetRLRenderBatch( lua_State *L, int index ) { rlRenderBatch* uluaGetRLRenderBatch( lua_State* L, int index ) {
if ( lua_islightuserdata( L, index ) ) { if ( lua_islightuserdata( L, index ) ) {
return (rlRenderBatch*)lua_touserdata( L, index ); return (rlRenderBatch*)lua_touserdata( L, index );
} }
@@ -2886,7 +2886,7 @@ rlRenderBatch* uluaGetRLRenderBatch( lua_State *L, int index ) {
/* Push types. */ /* Push types. */
void uluaPushColor( lua_State *L, Color color ) { void uluaPushColor( lua_State* L, Color color ) {
lua_createtable( L, 3, 0 ); lua_createtable( L, 3, 0 );
lua_pushnumber( L, color.r ); lua_pushnumber( L, color.r );
lua_rawseti( L, -2, 1 ); lua_rawseti( L, -2, 1 );
@@ -2898,7 +2898,7 @@ void uluaPushColor( lua_State *L, Color color ) {
lua_rawseti( L, -2, 4 ); lua_rawseti( L, -2, 4 );
} }
void uluaPushVector2( lua_State *L, Vector2 vector ) { void uluaPushVector2( lua_State* L, Vector2 vector ) {
lua_createtable( L, 2, 0 ); lua_createtable( L, 2, 0 );
lua_pushnumber( L, vector.x ); lua_pushnumber( L, vector.x );
lua_rawseti( L, -2, 1 ); lua_rawseti( L, -2, 1 );
@@ -2906,7 +2906,7 @@ void uluaPushVector2( lua_State *L, Vector2 vector ) {
lua_rawseti( L, -2, 2 ); lua_rawseti( L, -2, 2 );
} }
void uluaPushVector3( lua_State *L, Vector3 vector ) { void uluaPushVector3( lua_State* L, Vector3 vector ) {
lua_createtable( L, 3, 0 ); lua_createtable( L, 3, 0 );
lua_pushnumber( L, vector.x ); lua_pushnumber( L, vector.x );
lua_rawseti( L, -2, 1 ); lua_rawseti( L, -2, 1 );
@@ -2916,7 +2916,7 @@ void uluaPushVector3( lua_State *L, Vector3 vector ) {
lua_rawseti( L, -2, 3 ); lua_rawseti( L, -2, 3 );
} }
void uluaPushVector4( lua_State *L, Vector4 vector ) { void uluaPushVector4( lua_State* L, Vector4 vector ) {
lua_createtable( L, 4, 0 ); lua_createtable( L, 4, 0 );
lua_pushnumber( L, vector.x ); lua_pushnumber( L, vector.x );
lua_rawseti( L, -2, 1 ); lua_rawseti( L, -2, 1 );
@@ -2928,7 +2928,7 @@ void uluaPushVector4( lua_State *L, Vector4 vector ) {
lua_rawseti( L, -2, 4 ); lua_rawseti( L, -2, 4 );
} }
void uluaPushRectangle( lua_State *L, Rectangle rect ) { void uluaPushRectangle( lua_State* L, Rectangle rect ) {
lua_createtable( L, 4, 0 ); lua_createtable( L, 4, 0 );
lua_pushnumber( L, rect.x ); lua_pushnumber( L, rect.x );
lua_rawseti( L, -2, 1 ); lua_rawseti( L, -2, 1 );
@@ -2940,7 +2940,7 @@ void uluaPushRectangle( lua_State *L, Rectangle rect ) {
lua_rawseti( L, -2, 4 ); lua_rawseti( L, -2, 4 );
} }
void uluaPushQuaternion( lua_State *L, Quaternion quaternion ) { void uluaPushQuaternion( lua_State* L, Quaternion quaternion ) {
lua_createtable( L, 4, 0 ); lua_createtable( L, 4, 0 );
lua_pushnumber( L, quaternion.x ); lua_pushnumber( L, quaternion.x );
lua_rawseti( L, -2, 1 ); lua_rawseti( L, -2, 1 );
@@ -2952,7 +2952,7 @@ void uluaPushQuaternion( lua_State *L, Quaternion quaternion ) {
lua_rawseti( L, -2, 4 ); lua_rawseti( L, -2, 4 );
} }
void uluaPushMatrix( lua_State *L, Matrix matrix ) { void uluaPushMatrix( lua_State* L, Matrix matrix ) {
lua_createtable( L, 4, 0 ); lua_createtable( L, 4, 0 );
lua_createtable( L, 4, 0 ); lua_createtable( L, 4, 0 );
@@ -3000,7 +3000,7 @@ void uluaPushMatrix( lua_State *L, Matrix matrix ) {
lua_rawseti( L, -2, 4 ); lua_rawseti( L, -2, 4 );
} }
void uluaPushRay( lua_State *L, Ray ray ) { void uluaPushRay( lua_State* L, Ray ray ) {
lua_createtable( L, 2, 0 ); lua_createtable( L, 2, 0 );
lua_createtable( L, 3, 0 ); lua_createtable( L, 3, 0 );
@@ -3022,7 +3022,7 @@ void uluaPushRay( lua_State *L, Ray ray ) {
lua_rawseti( L, -2, 2 ); lua_rawseti( L, -2, 2 );
} }
void uluaPushRayCollision( lua_State *L, RayCollision rayCol ) { void uluaPushRayCollision( lua_State* L, RayCollision rayCol ) {
lua_createtable( L, 4, 0 ); lua_createtable( L, 4, 0 );
lua_pushboolean( L, rayCol.hit ); lua_pushboolean( L, rayCol.hit );
lua_setfield( L, -2, "hit" ); lua_setfield( L, -2, "hit" );
@@ -3034,7 +3034,7 @@ void uluaPushRayCollision( lua_State *L, RayCollision rayCol ) {
lua_setfield( L, -2, "normal" ); lua_setfield( L, -2, "normal" );
} }
void uluaPushBoundingBox( lua_State *L, BoundingBox box ) { void uluaPushBoundingBox( lua_State* L, BoundingBox box ) {
lua_createtable( L, 2, 0 ); lua_createtable( L, 2, 0 );
lua_createtable( L, 3, 0 ); lua_createtable( L, 3, 0 );
@@ -3056,7 +3056,7 @@ void uluaPushBoundingBox( lua_State *L, BoundingBox box ) {
lua_rawseti( L, -2, 2 ); lua_rawseti( L, -2, 2 );
} }
void uluaPushBoneInfo( lua_State *L, BoneInfo boneInfo ) { void uluaPushBoneInfo( lua_State* L, BoneInfo boneInfo ) {
lua_createtable( L, 2, 0 ); lua_createtable( L, 2, 0 );
lua_pushstring( L, boneInfo.name ); lua_pushstring( L, boneInfo.name );
lua_setfield( L, -2, "name" ); lua_setfield( L, -2, "name" );
@@ -3064,7 +3064,7 @@ void uluaPushBoneInfo( lua_State *L, BoneInfo boneInfo ) {
lua_setfield( L, -2, "parent" ); lua_setfield( L, -2, "parent" );
} }
void uluaPushTransform( lua_State *L, Transform transform ) { void uluaPushTransform( lua_State* L, Transform transform ) {
lua_createtable( L, 3, 0 ); lua_createtable( L, 3, 0 );
uluaPushVector3( L, transform.translation ); uluaPushVector3( L, transform.translation );
lua_setfield( L, -2, "name" ); lua_setfield( L, -2, "name" );
@@ -3074,118 +3074,118 @@ void uluaPushTransform( lua_State *L, Transform transform ) {
lua_setfield( L, -2, "scale" ); lua_setfield( L, -2, "scale" );
} }
void uluaPushBuffer( lua_State *L, Buffer buffer ) { void uluaPushBuffer( lua_State* L, Buffer buffer ) {
if ( buffer.size == 0 ) { if ( buffer.size == 0 ) {
buffer.data = NULL; buffer.data = NULL;
} }
Buffer *bufferP = lua_newuserdata( L, sizeof( Buffer ) ); Buffer* bufferP = lua_newuserdata( L, sizeof( Buffer ) );
*bufferP = buffer; *bufferP = buffer;
luaL_setmetatable( L, "Buffer" ); luaL_setmetatable( L, "Buffer" );
} }
void uluaPushImage( lua_State *L, Image image ) { void uluaPushImage( lua_State* L, Image image ) {
Image *imageP = lua_newuserdata( L, sizeof( Image ) ); Image* imageP = lua_newuserdata( L, sizeof( Image ) );
*imageP = image; *imageP = image;
luaL_setmetatable( L, "Image" ); luaL_setmetatable( L, "Image" );
} }
void uluaPushTexture( lua_State *L, Texture texture ) { void uluaPushTexture( lua_State* L, Texture texture ) {
Texture *textureP = lua_newuserdata( L, sizeof( Texture ) ); Texture* textureP = lua_newuserdata( L, sizeof( Texture ) );
*textureP = texture; *textureP = texture;
luaL_setmetatable( L, "Texture" ); luaL_setmetatable( L, "Texture" );
} }
void uluaPushRenderTexture( lua_State *L, RenderTexture renderTexture ) { void uluaPushRenderTexture( lua_State* L, RenderTexture renderTexture ) {
RenderTexture *renderTextureP = lua_newuserdata( L, sizeof( RenderTexture ) ); RenderTexture* renderTextureP = lua_newuserdata( L, sizeof( RenderTexture ) );
*renderTextureP = renderTexture; *renderTextureP = renderTexture;
luaL_setmetatable( L, "RenderTexture" ); luaL_setmetatable( L, "RenderTexture" );
} }
void uluaPushCamera2D( lua_State *L, Camera2D camera ) { void uluaPushCamera2D( lua_State* L, Camera2D camera ) {
Camera2D *cameraP = lua_newuserdata( L, sizeof( Camera2D ) ); Camera2D* cameraP = lua_newuserdata( L, sizeof( Camera2D ) );
*cameraP = camera; *cameraP = camera;
luaL_setmetatable( L, "Camera2D" ); luaL_setmetatable( L, "Camera2D" );
} }
void uluaPushCamera3D( lua_State *L, Camera3D camera ) { void uluaPushCamera3D( lua_State* L, Camera3D camera ) {
Camera3D *cameraP = lua_newuserdata( L, sizeof( Camera3D ) ); Camera3D* cameraP = lua_newuserdata( L, sizeof( Camera3D ) );
*cameraP = camera; *cameraP = camera;
luaL_setmetatable( L, "Camera3D" ); luaL_setmetatable( L, "Camera3D" );
} }
void uluaPushShader( lua_State *L, Shader shader ) { void uluaPushShader( lua_State* L, Shader shader ) {
Shader *shaderP = lua_newuserdata( L, sizeof( Shader ) ); Shader* shaderP = lua_newuserdata( L, sizeof( Shader ) );
*shaderP = shader; *shaderP = shader;
luaL_setmetatable( L, "Shader" ); luaL_setmetatable( L, "Shader" );
} }
void uluaPushFont( lua_State *L, Font font ) { void uluaPushFont( lua_State* L, Font font ) {
Font *fontP = lua_newuserdata( L, sizeof( Font ) ); Font* fontP = lua_newuserdata( L, sizeof( Font ) );
*fontP = font; *fontP = font;
luaL_setmetatable( L, "Font" ); luaL_setmetatable( L, "Font" );
} }
void uluaPushGlyphInfo( lua_State *L, GlyphInfo glyph ) { void uluaPushGlyphInfo( lua_State* L, GlyphInfo glyph ) {
GlyphInfo *glyphP = lua_newuserdata( L, sizeof( GlyphInfo ) ); GlyphInfo* glyphP = lua_newuserdata( L, sizeof( GlyphInfo ) );
*glyphP = glyph; *glyphP = glyph;
luaL_setmetatable( L, "GlyphInfo" ); luaL_setmetatable( L, "GlyphInfo" );
} }
void uluaPushWave( lua_State *L, Wave wave ) { void uluaPushWave( lua_State* L, Wave wave ) {
Wave *waveP = lua_newuserdata( L, sizeof( Wave ) ); Wave* waveP = lua_newuserdata( L, sizeof( Wave ) );
*waveP = wave; *waveP = wave;
luaL_setmetatable( L, "Wave" ); luaL_setmetatable( L, "Wave" );
} }
void uluaPushSound( lua_State *L, Sound sound ) { void uluaPushSound( lua_State* L, Sound sound ) {
Sound *soundP = lua_newuserdata( L, sizeof( Sound ) ); Sound* soundP = lua_newuserdata( L, sizeof( Sound ) );
*soundP = sound; *soundP = sound;
luaL_setmetatable( L, "Sound" ); luaL_setmetatable( L, "Sound" );
} }
void uluaPushMusic( lua_State *L, Music music ) { void uluaPushMusic( lua_State* L, Music music ) {
Music *musicP = lua_newuserdata( L, sizeof( Music ) ); Music* musicP = lua_newuserdata( L, sizeof( Music ) );
*musicP = music; *musicP = music;
luaL_setmetatable( L, "Music" ); luaL_setmetatable( L, "Music" );
} }
void uluaPushLight( lua_State *L, Light light ) { void uluaPushLight( lua_State* L, Light light ) {
Light *lightP = lua_newuserdata( L, sizeof( Light ) ); Light* lightP = lua_newuserdata( L, sizeof( Light ) );
*lightP = light; *lightP = light;
luaL_setmetatable( L, "Light" ); luaL_setmetatable( L, "Light" );
} }
void uluaPushMaterial( lua_State *L, Material material ) { void uluaPushMaterial( lua_State* L, Material material ) {
Material *materialP = lua_newuserdata( L, sizeof( Material ) ); Material* materialP = lua_newuserdata( L, sizeof( Material ) );
*materialP = material; *materialP = material;
luaL_setmetatable( L, "Material" ); luaL_setmetatable( L, "Material" );
} }
void uluaPushMesh( lua_State *L, Mesh mesh ) { void uluaPushMesh( lua_State* L, Mesh mesh ) {
Mesh *meshP = lua_newuserdata( L, sizeof( Mesh ) ); Mesh* meshP = lua_newuserdata( L, sizeof( Mesh ) );
*meshP = mesh; *meshP = mesh;
luaL_setmetatable( L, "Mesh" ); luaL_setmetatable( L, "Mesh" );
} }
void uluaPushModel( lua_State *L, Model model ) { void uluaPushModel( lua_State* L, Model model ) {
Model *modelP = lua_newuserdata( L, sizeof( Model ) ); Model* modelP = lua_newuserdata( L, sizeof( Model ) );
*modelP = model; *modelP = model;
luaL_setmetatable( L, "Model" ); luaL_setmetatable( L, "Model" );
} }
void uluaPushModelAnimation( lua_State *L, ModelAnimation modelAnimation ) { void uluaPushModelAnimation( lua_State* L, ModelAnimation modelAnimation ) {
ModelAnimation *modelAnimationP = lua_newuserdata( L, sizeof( ModelAnimation ) ); ModelAnimation* modelAnimationP = lua_newuserdata( L, sizeof( ModelAnimation ) );
*modelAnimationP = modelAnimation; *modelAnimationP = modelAnimation;
luaL_setmetatable( L, "ModelAnimation" ); luaL_setmetatable( L, "ModelAnimation" );
} }
void uluaPushRLRenderBatch( lua_State *L, rlRenderBatch renderBatch ) { void uluaPushRLRenderBatch( lua_State* L, rlRenderBatch renderBatch ) {
rlRenderBatch *renderBatchP = lua_newuserdata( L, sizeof( rlRenderBatch ) ); rlRenderBatch* renderBatchP = lua_newuserdata( L, sizeof( rlRenderBatch ) );
*renderBatchP = renderBatch; *renderBatchP = renderBatch;
luaL_setmetatable( L, "rlRenderBatch" ); luaL_setmetatable( L, "rlRenderBatch" );
} }
int uluaGetTableLen( lua_State *L, int index ) { int uluaGetTableLen( lua_State* L, int index ) {
luaL_checktype( L, index, LUA_TTABLE ); luaL_checktype( L, index, LUA_TTABLE );
int t = index, i = 0; int t = index, i = 0;
lua_pushnil( L ); lua_pushnil( L );

View File

@@ -19,7 +19,7 @@ inline static void printVersion() {
#endif #endif
} }
int main( int argn, const char **argc ) { int main( int argn, const char** argc ) {
char exePath[ STRING_LEN ] = { '\0' }; char exePath[ STRING_LEN ] = { '\0' };
bool interpret_mode = false; bool interpret_mode = false;
@@ -50,7 +50,7 @@ int main( int argn, const char **argc ) {
if ( interpret_mode ) { if ( interpret_mode ) {
stateInitInterpret( argn, argc ); stateInitInterpret( argn, argc );
lua_State *L = state->luaState; lua_State* L = state->luaState;
lua_pushcfunction( L, luaTraceback ); lua_pushcfunction( L, luaTraceback );
int tracebackidx = lua_gettop( L ); int tracebackidx = lua_gettop( L );

File diff suppressed because it is too large Load Diff

View File

@@ -4,7 +4,7 @@
#include "platforms/core_desktop.h" #include "platforms/core_desktop.h"
void platformDefineGlobals() { void platformDefineGlobals() {
lua_State *L = state->luaState; lua_State* L = state->luaState;
lua_getglobal( L, "RL" ); lua_getglobal( L, "RL" );
/*DOC_DEFINES_START*/ /*DOC_DEFINES_START*/
@@ -55,11 +55,11 @@ this function returns nil but does not emit an error.
- Success return string or nil - Success return string or nil
*/ */
int lcoreGetKeyName( lua_State *L ) { int lcoreGetKeyName( lua_State* L ) {
int key = luaL_checkinteger( L, 1 ); int key = luaL_checkinteger( L, 1 );
int scancode = luaL_checkinteger( L, 2 ); int scancode = luaL_checkinteger( L, 2 );
const char *keyName = glfwGetKeyName( key, scancode ); const char* keyName = glfwGetKeyName( key, scancode );
if ( keyName != NULL ) { if ( keyName != NULL ) {
lua_pushstring( L, keyName ); lua_pushstring( L, keyName );
@@ -79,7 +79,7 @@ If the key is KEY_UNKNOWN or does not exist on the keyboard this method will ret
- Success return int - Success return int
*/ */
int lcoreGetKeyScancode( lua_State *L ) { int lcoreGetKeyScancode( lua_State* L ) {
int key = luaL_checkinteger( L, 1 ); int key = luaL_checkinteger( L, 1 );
lua_pushinteger( L, glfwGetKeyScancode( key ) ); lua_pushinteger( L, glfwGetKeyScancode( key ) );
@@ -98,11 +98,11 @@ int lcoreGetKeyScancode( lua_State *L ) {
Called when the window is resized. Type GLFW_WINDOW_SIZE_EVENT Called when the window is resized. Type GLFW_WINDOW_SIZE_EVENT
*/ */
static void windowSizeEvent( GLFWwindow *window, int width, int height ) { static void windowSizeEvent( GLFWwindow* window, int width, int height ) {
/* Pass through to raylib callback. */ /* Pass through to raylib callback. */
state->raylibWindowSizeCallback( window, width, height ); state->raylibWindowSizeCallback( window, width, height );
lua_State *L = state->luaState; lua_State* L = state->luaState;
lua_pushcfunction( L, luaTraceback ); lua_pushcfunction( L, luaTraceback );
int tracebackidx = lua_gettop( L ); int tracebackidx = lua_gettop( L );
@@ -134,11 +134,11 @@ static void windowSizeEvent( GLFWwindow *window, int width, int height ) {
Called when the window is maximized or restored. Type GLFW_WINDOW_MAXIMIZE_EVENT Called when the window is maximized or restored. Type GLFW_WINDOW_MAXIMIZE_EVENT
*/ */
static void windowMaximizeEvent( GLFWwindow *window, int maximized ) { static void windowMaximizeEvent( GLFWwindow* window, int maximized ) {
/* Pass through to raylib callback. */ /* Pass through to raylib callback. */
state->raylibWindowMaximizeCallback( window, maximized ); state->raylibWindowMaximizeCallback( window, maximized );
lua_State *L = state->luaState; lua_State* L = state->luaState;
lua_pushcfunction( L, luaTraceback ); lua_pushcfunction( L, luaTraceback );
int tracebackidx = lua_gettop( L ); int tracebackidx = lua_gettop( L );
@@ -168,11 +168,11 @@ static void windowMaximizeEvent( GLFWwindow *window, int maximized ) {
Called when the window is iconified or restored. Type GLFW_WINDOW_ICONYFY_EVENT Called when the window is iconified or restored. Type GLFW_WINDOW_ICONYFY_EVENT
*/ */
static void windowIconyfyEvent( GLFWwindow *window, int iconified ) { static void windowIconyfyEvent( GLFWwindow* window, int iconified ) {
/* Pass through to raylib callback. */ /* Pass through to raylib callback. */
state->raylibWindowIconifyCallback( window, iconified ); state->raylibWindowIconifyCallback( window, iconified );
lua_State *L = state->luaState; lua_State* L = state->luaState;
lua_pushcfunction( L, luaTraceback ); lua_pushcfunction( L, luaTraceback );
int tracebackidx = lua_gettop( L ); int tracebackidx = lua_gettop( L );
@@ -200,11 +200,11 @@ static void windowIconyfyEvent( GLFWwindow *window, int iconified ) {
Called when the window gains or loses input focus. Type GLFW_WINDOW_FOCUS_EVENT Called when the window gains or loses input focus. Type GLFW_WINDOW_FOCUS_EVENT
*/ */
static void windowFocusEvent( GLFWwindow *window, int focused ) { static void windowFocusEvent( GLFWwindow* window, int focused ) {
/* Pass through to raylib callback. */ /* Pass through to raylib callback. */
state->raylibWindowFocusCallback( window, focused ); state->raylibWindowFocusCallback( window, focused );
lua_State *L = state->luaState; lua_State* L = state->luaState;
lua_pushcfunction( L, luaTraceback ); lua_pushcfunction( L, luaTraceback );
int tracebackidx = lua_gettop( L ); int tracebackidx = lua_gettop( L );
@@ -232,11 +232,11 @@ static void windowFocusEvent( GLFWwindow *window, int focused ) {
Called when files are dropped to the window. Type GLFW_WINDOW_DROP_EVENT Called when files are dropped to the window. Type GLFW_WINDOW_DROP_EVENT
*/ */
static void windowDropEvent( GLFWwindow *window, int count, const char **paths ) { static void windowDropEvent( GLFWwindow* window, int count, const char** paths ) {
/* Pass through to raylib callback. */ /* Pass through to raylib callback. */
state->raylibWindowDropCallback( window, count, paths ); state->raylibWindowDropCallback( window, count, paths );
lua_State *L = state->luaState; lua_State* L = state->luaState;
lua_pushcfunction( L, luaTraceback ); lua_pushcfunction( L, luaTraceback );
int tracebackidx = lua_gettop( L ); int tracebackidx = lua_gettop( L );
@@ -280,7 +280,7 @@ static void keyInputEvent( GLFWwindow* window, int key, int scancode, int action
/* Pass through to raylib callback. */ /* Pass through to raylib callback. */
state->raylibKeyCallback( window, key, scancode, action, mods ); state->raylibKeyCallback( window, key, scancode, action, mods );
lua_State *L = state->luaState; lua_State* L = state->luaState;
lua_pushcfunction( L, luaTraceback ); lua_pushcfunction( L, luaTraceback );
int tracebackidx = lua_gettop( L ); int tracebackidx = lua_gettop( L );
@@ -318,7 +318,7 @@ static void charInputEvent( GLFWwindow* window, unsigned int key ) {
/* Pass through to raylib callback. */ /* Pass through to raylib callback. */
state->raylibCharCallback( window, key ); state->raylibCharCallback( window, key );
lua_State *L = state->luaState; lua_State* L = state->luaState;
lua_pushcfunction( L, luaTraceback ); lua_pushcfunction( L, luaTraceback );
int tracebackidx = lua_gettop( L ); int tracebackidx = lua_gettop( L );
@@ -350,7 +350,7 @@ static void mouseButtonInputEvent( GLFWwindow* window, int button, int action, i
/* Pass through to raylib callback. */ /* Pass through to raylib callback. */
state->raylibMouseButtonCallback( window, button, action, mods ); state->raylibMouseButtonCallback( window, button, action, mods );
lua_State *L = state->luaState; lua_State* L = state->luaState;
lua_pushcfunction( L, luaTraceback ); lua_pushcfunction( L, luaTraceback );
int tracebackidx = lua_gettop( L ); int tracebackidx = lua_gettop( L );
@@ -386,7 +386,7 @@ static void mouseCursorPosInputEvent( GLFWwindow* window, double x, double y ) {
/* Pass through to raylib callback. */ /* Pass through to raylib callback. */
state->raylibMouseCursorPosCallback( window, x, y ); state->raylibMouseCursorPosCallback( window, x, y );
lua_State *L = state->luaState; lua_State* L = state->luaState;
lua_pushcfunction( L, luaTraceback ); lua_pushcfunction( L, luaTraceback );
int tracebackidx = lua_gettop( L ); int tracebackidx = lua_gettop( L );
@@ -420,7 +420,7 @@ static void mouseScrollInputEvent( GLFWwindow* window, double xoffset, double yo
/* Pass through to raylib callback. */ /* Pass through to raylib callback. */
state->raylibMouseScrollCallback( window, xoffset, yoffset ); state->raylibMouseScrollCallback( window, xoffset, yoffset );
lua_State *L = state->luaState; lua_State* L = state->luaState;
lua_pushcfunction( L, luaTraceback ); lua_pushcfunction( L, luaTraceback );
int tracebackidx = lua_gettop( L ); int tracebackidx = lua_gettop( L );
@@ -454,7 +454,7 @@ static void cursorEnterInputEvent( GLFWwindow* window, int enter ) {
/* Pass through to raylib callback. */ /* Pass through to raylib callback. */
state->raylibCursorEnterCallback( window, enter ); state->raylibCursorEnterCallback( window, enter );
lua_State *L = state->luaState; lua_State* L = state->luaState;
lua_pushcfunction( L, luaTraceback ); lua_pushcfunction( L, luaTraceback );
int tracebackidx = lua_gettop( L ); int tracebackidx = lua_gettop( L );
@@ -488,7 +488,7 @@ static void joystickEvent( int jid, int event ) {
state->raylibJoystickCallback( jid, event ); state->raylibJoystickCallback( jid, event );
} }
lua_State *L = state->luaState; lua_State* L = state->luaState;
lua_pushcfunction( L, luaTraceback ); lua_pushcfunction( L, luaTraceback );
int tracebackidx = lua_gettop( L ); int tracebackidx = lua_gettop( L );
@@ -520,7 +520,7 @@ Called when the pen tablet data is updated. Type GLFW_PEN_TABLET_DATA_EVENT
NOTE: Experimental. Needs glfw PR https://github.com/glfw/glfw/pull/1445 NOTE: Experimental. Needs glfw PR https://github.com/glfw/glfw/pull/1445
*/ */
static void penTabletDataEvent( double x, double y, double z, double pressure, double pitch, double yaw, double roll ) { static void penTabletDataEvent( double x, double y, double z, double pressure, double pitch, double yaw, double roll ) {
lua_State *L = state->luaState; lua_State* L = state->luaState;
lua_pushcfunction( L, luaTraceback ); lua_pushcfunction( L, luaTraceback );
int tracebackidx = lua_gettop( L ); int tracebackidx = lua_gettop( L );
@@ -562,7 +562,7 @@ Called when the pen tablet cursor has changed. Type GLFW_PEN_TABLET_CURSOR_EVENT
NOTE: Experimental. Needs glfw PR https://github.com/glfw/glfw/pull/1445 NOTE: Experimental. Needs glfw PR https://github.com/glfw/glfw/pull/1445
*/ */
static void penTabletCursorEvent( unsigned int identifier ) { static void penTabletCursorEvent( unsigned int identifier ) {
lua_State *L = state->luaState; lua_State* L = state->luaState;
lua_pushcfunction( L, luaTraceback ); lua_pushcfunction( L, luaTraceback );
int tracebackidx = lua_gettop( L ); int tracebackidx = lua_gettop( L );
@@ -592,7 +592,7 @@ Called when the pen tablet proximity has changed. Type GLFW_PEN_TABLET_PROXIMITY
NOTE: Experimental. Needs glfw PR https://github.com/glfw/glfw/pull/1445 NOTE: Experimental. Needs glfw PR https://github.com/glfw/glfw/pull/1445
*/ */
static void penTabletProximityEvent( int proxState ) { static void penTabletProximityEvent( int proxState ) {
lua_State *L = state->luaState; lua_State* L = state->luaState;
lua_pushcfunction( L, luaTraceback ); lua_pushcfunction( L, luaTraceback );
int tracebackidx = lua_gettop( L ); int tracebackidx = lua_gettop( L );
@@ -640,7 +640,7 @@ static void platformRegisterEvents() {
} }
void luaPlatformRegister() { void luaPlatformRegister() {
lua_State *L = state->luaState; lua_State* L = state->luaState;
lua_getglobal( L, "RL" ); lua_getglobal( L, "RL" );
/* Input-related functions: keyboard. */ /* Input-related functions: keyboard. */

View File

@@ -4,7 +4,7 @@
#include "platforms/core_desktop_sdl.h" #include "platforms/core_desktop_sdl.h"
void platformDefineGlobals() { void platformDefineGlobals() {
lua_State *L = state->luaState; lua_State* L = state->luaState;
lua_getglobal( L, "RL" ); lua_getglobal( L, "RL" );
/*DOC_DEFINES_START*/ /*DOC_DEFINES_START*/
@@ -88,7 +88,7 @@ Use this function to get a human-readable name for a key. If the key doesn't hav
- Success return string - Success return string
*/ */
int lcoreGetKeyName( lua_State *L ) { int lcoreGetKeyName( lua_State* L ) {
int key = luaL_checkinteger( L, 1 ); int key = luaL_checkinteger( L, 1 );
lua_pushstring( L, SDL_GetKeyName( key ) ); lua_pushstring( L, SDL_GetKeyName( key ) );
@@ -103,7 +103,7 @@ Use this function to get the scancode corresponding to the given key code accord
- Success return int - Success return int
*/ */
int lcoreGetScancodeFromKey( lua_State *L ) { int lcoreGetScancodeFromKey( lua_State* L ) {
int key = luaL_checkinteger( L, 1 ); int key = luaL_checkinteger( L, 1 );
lua_pushinteger( L, SDL_GetScancodeFromKey( key ) ); lua_pushinteger( L, SDL_GetScancodeFromKey( key ) );
@@ -118,7 +118,7 @@ int lcoreGetScancodeFromKey( lua_State *L ) {
*/ */
/* This function is not thread safe so we don't use Lua inside it directly. It only adds events to another queue. */ /* This function is not thread safe so we don't use Lua inside it directly. It only adds events to another queue. */
static int SDLEventFilter( void *userdata, SDL_Event *event ) { static int SDLEventFilter( void* userdata, SDL_Event* event ) {
/* SDL_EVENT_POLL_SENTINEL = 0x7F00, /**< Signals the end of an event poll cycle */ /* SDL_EVENT_POLL_SENTINEL = 0x7F00, /**< Signals the end of an event poll cycle */
if ( event->type != SDL_QUIT && event->type != 0x7F00 && state->SDL_eventQueueLen < PLATFORM_SDL_EVENT_QUEUE_LEN ) { if ( event->type != SDL_QUIT && event->type != 0x7F00 && state->SDL_eventQueueLen < PLATFORM_SDL_EVENT_QUEUE_LEN ) {
state->SDL_eventQueue[ state->SDL_eventQueueLen ] = *event; state->SDL_eventQueue[ state->SDL_eventQueueLen ] = *event;
@@ -134,7 +134,7 @@ static void platformRegisterEvents() {
} }
static void platformSendEvents() { static void platformSendEvents() {
lua_State *L = state->luaState; lua_State* L = state->luaState;
lua_pushcfunction( L, luaTraceback ); lua_pushcfunction( L, luaTraceback );
int tracebackidx = lua_gettop( L ); int tracebackidx = lua_gettop( L );
@@ -546,7 +546,7 @@ Event occurs an event of type SDL_DOLLARGESTURE or SDL_DOLLARRECORD is reported.
} }
void luaPlatformRegister() { void luaPlatformRegister() {
lua_State *L = state->luaState; lua_State* L = state->luaState;
lua_getglobal( L, "RL" ); lua_getglobal( L, "RL" );
/* Input-related functions: keyboard. */ /* Input-related functions: keyboard. */

View File

@@ -3,7 +3,7 @@
#include "core.h" #include "core.h"
void platformDefineGlobals() { void platformDefineGlobals() {
lua_State *L = state->luaState; lua_State* L = state->luaState;
lua_getglobal( L, "RL" ); lua_getglobal( L, "RL" );
/*DOC_DEFINES_START*/ /*DOC_DEFINES_START*/

View File

@@ -15,7 +15,7 @@
Enable gui controls (global state) Enable gui controls (global state)
*/ */
int lguiGuiEnable( lua_State *L ) { int lguiGuiEnable( lua_State* L ) {
GuiEnable(); GuiEnable();
return 0; return 0;
@@ -26,7 +26,7 @@ int lguiGuiEnable( lua_State *L ) {
Disable gui controls (global state) Disable gui controls (global state)
*/ */
int lguiGuiDisable( lua_State *L ) { int lguiGuiDisable( lua_State* L ) {
GuiDisable(); GuiDisable();
return 0; return 0;
@@ -37,7 +37,7 @@ int lguiGuiDisable( lua_State *L ) {
Lock gui controls (global state) Lock gui controls (global state)
*/ */
int lguiGuiLock( lua_State *L ) { int lguiGuiLock( lua_State* L ) {
GuiLock(); GuiLock();
return 0; return 0;
@@ -48,7 +48,7 @@ int lguiGuiLock( lua_State *L ) {
Unlock gui controls (global state) Unlock gui controls (global state)
*/ */
int lguiGuiUnlock( lua_State *L ) { int lguiGuiUnlock( lua_State* L ) {
GuiUnlock(); GuiUnlock();
return 0; return 0;
@@ -61,7 +61,7 @@ Check if gui is locked (global state)
- Success return bool - Success return bool
*/ */
int lguiGuiIsLocked( lua_State *L ) { int lguiGuiIsLocked( lua_State* L ) {
lua_pushboolean( L, GuiIsLocked() ); lua_pushboolean( L, GuiIsLocked() );
return 1; return 1;
@@ -72,7 +72,7 @@ int lguiGuiIsLocked( lua_State *L ) {
Set gui controls alpha (global state), alpha goes from 0.0f to 1.0f Set gui controls alpha (global state), alpha goes from 0.0f to 1.0f
*/ */
int lguiGuiSetAlpha( lua_State *L ) { int lguiGuiSetAlpha( lua_State* L ) {
float alpha = luaL_checknumber( L, 1 ); float alpha = luaL_checknumber( L, 1 );
GuiSetAlpha( alpha ); GuiSetAlpha( alpha );
@@ -85,7 +85,7 @@ int lguiGuiSetAlpha( lua_State *L ) {
Set gui state (global state) Set gui state (global state)
*/ */
int lguiGuiSetState( lua_State *L ) { int lguiGuiSetState( lua_State* L ) {
int state = luaL_checkinteger( L, 1 ); int state = luaL_checkinteger( L, 1 );
GuiSetState( state ); GuiSetState( state );
@@ -100,7 +100,7 @@ Get gui state (global state)
- Success return int - Success return int
*/ */
int lguiGuiGetState( lua_State *L ) { int lguiGuiGetState( lua_State* L ) {
lua_pushinteger( L, GuiGetState() ); lua_pushinteger( L, GuiGetState() );
return 1; return 1;
@@ -115,8 +115,8 @@ int lguiGuiGetState( lua_State *L ) {
Set gui custom font (global state) Set gui custom font (global state)
*/ */
int lguiGuiSetFont( lua_State *L ) { int lguiGuiSetFont( lua_State* L ) {
Font *font = uluaGetFont( L, 1 ); Font* font = uluaGetFont( L, 1 );
GuiSetFont( *font ); GuiSetFont( *font );
@@ -130,7 +130,7 @@ Get gui custom font (global state)
- Success return Font - Success return Font
*/ */
int lguiGuiGetFont( lua_State *L ) { int lguiGuiGetFont( lua_State* L ) {
uluaPushFont( L, GuiGetFont() ); uluaPushFont( L, GuiGetFont() );
return 1; return 1;
@@ -145,7 +145,7 @@ int lguiGuiGetFont( lua_State *L ) {
Set one style property Set one style property
*/ */
int lguiGuiSetStyle( lua_State *L ) { int lguiGuiSetStyle( lua_State* L ) {
int control = luaL_checkinteger( L, 1 ); int control = luaL_checkinteger( L, 1 );
int property = luaL_checkinteger( L, 2 ); int property = luaL_checkinteger( L, 2 );
int value = luaL_checkinteger( L, 3 ); int value = luaL_checkinteger( L, 3 );
@@ -162,7 +162,7 @@ Get one style property
- Success return int - Success return int
*/ */
int lguiGuiGetStyle( lua_State *L ) { int lguiGuiGetStyle( lua_State* L ) {
int control = luaL_checkinteger( L, 1 ); int control = luaL_checkinteger( L, 1 );
int property = luaL_checkinteger( L, 2 ); int property = luaL_checkinteger( L, 2 );
@@ -183,7 +183,7 @@ Load style file over global style variable (.rgs)
- Failure return nil - Failure return nil
- Success return true - Success return true
*/ */
int lguiGuiLoadStyle( lua_State *L ) { int lguiGuiLoadStyle( lua_State* L ) {
if ( FileExists( luaL_checkstring( L, 1 ) ) ) { if ( FileExists( luaL_checkstring( L, 1 ) ) ) {
GuiLoadStyle( lua_tostring( L, 1 ) ); GuiLoadStyle( lua_tostring( L, 1 ) );
lua_pushboolean( L, true ); lua_pushboolean( L, true );
@@ -201,7 +201,7 @@ int lguiGuiLoadStyle( lua_State *L ) {
Load style default over global style Load style default over global style
*/ */
int lguiGuiLoadStyleDefault( lua_State *L ) { int lguiGuiLoadStyleDefault( lua_State* L ) {
GuiLoadStyleDefault(); GuiLoadStyleDefault();
return 0; return 0;
@@ -216,7 +216,7 @@ int lguiGuiLoadStyleDefault( lua_State *L ) {
Enable gui tooltips (global state) Enable gui tooltips (global state)
*/ */
int lguiGuiEnableTooltip( lua_State *L ) { int lguiGuiEnableTooltip( lua_State* L ) {
GuiEnableTooltip(); GuiEnableTooltip();
return 0; return 0;
@@ -227,7 +227,7 @@ int lguiGuiEnableTooltip( lua_State *L ) {
Disable gui tooltips (global state) Disable gui tooltips (global state)
*/ */
int lguiGuiDisableTooltip( lua_State *L ) { int lguiGuiDisableTooltip( lua_State* L ) {
GuiDisableTooltip(); GuiDisableTooltip();
return 0; return 0;
@@ -238,7 +238,7 @@ int lguiGuiDisableTooltip( lua_State *L ) {
Set tooltip string Set tooltip string
*/ */
int lguiGuiSetTooltip( lua_State *L ) { int lguiGuiSetTooltip( lua_State* L ) {
GuiSetTooltip( luaL_checkstring( L, 1 ) ); GuiSetTooltip( luaL_checkstring( L, 1 ) );
return 0; return 0;
@@ -255,7 +255,7 @@ Get text with icon id prepended (if supported)
- Success return string - Success return string
*/ */
int lguiGuiIconText( lua_State *L ) { int lguiGuiIconText( lua_State* L ) {
int iconId = luaL_checkinteger( L, 1 ); int iconId = luaL_checkinteger( L, 1 );
if ( TextIsEqual( luaL_checkstring( L, 2 ), "" ) ) { if ( TextIsEqual( luaL_checkstring( L, 2 ), "" ) ) {
@@ -273,7 +273,7 @@ int lguiGuiIconText( lua_State *L ) {
Set icon scale (1 by default) Set icon scale (1 by default)
*/ */
int lguiGuiSetIconScale( lua_State *L ) { int lguiGuiSetIconScale( lua_State* L ) {
unsigned int scale = luaL_checkinteger( L, 1 ); unsigned int scale = luaL_checkinteger( L, 1 );
GuiSetIconScale( scale ); GuiSetIconScale( scale );
@@ -288,7 +288,7 @@ Get raygui icons data pointer
- Success return int - Success return int
*/ */
int lguiGuiGetIcons( lua_State *L ) { int lguiGuiGetIcons( lua_State* L ) {
lua_pushinteger( L, *GuiGetIcons() ); lua_pushinteger( L, *GuiGetIcons() );
return 1; return 1;
@@ -302,12 +302,12 @@ Load raygui icons file (.rgi) into internal icons data
- Failure return nil - Failure return nil
- Success return strings{} - Success return strings{}
*/ */
int lguiGuiLoadIcons( lua_State *L ) { int lguiGuiLoadIcons( lua_State* L ) {
const char *fileName = luaL_checkstring( L, 1 ); const char* fileName = luaL_checkstring( L, 1 );
bool loadIconsName = uluaGetBoolean( L, 2 ); bool loadIconsName = uluaGetBoolean( L, 2 );
if ( FileExists( fileName ) ) { if ( FileExists( fileName ) ) {
char **iconNames = GuiLoadIcons( fileName, loadIconsName ); char** iconNames = GuiLoadIcons( fileName, loadIconsName );
lua_createtable( L, 255, 0 ); lua_createtable( L, 255, 0 );
@@ -331,7 +331,7 @@ int lguiGuiLoadIcons( lua_State *L ) {
Draw icon Draw icon
*/ */
int lguiGuiDrawIcon( lua_State *L ) { int lguiGuiDrawIcon( lua_State* L ) {
int iconId = luaL_checkinteger( L, 1 ); int iconId = luaL_checkinteger( L, 1 );
Vector2 pos = uluaGetVector2( L, 2 ); Vector2 pos = uluaGetVector2( L, 2 );
int pixelSize = luaL_checkinteger( L, 3 ); int pixelSize = luaL_checkinteger( L, 3 );
@@ -353,7 +353,7 @@ Window Box control, shows a window that can be closed
- Success return int - Success return int
*/ */
int lguiGuiWindowBox( lua_State *L ) { int lguiGuiWindowBox( lua_State* L ) {
Rectangle bounds = uluaGetRectangle( L, 1 ); Rectangle bounds = uluaGetRectangle( L, 1 );
lua_pushinteger( L, GuiWindowBox( bounds, luaL_checkstring( L, 2 ) ) ); lua_pushinteger( L, GuiWindowBox( bounds, luaL_checkstring( L, 2 ) ) );
@@ -368,7 +368,7 @@ Group Box control with text name
- Success return int - Success return int
*/ */
int lguiGuiGroupBox( lua_State *L ) { int lguiGuiGroupBox( lua_State* L ) {
Rectangle bounds = uluaGetRectangle( L, 1 ); Rectangle bounds = uluaGetRectangle( L, 1 );
lua_pushinteger( L, GuiGroupBox( bounds, luaL_checkstring( L, 2 ) ) ); lua_pushinteger( L, GuiGroupBox( bounds, luaL_checkstring( L, 2 ) ) );
@@ -383,7 +383,7 @@ Line separator control, could contain text
- Success return int - Success return int
*/ */
int lguiGuiLine( lua_State *L ) { int lguiGuiLine( lua_State* L ) {
Rectangle bounds = uluaGetRectangle( L, 1 ); Rectangle bounds = uluaGetRectangle( L, 1 );
lua_pushinteger( L, GuiLine( bounds, luaL_checkstring( L, 2 ) ) ); lua_pushinteger( L, GuiLine( bounds, luaL_checkstring( L, 2 ) ) );
@@ -398,7 +398,7 @@ Panel control, useful to group controls
- Success return int - Success return int
*/ */
int lguiGuiPanel( lua_State *L ) { int lguiGuiPanel( lua_State* L ) {
Rectangle bounds = uluaGetRectangle( L, 1 ); Rectangle bounds = uluaGetRectangle( L, 1 );
lua_pushinteger( L, GuiPanel( bounds, luaL_checkstring( L, 2 ) ) ); lua_pushinteger( L, GuiPanel( bounds, luaL_checkstring( L, 2 ) ) );
@@ -413,12 +413,12 @@ Tab Bar control, returns TAB to be closed or -1
- Success return int, int - Success return int, int
*/ */
int lguiGuiTabBar( lua_State *L ) { int lguiGuiTabBar( lua_State* L ) {
Rectangle bounds = uluaGetRectangle( L, 1 ); Rectangle bounds = uluaGetRectangle( L, 1 );
int active = luaL_checkinteger( L, 3 ); int active = luaL_checkinteger( L, 3 );
int count = 0; int count = 0;
const char **text = TextSplit( luaL_checkstring( L, 2 ), ';', &count ); const char** text = TextSplit( luaL_checkstring( L, 2 ), ';', &count );
lua_pushinteger( L, GuiTabBar( bounds, text, count, &active ) ); lua_pushinteger( L, GuiTabBar( bounds, text, count, &active ) );
lua_pushinteger( L, active ); lua_pushinteger( L, active );
@@ -433,7 +433,7 @@ Scroll Panel control
- Success return int, Vector2, Rectangle - Success return int, Vector2, Rectangle
*/ */
int lguiGuiScrollPanel( lua_State *L ) { int lguiGuiScrollPanel( lua_State* L ) {
Rectangle bounds = uluaGetRectangle( L, 1 ); Rectangle bounds = uluaGetRectangle( L, 1 );
Rectangle content = uluaGetRectangle( L, 3 ); Rectangle content = uluaGetRectangle( L, 3 );
Vector2 scroll = uluaGetVector2( L, 4 ); Vector2 scroll = uluaGetVector2( L, 4 );
@@ -457,7 +457,7 @@ Label control, shows text
- Success return int - Success return int
*/ */
int lguiGuiLabel( lua_State *L ) { int lguiGuiLabel( lua_State* L ) {
Rectangle bounds = uluaGetRectangle( L, 1 ); Rectangle bounds = uluaGetRectangle( L, 1 );
lua_pushinteger( L, GuiLabel( bounds, luaL_checkstring( L, 2 ) ) ); lua_pushinteger( L, GuiLabel( bounds, luaL_checkstring( L, 2 ) ) );
@@ -472,7 +472,7 @@ Button control, returns true when clicked
- Success return int - Success return int
*/ */
int lguiGuiButton( lua_State *L ) { int lguiGuiButton( lua_State* L ) {
Rectangle bounds = uluaGetRectangle( L, 1 ); Rectangle bounds = uluaGetRectangle( L, 1 );
lua_pushinteger( L, GuiButton( bounds, luaL_checkstring( L, 2 ) ) ); lua_pushinteger( L, GuiButton( bounds, luaL_checkstring( L, 2 ) ) );
@@ -487,7 +487,7 @@ Label button control, show true when clicked
- Success return int - Success return int
*/ */
int lguiGuiLabelButton( lua_State *L ) { int lguiGuiLabelButton( lua_State* L ) {
Rectangle bounds = uluaGetRectangle( L, 1 ); Rectangle bounds = uluaGetRectangle( L, 1 );
lua_pushinteger( L, GuiLabelButton( bounds, luaL_checkstring( L, 2 ) ) ); lua_pushinteger( L, GuiLabelButton( bounds, luaL_checkstring( L, 2 ) ) );
@@ -502,7 +502,7 @@ Toggle Button control, returns true when active
- Success return int, bool - Success return int, bool
*/ */
int lguiGuiToggle( lua_State *L ) { int lguiGuiToggle( lua_State* L ) {
Rectangle bounds = uluaGetRectangle( L, 1 ); Rectangle bounds = uluaGetRectangle( L, 1 );
bool active = uluaGetBoolean( L, 3 ); bool active = uluaGetBoolean( L, 3 );
@@ -519,7 +519,7 @@ Toggle Group control, returns active toggle index
- Success return int, int - Success return int, int
*/ */
int lguiGuiToggleGroup( lua_State *L ) { int lguiGuiToggleGroup( lua_State* L ) {
Rectangle bounds = uluaGetRectangle( L, 1 ); Rectangle bounds = uluaGetRectangle( L, 1 );
int active = luaL_checkinteger( L, 3 ); int active = luaL_checkinteger( L, 3 );
@@ -536,7 +536,7 @@ Toggle Slider control, returns true when clicked
- Success return int, int - Success return int, int
*/ */
int lguiGuiToggleSlider( lua_State *L ) { int lguiGuiToggleSlider( lua_State* L ) {
Rectangle bounds = uluaGetRectangle( L, 1 ); Rectangle bounds = uluaGetRectangle( L, 1 );
int active = luaL_checkinteger( L, 3 ); int active = luaL_checkinteger( L, 3 );
@@ -553,7 +553,7 @@ Check Box control, returns true when active
- Success return bool, Rectangle - Success return bool, Rectangle
*/ */
int lguiGuiCheckBox( lua_State *L ) { int lguiGuiCheckBox( lua_State* L ) {
Rectangle bounds = uluaGetRectangle( L, 1 ); Rectangle bounds = uluaGetRectangle( L, 1 );
bool checked = uluaGetBoolean( L, 3 ); bool checked = uluaGetBoolean( L, 3 );
@@ -572,7 +572,7 @@ Combo Box control, returns selected item index
- Success return int, int - Success return int, int
*/ */
int lguiGuiComboBox( lua_State *L ) { int lguiGuiComboBox( lua_State* L ) {
Rectangle bounds = uluaGetRectangle( L, 1 ); Rectangle bounds = uluaGetRectangle( L, 1 );
int active = luaL_checkinteger( L, 3 ); int active = luaL_checkinteger( L, 3 );
@@ -589,7 +589,7 @@ Dropdown Box control, returns selected item
- Success return int, int - Success return int, int
*/ */
int lguiGuiDropdownBox( lua_State *L ) { int lguiGuiDropdownBox( lua_State* L ) {
Rectangle bounds = uluaGetRectangle( L, 1 ); Rectangle bounds = uluaGetRectangle( L, 1 );
int active = luaL_checkinteger( L, 3 ); int active = luaL_checkinteger( L, 3 );
bool editMode = uluaGetBoolean( L, 4 ); bool editMode = uluaGetBoolean( L, 4 );
@@ -607,7 +607,7 @@ Spinner control, returns selected value
- Success return int, int, Rectangle - Success return int, int, Rectangle
*/ */
int lguiGuiSpinner( lua_State *L ) { int lguiGuiSpinner( lua_State* L ) {
Rectangle bounds = uluaGetRectangle( L, 1 ); Rectangle bounds = uluaGetRectangle( L, 1 );
int value = luaL_checkinteger( L, 3 ); int value = luaL_checkinteger( L, 3 );
int minValue = luaL_checkinteger( L, 4 ); int minValue = luaL_checkinteger( L, 4 );
@@ -629,7 +629,7 @@ Value Box control, updates input text with numbers
- Success return int, int, Rectangle - Success return int, int, Rectangle
*/ */
int lguiGuiValueBox( lua_State *L ) { int lguiGuiValueBox( lua_State* L ) {
Rectangle bounds = uluaGetRectangle( L, 1 ); Rectangle bounds = uluaGetRectangle( L, 1 );
int value = luaL_checkinteger( L, 3 ); int value = luaL_checkinteger( L, 3 );
int minValue = luaL_checkinteger( L, 4 ); int minValue = luaL_checkinteger( L, 4 );
@@ -651,7 +651,7 @@ Text Box control, updates input text
- Success return int, string - Success return int, string
*/ */
int lguiGuiTextBox( lua_State *L ) { int lguiGuiTextBox( lua_State* L ) {
Rectangle bounds = uluaGetRectangle( L, 1 ); Rectangle bounds = uluaGetRectangle( L, 1 );
int textSize = luaL_checkinteger( L, 3 ); int textSize = luaL_checkinteger( L, 3 );
char text[ textSize + 1 ]; char text[ textSize + 1 ];
@@ -671,7 +671,7 @@ Slider control, returns selected value
- Success return int, float, Rectangle, Rectangle - Success return int, float, Rectangle, Rectangle
*/ */
int lguiGuiSlider( lua_State *L ) { int lguiGuiSlider( lua_State* L ) {
Rectangle bounds = uluaGetRectangle( L, 1 ); Rectangle bounds = uluaGetRectangle( L, 1 );
float value = luaL_checknumber( L, 4 ); float value = luaL_checknumber( L, 4 );
float minValue = luaL_checknumber( L, 5 ); float minValue = luaL_checknumber( L, 5 );
@@ -694,7 +694,7 @@ Slider Bar control, returns selected value
- Success return int, float, Rectangle, Rectangle - Success return int, float, Rectangle, Rectangle
*/ */
int lguiGuiSliderBar( lua_State *L ) { int lguiGuiSliderBar( lua_State* L ) {
Rectangle bounds = uluaGetRectangle( L, 1 ); Rectangle bounds = uluaGetRectangle( L, 1 );
float value = luaL_checknumber( L, 4 ); float value = luaL_checknumber( L, 4 );
float minValue = luaL_checknumber( L, 5 ); float minValue = luaL_checknumber( L, 5 );
@@ -717,7 +717,7 @@ Progress Bar control, shows current progress value
- Success return int, float, Rectangle, Rectangle - Success return int, float, Rectangle, Rectangle
*/ */
int lguiGuiProgressBar( lua_State *L ) { int lguiGuiProgressBar( lua_State* L ) {
Rectangle bounds = uluaGetRectangle( L, 1 ); Rectangle bounds = uluaGetRectangle( L, 1 );
float value = luaL_checknumber( L, 4 ); float value = luaL_checknumber( L, 4 );
float minValue = luaL_checknumber( L, 5 ); float minValue = luaL_checknumber( L, 5 );
@@ -740,7 +740,7 @@ Status Bar control, shows info text
- Success return int - Success return int
*/ */
int lguiGuiStatusBar( lua_State *L ) { int lguiGuiStatusBar( lua_State* L ) {
Rectangle bounds = uluaGetRectangle( L, 1 ); Rectangle bounds = uluaGetRectangle( L, 1 );
lua_pushinteger( L, GuiStatusBar( bounds, luaL_checkstring( L, 2 ) ) ); lua_pushinteger( L, GuiStatusBar( bounds, luaL_checkstring( L, 2 ) ) );
@@ -755,7 +755,7 @@ Dummy control for placeholders
- Success return int - Success return int
*/ */
int lguiGuiDummyRec( lua_State *L ) { int lguiGuiDummyRec( lua_State* L ) {
Rectangle bounds = uluaGetRectangle( L, 1 ); Rectangle bounds = uluaGetRectangle( L, 1 );
lua_pushinteger( L, GuiDummyRec( bounds, luaL_checkstring( L, 2 ) ) ); lua_pushinteger( L, GuiDummyRec( bounds, luaL_checkstring( L, 2 ) ) );
@@ -770,7 +770,7 @@ Grid control, returns mouse cell position
- Success return int, Vector2 - Success return int, Vector2
*/ */
int lguiGuiGrid( lua_State *L ) { int lguiGuiGrid( lua_State* L ) {
Rectangle bounds = uluaGetRectangle( L, 1 ); Rectangle bounds = uluaGetRectangle( L, 1 );
float spacing = luaL_checknumber( L, 3 ); float spacing = luaL_checknumber( L, 3 );
int subdivs = luaL_checkinteger( L, 4 ); int subdivs = luaL_checkinteger( L, 4 );
@@ -789,7 +789,7 @@ Scroll bar control
- Success return int - Success return int
*/ */
int lguiGuiScrollBar( lua_State *L ) { int lguiGuiScrollBar( lua_State* L ) {
Rectangle bounds = uluaGetRectangle( L, 1 ); Rectangle bounds = uluaGetRectangle( L, 1 );
int value = luaL_checkinteger( L, 2 ); int value = luaL_checkinteger( L, 2 );
int minValue = luaL_checkinteger( L, 3 ); int minValue = luaL_checkinteger( L, 3 );
@@ -811,7 +811,7 @@ List View control, returns selected list item index
- Success return int, int, int - Success return int, int, int
*/ */
int lguiGuiListView( lua_State *L ) { int lguiGuiListView( lua_State* L ) {
Rectangle bounds = uluaGetRectangle( L, 1 ); Rectangle bounds = uluaGetRectangle( L, 1 );
int scrollIndex = luaL_checkinteger( L, 3 ); int scrollIndex = luaL_checkinteger( L, 3 );
int active = luaL_checkinteger( L, 4 ); int active = luaL_checkinteger( L, 4 );
@@ -830,14 +830,14 @@ List View with extended parameters
- Success return int, int, int, int - Success return int, int, int, int
*/ */
int lguiGuiListViewEx( lua_State *L ) { int lguiGuiListViewEx( lua_State* L ) {
Rectangle bounds = uluaGetRectangle( L, 1 ); Rectangle bounds = uluaGetRectangle( L, 1 );
int scrollIndex = luaL_checkinteger( L, 3 ); int scrollIndex = luaL_checkinteger( L, 3 );
int active = luaL_checkinteger( L, 4 ); int active = luaL_checkinteger( L, 4 );
int focus = luaL_checkinteger( L, 5 ); int focus = luaL_checkinteger( L, 5 );
int count = 0; int count = 0;
const char **text = TextSplit( luaL_checkstring( L, 2 ), ';', &count ); const char** text = TextSplit( luaL_checkstring( L, 2 ), ';', &count );
lua_pushinteger( L, GuiListViewEx( bounds, text, count, &scrollIndex, &active, &focus ) ); lua_pushinteger( L, GuiListViewEx( bounds, text, count, &scrollIndex, &active, &focus ) );
lua_pushinteger( L, scrollIndex ); lua_pushinteger( L, scrollIndex );
@@ -854,7 +854,7 @@ Message Box control, displays a message
- Success return int - Success return int
*/ */
int lguiGuiMessageBox( lua_State *L ) { int lguiGuiMessageBox( lua_State* L ) {
Rectangle bounds = uluaGetRectangle( L, 1 ); Rectangle bounds = uluaGetRectangle( L, 1 );
lua_pushinteger( L, GuiMessageBox( bounds, luaL_checkstring( L, 2 ), luaL_checkstring( L, 3 ), luaL_checkstring( L, 4 ) ) ); lua_pushinteger( L, GuiMessageBox( bounds, luaL_checkstring( L, 2 ), luaL_checkstring( L, 3 ), luaL_checkstring( L, 4 ) ) );
@@ -869,11 +869,11 @@ Text Input Box control, ask for text, supports secret
- Success return int, string, bool - Success return int, string, bool
*/ */
int lguiGuiTextInputBox( lua_State *L ) { int lguiGuiTextInputBox( lua_State* L ) {
Rectangle bounds = uluaGetRectangle( L, 1 ); Rectangle bounds = uluaGetRectangle( L, 1 );
const char *title = luaL_checkstring( L, 2 ); const char* title = luaL_checkstring( L, 2 );
const char *message = luaL_checkstring( L, 3 ); const char* message = luaL_checkstring( L, 3 );
const char *buttons = luaL_checkstring( L, 4 ); const char* buttons = luaL_checkstring( L, 4 );
int textMaxSize = luaL_checkinteger( L, 6 ); int textMaxSize = luaL_checkinteger( L, 6 );
bool secretViewActive = uluaGetBoolean( L, 7 ); bool secretViewActive = uluaGetBoolean( L, 7 );
char text[ textMaxSize + 1 ]; char text[ textMaxSize + 1 ];
@@ -893,7 +893,7 @@ Color Picker control (multiple color controls)
- Success return int, Color - Success return int, Color
*/ */
int lguiGuiColorPicker( lua_State *L ) { int lguiGuiColorPicker( lua_State* L ) {
Rectangle bounds = uluaGetRectangle( L, 1 ); Rectangle bounds = uluaGetRectangle( L, 1 );
Color color = uluaGetColor( L, 3 ); Color color = uluaGetColor( L, 3 );
@@ -910,7 +910,7 @@ Color Panel control
- Success return int, Color - Success return int, Color
*/ */
int lguiGuiColorPanel( lua_State *L ) { int lguiGuiColorPanel( lua_State* L ) {
Rectangle bounds = uluaGetRectangle( L, 1 ); Rectangle bounds = uluaGetRectangle( L, 1 );
Color color = uluaGetColor( L, 3 ); Color color = uluaGetColor( L, 3 );
@@ -927,7 +927,7 @@ Color Bar Alpha control
- Success return int, float - Success return int, float
*/ */
int lguiGuiColorBarAlpha( lua_State *L ) { int lguiGuiColorBarAlpha( lua_State* L ) {
Rectangle bounds = uluaGetRectangle( L, 1 ); Rectangle bounds = uluaGetRectangle( L, 1 );
float alpha = luaL_checknumber( L, 3 ); float alpha = luaL_checknumber( L, 3 );
@@ -944,7 +944,7 @@ Color Bar Hue control
- Success return int, float - Success return int, float
*/ */
int lguiGuiColorBarHue( lua_State *L ) { int lguiGuiColorBarHue( lua_State* L ) {
Rectangle bounds = uluaGetRectangle( L, 1 ); Rectangle bounds = uluaGetRectangle( L, 1 );
float value = luaL_checknumber( L, 3 ); float value = luaL_checknumber( L, 3 );
@@ -961,7 +961,7 @@ Color Picker control that avoids conversion to RGB on each call (multiple color
- Success return int, Vector3 - Success return int, Vector3
*/ */
int lguiGuiColorPickerHSV( lua_State *L ) { int lguiGuiColorPickerHSV( lua_State* L ) {
Rectangle bounds = uluaGetRectangle( L, 1 ); Rectangle bounds = uluaGetRectangle( L, 1 );
Vector3 colorHsv = uluaGetVector3( L, 3 ); Vector3 colorHsv = uluaGetVector3( L, 3 );
@@ -978,7 +978,7 @@ Color Panel control that returns HSV color value, used by GuiColorPickerHSV()
- Success return int, Vector3 - Success return int, Vector3
*/ */
int lguiGuiColorPanelHSV( lua_State *L ) { int lguiGuiColorPanelHSV( lua_State* L ) {
Rectangle bounds = uluaGetRectangle( L, 1 ); Rectangle bounds = uluaGetRectangle( L, 1 );
Vector3 colorHsv = uluaGetVector3( L, 3 ); Vector3 colorHsv = uluaGetVector3( L, 3 );

File diff suppressed because it is too large Load Diff

View File

@@ -22,7 +22,7 @@ Clamp float value
- Success return float - Success return float
*/ */
int lmathClamp( lua_State *L ) { int lmathClamp( lua_State* L ) {
float value = luaL_checknumber( L, 1 ); float value = luaL_checknumber( L, 1 );
float min = luaL_checknumber( L, 2 ); float min = luaL_checknumber( L, 2 );
float max = luaL_checknumber( L, 3 ); float max = luaL_checknumber( L, 3 );
@@ -39,7 +39,7 @@ Calculate linear interpolation between two floats
- Success return float - Success return float
*/ */
int lmathLerp( lua_State *L ) { int lmathLerp( lua_State* L ) {
float start = luaL_checknumber( L, 1 ); float start = luaL_checknumber( L, 1 );
float end = luaL_checknumber( L, 2 ); float end = luaL_checknumber( L, 2 );
float amount = luaL_checknumber( L, 3 ); float amount = luaL_checknumber( L, 3 );
@@ -56,7 +56,7 @@ Normalize input value within input range
- Success return float - Success return float
*/ */
int lmathNormalize( lua_State *L ) { int lmathNormalize( lua_State* L ) {
float value = luaL_checknumber( L, 1 ); float value = luaL_checknumber( L, 1 );
float start = luaL_checknumber( L, 2 ); float start = luaL_checknumber( L, 2 );
float end = luaL_checknumber( L, 3 ); float end = luaL_checknumber( L, 3 );
@@ -73,7 +73,7 @@ Remap input value within input range to output range
- Success return float - Success return float
*/ */
int lmathRemap( lua_State *L ) { int lmathRemap( lua_State* L ) {
float value = luaL_checknumber( L, 1 ); float value = luaL_checknumber( L, 1 );
float inputStart = luaL_checknumber( L, 2 ); float inputStart = luaL_checknumber( L, 2 );
float inputEnd = luaL_checknumber( L, 3 ); float inputEnd = luaL_checknumber( L, 3 );
@@ -92,7 +92,7 @@ Wrap input value from min to max
- Success return float - Success return float
*/ */
int lmathWrap( lua_State *L ) { int lmathWrap( lua_State* L ) {
float value = luaL_checknumber( L, 1 ); float value = luaL_checknumber( L, 1 );
float min = luaL_checknumber( L, 2 ); float min = luaL_checknumber( L, 2 );
float max = luaL_checknumber( L, 3 ); float max = luaL_checknumber( L, 3 );
@@ -109,7 +109,7 @@ Check whether two given floats are almost equal
- Success return int - Success return int
*/ */
int lmathFloatEquals( lua_State *L ) { int lmathFloatEquals( lua_State* L ) {
float x = luaL_checknumber( L, 1 ); float x = luaL_checknumber( L, 1 );
float y = luaL_checknumber( L, 2 ); float y = luaL_checknumber( L, 2 );
@@ -129,7 +129,7 @@ Vector with components value 0.0f
- Success return Vector2 - Success return Vector2
*/ */
int lmathVector2Zero( lua_State *L ) { int lmathVector2Zero( lua_State* L ) {
uluaPushVector2( L, Vector2Zero() ); uluaPushVector2( L, Vector2Zero() );
return 1; return 1;
@@ -142,7 +142,7 @@ Vector with components value 1.0f
- Success return Vector2 - Success return Vector2
*/ */
int lmathVector2One( lua_State *L ) { int lmathVector2One( lua_State* L ) {
uluaPushVector2( L, Vector2One() ); uluaPushVector2( L, Vector2One() );
return 1; return 1;
@@ -155,7 +155,7 @@ Add two vectors (v1 + v2)
- Success return Vector2 - Success return Vector2
*/ */
int lmathVector2Add( lua_State *L ) { int lmathVector2Add( lua_State* L ) {
Vector2 v1 = uluaGetVector2( L, 1 ); Vector2 v1 = uluaGetVector2( L, 1 );
Vector2 v2 = uluaGetVector2( L, 2 ); Vector2 v2 = uluaGetVector2( L, 2 );
@@ -171,7 +171,7 @@ Add vector and float value
- Success return Vector2 - Success return Vector2
*/ */
int lmathVector2AddValue( lua_State *L ) { int lmathVector2AddValue( lua_State* L ) {
Vector2 v = uluaGetVector2( L, 1 ); Vector2 v = uluaGetVector2( L, 1 );
float add = luaL_checknumber( L, 2 ); float add = luaL_checknumber( L, 2 );
@@ -187,7 +187,7 @@ Subtract two vectors (v1 - v2)
- Success return Vector2 - Success return Vector2
*/ */
int lmathVector2Subtract( lua_State *L ) { int lmathVector2Subtract( lua_State* L ) {
Vector2 v1 = uluaGetVector2( L, 1 ); Vector2 v1 = uluaGetVector2( L, 1 );
Vector2 v2 = uluaGetVector2( L, 2 ); Vector2 v2 = uluaGetVector2( L, 2 );
@@ -203,7 +203,7 @@ Subtract vector by float value
- Success return Vector2 - Success return Vector2
*/ */
int lmathVector2SubtractValue( lua_State *L ) { int lmathVector2SubtractValue( lua_State* L ) {
Vector2 v = uluaGetVector2( L, 1 ); Vector2 v = uluaGetVector2( L, 1 );
float sub = luaL_checknumber( L, 2 ); float sub = luaL_checknumber( L, 2 );
@@ -219,7 +219,7 @@ Calculate vector length
- Success return float - Success return float
*/ */
int lmathVector2Length( lua_State *L ) { int lmathVector2Length( lua_State* L ) {
Vector2 v = uluaGetVector2( L, 1 ); Vector2 v = uluaGetVector2( L, 1 );
lua_pushnumber( L, Vector2Length( v ) ); lua_pushnumber( L, Vector2Length( v ) );
@@ -234,7 +234,7 @@ Calculate vector square length
- Success return float - Success return float
*/ */
int lmathVector2LengthSqr( lua_State *L ) { int lmathVector2LengthSqr( lua_State* L ) {
Vector2 v = uluaGetVector2( L, 1 ); Vector2 v = uluaGetVector2( L, 1 );
lua_pushnumber( L, Vector2LengthSqr( v ) ); lua_pushnumber( L, Vector2LengthSqr( v ) );
@@ -249,7 +249,7 @@ Calculate two vectors dot product
- Success return float - Success return float
*/ */
int lmathVector2DotProduct( lua_State *L ) { int lmathVector2DotProduct( lua_State* L ) {
Vector2 v1 = uluaGetVector2( L, 1 ); Vector2 v1 = uluaGetVector2( L, 1 );
Vector2 v2 = uluaGetVector2( L, 2 ); Vector2 v2 = uluaGetVector2( L, 2 );
@@ -265,7 +265,7 @@ Calculate distance between two vectors
- Success return float - Success return float
*/ */
int lmathVector2Distance( lua_State *L ) { int lmathVector2Distance( lua_State* L ) {
Vector2 v1 = uluaGetVector2( L, 1 ); Vector2 v1 = uluaGetVector2( L, 1 );
Vector2 v2 = uluaGetVector2( L, 2 ); Vector2 v2 = uluaGetVector2( L, 2 );
@@ -281,7 +281,7 @@ Calculate square distance between two vectors
- Success return float - Success return float
*/ */
int lmathVector2DistanceSqr( lua_State *L ) { int lmathVector2DistanceSqr( lua_State* L ) {
Vector2 v1 = uluaGetVector2( L, 1 ); Vector2 v1 = uluaGetVector2( L, 1 );
Vector2 v2 = uluaGetVector2( L, 2 ); Vector2 v2 = uluaGetVector2( L, 2 );
@@ -298,7 +298,7 @@ NOTE: Angle is calculated from origin point (0, 0)
- Success return float - Success return float
*/ */
int lmathVector2Angle( lua_State *L ) { int lmathVector2Angle( lua_State* L ) {
Vector2 v1 = uluaGetVector2( L, 1 ); Vector2 v1 = uluaGetVector2( L, 1 );
Vector2 v2 = uluaGetVector2( L, 2 ); Vector2 v2 = uluaGetVector2( L, 2 );
@@ -316,7 +316,7 @@ Current implementation should be aligned with glm::angle
- Success return float - Success return float
*/ */
int lmathVector2LineAngle( lua_State *L ) { int lmathVector2LineAngle( lua_State* L ) {
Vector2 start = uluaGetVector2( L, 1 ); Vector2 start = uluaGetVector2( L, 1 );
Vector2 end = uluaGetVector2( L, 2 ); Vector2 end = uluaGetVector2( L, 2 );
@@ -332,7 +332,7 @@ Scale vector (multiply by value)
- Success return Vector2 - Success return Vector2
*/ */
int lmathVector2Scale( lua_State *L ) { int lmathVector2Scale( lua_State* L ) {
Vector2 v = uluaGetVector2( L, 1 ); Vector2 v = uluaGetVector2( L, 1 );
float scale = luaL_checknumber( L, 2 ); float scale = luaL_checknumber( L, 2 );
@@ -348,7 +348,7 @@ Multiply vector by vector
- Success return Vector2 - Success return Vector2
*/ */
int lmathVector2Multiply( lua_State *L ) { int lmathVector2Multiply( lua_State* L ) {
Vector2 v1 = uluaGetVector2( L, 1 ); Vector2 v1 = uluaGetVector2( L, 1 );
Vector2 v2 = uluaGetVector2( L, 2 ); Vector2 v2 = uluaGetVector2( L, 2 );
@@ -364,7 +364,7 @@ Negate vector
- Success return Vector2 - Success return Vector2
*/ */
int lmathVector2Negate( lua_State *L ) { int lmathVector2Negate( lua_State* L ) {
Vector2 v = uluaGetVector2( L, 1 ); Vector2 v = uluaGetVector2( L, 1 );
uluaPushVector2( L, Vector2Negate( v ) ); uluaPushVector2( L, Vector2Negate( v ) );
@@ -379,7 +379,7 @@ Divide vector by vector
- Success return Vector2 - Success return Vector2
*/ */
int lmathVector2Divide( lua_State *L ) { int lmathVector2Divide( lua_State* L ) {
Vector2 v1 = uluaGetVector2( L, 1 ); Vector2 v1 = uluaGetVector2( L, 1 );
Vector2 v2 = uluaGetVector2( L, 2 ); Vector2 v2 = uluaGetVector2( L, 2 );
@@ -395,7 +395,7 @@ Normalize provided vector
- Success return Vector2 - Success return Vector2
*/ */
int lmathVector2Normalize( lua_State *L ) { int lmathVector2Normalize( lua_State* L ) {
Vector2 v = uluaGetVector2( L, 1 ); Vector2 v = uluaGetVector2( L, 1 );
uluaPushVector2( L, Vector2Normalize( v ) ); uluaPushVector2( L, Vector2Normalize( v ) );
@@ -410,7 +410,7 @@ Transforms a Vector2 by a given Matrix
- Success return Vector2 - Success return Vector2
*/ */
int lmathVector2Transform( lua_State *L ) { int lmathVector2Transform( lua_State* L ) {
Vector2 v = uluaGetVector2( L, 1 ); Vector2 v = uluaGetVector2( L, 1 );
Matrix mat = uluaGetMatrix( L, 2 ); Matrix mat = uluaGetMatrix( L, 2 );
@@ -426,7 +426,7 @@ Calculate linear interpolation between two vectors
- Success return Vector2 - Success return Vector2
*/ */
int lmathVector2Lerp( lua_State *L ) { int lmathVector2Lerp( lua_State* L ) {
Vector2 v1 = uluaGetVector2( L, 1 ); Vector2 v1 = uluaGetVector2( L, 1 );
Vector2 v2 = uluaGetVector2( L, 2 ); Vector2 v2 = uluaGetVector2( L, 2 );
float amount = luaL_checknumber( L, 3 ); float amount = luaL_checknumber( L, 3 );
@@ -443,7 +443,7 @@ Calculate reflected vector to normal
- Success return Vector2 - Success return Vector2
*/ */
int lmathVector2Reflect( lua_State *L ) { int lmathVector2Reflect( lua_State* L ) {
Vector2 v1 = uluaGetVector2( L, 1 ); Vector2 v1 = uluaGetVector2( L, 1 );
Vector2 v2 = uluaGetVector2( L, 2 ); Vector2 v2 = uluaGetVector2( L, 2 );
@@ -459,7 +459,7 @@ Rotate vector by angle
- Success return Vector2 - Success return Vector2
*/ */
int lmathVector2Rotate( lua_State *L ) { int lmathVector2Rotate( lua_State* L ) {
Vector2 v = uluaGetVector2( L, 1 ); Vector2 v = uluaGetVector2( L, 1 );
float degs = luaL_checknumber( L, 2 ); float degs = luaL_checknumber( L, 2 );
@@ -475,7 +475,7 @@ Move Vector towards target
- Success return Vector2 - Success return Vector2
*/ */
int lmathVector2MoveTowards( lua_State *L ) { int lmathVector2MoveTowards( lua_State* L ) {
Vector2 v1 = uluaGetVector2( L, 1 ); Vector2 v1 = uluaGetVector2( L, 1 );
Vector2 v2 = uluaGetVector2( L, 2 ); Vector2 v2 = uluaGetVector2( L, 2 );
float maxDistance = luaL_checknumber( L, 3 ); float maxDistance = luaL_checknumber( L, 3 );
@@ -492,7 +492,7 @@ Invert the given vector
- Success return Vector2 - Success return Vector2
*/ */
int lmathVector2Invert( lua_State *L ) { int lmathVector2Invert( lua_State* L ) {
Vector2 v = uluaGetVector2( L, 1 ); Vector2 v = uluaGetVector2( L, 1 );
uluaPushVector2( L, Vector2Invert( v ) ); uluaPushVector2( L, Vector2Invert( v ) );
@@ -508,7 +508,7 @@ min and max values specified by the given vectors
- Success return Vector2 - Success return Vector2
*/ */
int lmathVector2Clamp( lua_State *L ) { int lmathVector2Clamp( lua_State* L ) {
Vector2 v = uluaGetVector2( L, 1 ); Vector2 v = uluaGetVector2( L, 1 );
Vector2 min = uluaGetVector2( L, 2 ); Vector2 min = uluaGetVector2( L, 2 );
Vector2 max = uluaGetVector2( L, 3 ); Vector2 max = uluaGetVector2( L, 3 );
@@ -525,7 +525,7 @@ Clamp the magnitude of the vector between two min and max values
- Success return Vector2 - Success return Vector2
*/ */
int lmathVector2ClampValue( lua_State *L ) { int lmathVector2ClampValue( lua_State* L ) {
Vector2 v = uluaGetVector2( L, 1 ); Vector2 v = uluaGetVector2( L, 1 );
float min = luaL_checknumber( L, 2 ); float min = luaL_checknumber( L, 2 );
float max = luaL_checknumber( L, 3 ); float max = luaL_checknumber( L, 3 );
@@ -542,7 +542,7 @@ Check whether two given vectors are almost equal
- Success return int - Success return int
*/ */
int lmathVector2Equals( lua_State *L ) { int lmathVector2Equals( lua_State* L ) {
Vector2 v1 = uluaGetVector2( L, 1 ); Vector2 v1 = uluaGetVector2( L, 1 );
Vector2 v2 = uluaGetVector2( L, 2 ); Vector2 v2 = uluaGetVector2( L, 2 );
@@ -562,7 +562,7 @@ Vector with components value 0.0f
- Success return Vector3 - Success return Vector3
*/ */
int lmathVector3Zero( lua_State *L ) { int lmathVector3Zero( lua_State* L ) {
uluaPushVector3( L, Vector3Zero() ); uluaPushVector3( L, Vector3Zero() );
return 1; return 1;
@@ -575,7 +575,7 @@ Vector with components value 1.0f
- Success return Vector3 - Success return Vector3
*/ */
int lmathVector3One( lua_State *L ) { int lmathVector3One( lua_State* L ) {
uluaPushVector3( L, Vector3One() ); uluaPushVector3( L, Vector3One() );
return 1; return 1;
@@ -588,7 +588,7 @@ Add two vectors
- Success return Vector3 - Success return Vector3
*/ */
int lmathVector3Add( lua_State *L ) { int lmathVector3Add( lua_State* L ) {
Vector3 v1 = uluaGetVector3( L, 1 ); Vector3 v1 = uluaGetVector3( L, 1 );
Vector3 v2 = uluaGetVector3( L, 2 ); Vector3 v2 = uluaGetVector3( L, 2 );
@@ -604,7 +604,7 @@ Add vector and float value
- Success return Vector3 - Success return Vector3
*/ */
int lmathVector3AddValue( lua_State *L ) { int lmathVector3AddValue( lua_State* L ) {
Vector3 v = uluaGetVector3( L, 1 ); Vector3 v = uluaGetVector3( L, 1 );
float add = luaL_checknumber( L, 2 ); float add = luaL_checknumber( L, 2 );
@@ -620,7 +620,7 @@ Subtract two vectors
- Success return Vector3 - Success return Vector3
*/ */
int lmathVector3Subtract( lua_State *L ) { int lmathVector3Subtract( lua_State* L ) {
Vector3 v1 = uluaGetVector3( L, 1 ); Vector3 v1 = uluaGetVector3( L, 1 );
Vector3 v2 = uluaGetVector3( L, 2 ); Vector3 v2 = uluaGetVector3( L, 2 );
@@ -636,7 +636,7 @@ Subtract vector by float value
- Success return Vector3 - Success return Vector3
*/ */
int lmathVector3SubtractValue( lua_State *L ) { int lmathVector3SubtractValue( lua_State* L ) {
Vector3 v = uluaGetVector3( L, 1 ); Vector3 v = uluaGetVector3( L, 1 );
float sub = luaL_checknumber( L, 2 ); float sub = luaL_checknumber( L, 2 );
@@ -652,7 +652,7 @@ Multiply vector by scalar
- Success return Vector3 - Success return Vector3
*/ */
int lmathVector3Scale( lua_State *L ) { int lmathVector3Scale( lua_State* L ) {
Vector3 v = uluaGetVector3( L, 1 ); Vector3 v = uluaGetVector3( L, 1 );
float scalar = luaL_checknumber( L, 2 ); float scalar = luaL_checknumber( L, 2 );
@@ -668,7 +668,7 @@ Multiply vector by vector
- Success return Vector3 - Success return Vector3
*/ */
int lmathVector3Multiply( lua_State *L ) { int lmathVector3Multiply( lua_State* L ) {
Vector3 v1 = uluaGetVector3( L, 1 ); Vector3 v1 = uluaGetVector3( L, 1 );
Vector3 v2 = uluaGetVector3( L, 2 ); Vector3 v2 = uluaGetVector3( L, 2 );
@@ -684,7 +684,7 @@ Calculate two vectors cross product
- Success return Vector3 - Success return Vector3
*/ */
int lmathVector3CrossProduct( lua_State *L ) { int lmathVector3CrossProduct( lua_State* L ) {
Vector3 v1 = uluaGetVector3( L, 1 ); Vector3 v1 = uluaGetVector3( L, 1 );
Vector3 v2 = uluaGetVector3( L, 2 ); Vector3 v2 = uluaGetVector3( L, 2 );
@@ -700,7 +700,7 @@ Calculate one vector perpendicular vector
- Success return Vector3 - Success return Vector3
*/ */
int lmathVector3Perpendicular( lua_State *L ) { int lmathVector3Perpendicular( lua_State* L ) {
Vector3 v = uluaGetVector3( L, 1 ); Vector3 v = uluaGetVector3( L, 1 );
uluaPushVector3( L, Vector3Perpendicular( v ) ); uluaPushVector3( L, Vector3Perpendicular( v ) );
@@ -715,7 +715,7 @@ Calculate vector length
- Success return float - Success return float
*/ */
int lmathVector3Length( lua_State *L ) { int lmathVector3Length( lua_State* L ) {
Vector3 v = uluaGetVector3( L, 1 ); Vector3 v = uluaGetVector3( L, 1 );
lua_pushnumber( L, Vector3Length( v ) ); lua_pushnumber( L, Vector3Length( v ) );
@@ -730,7 +730,7 @@ Calculate vector square length
- Success return float - Success return float
*/ */
int lmathVector3LengthSqr( lua_State *L ) { int lmathVector3LengthSqr( lua_State* L ) {
Vector3 v = uluaGetVector3( L, 1 ); Vector3 v = uluaGetVector3( L, 1 );
lua_pushnumber( L, Vector3LengthSqr( v ) ); lua_pushnumber( L, Vector3LengthSqr( v ) );
@@ -745,7 +745,7 @@ Calculate two vectors dot product
- Success return float - Success return float
*/ */
int lmathVector3DotProduct( lua_State *L ) { int lmathVector3DotProduct( lua_State* L ) {
Vector3 v1 = uluaGetVector3( L, 1 ); Vector3 v1 = uluaGetVector3( L, 1 );
Vector3 v2 = uluaGetVector3( L, 2 ); Vector3 v2 = uluaGetVector3( L, 2 );
@@ -761,7 +761,7 @@ Calculate distance between two vectors
- Success return float - Success return float
*/ */
int lmathVector3Distance( lua_State *L ) { int lmathVector3Distance( lua_State* L ) {
Vector3 v1 = uluaGetVector3( L, 1 ); Vector3 v1 = uluaGetVector3( L, 1 );
Vector3 v2 = uluaGetVector3( L, 2 ); Vector3 v2 = uluaGetVector3( L, 2 );
@@ -777,7 +777,7 @@ Calculate square distance between two vectors
- Success return float - Success return float
*/ */
int lmathVector3DistanceSqr( lua_State *L ) { int lmathVector3DistanceSqr( lua_State* L ) {
Vector3 v1 = uluaGetVector3( L, 1 ); Vector3 v1 = uluaGetVector3( L, 1 );
Vector3 v2 = uluaGetVector3( L, 2 ); Vector3 v2 = uluaGetVector3( L, 2 );
@@ -793,7 +793,7 @@ Calculate angle between two vectors
- Success return float - Success return float
*/ */
int lmathVector3Angle( lua_State *L ) { int lmathVector3Angle( lua_State* L ) {
Vector3 v1 = uluaGetVector3( L, 1 ); Vector3 v1 = uluaGetVector3( L, 1 );
Vector3 v2 = uluaGetVector3( L, 2 ); Vector3 v2 = uluaGetVector3( L, 2 );
@@ -809,7 +809,7 @@ Negate provided vector (invert direction)
- Success return Vector3 - Success return Vector3
*/ */
int lmathVector3Negate( lua_State *L ) { int lmathVector3Negate( lua_State* L ) {
Vector3 v = uluaGetVector3( L, 1 ); Vector3 v = uluaGetVector3( L, 1 );
uluaPushVector3( L, Vector3Negate( v ) ); uluaPushVector3( L, Vector3Negate( v ) );
@@ -824,7 +824,7 @@ Divide vector by vector
- Success return Vector3 - Success return Vector3
*/ */
int lmathVector3Divide( lua_State *L ) { int lmathVector3Divide( lua_State* L ) {
Vector3 v1 = uluaGetVector3( L, 1 ); Vector3 v1 = uluaGetVector3( L, 1 );
Vector3 v2 = uluaGetVector3( L, 2 ); Vector3 v2 = uluaGetVector3( L, 2 );
@@ -840,7 +840,7 @@ Normalize provided vector
- Success return Vector3 - Success return Vector3
*/ */
int lmathVector3Normalize( lua_State *L ) { int lmathVector3Normalize( lua_State* L ) {
Vector3 v = uluaGetVector3( L, 1 ); Vector3 v = uluaGetVector3( L, 1 );
uluaPushVector3( L, Vector3Normalize( v ) ); uluaPushVector3( L, Vector3Normalize( v ) );
@@ -856,7 +856,7 @@ Gram-Schmidt function implementation
- Success return Vector3, Vector3 - Success return Vector3, Vector3
*/ */
int lmathVector3OrthoNormalize( lua_State *L ) { int lmathVector3OrthoNormalize( lua_State* L ) {
Vector3 v1 = uluaGetVector3( L, 1 ); Vector3 v1 = uluaGetVector3( L, 1 );
Vector3 v2 = uluaGetVector3( L, 2 ); Vector3 v2 = uluaGetVector3( L, 2 );
@@ -875,7 +875,7 @@ Transforms a Vector3 by a given Matrix
- Success return Vector3 - Success return Vector3
*/ */
int lmathVector3Transform( lua_State *L ) { int lmathVector3Transform( lua_State* L ) {
Vector3 v = uluaGetVector3( L, 1 ); Vector3 v = uluaGetVector3( L, 1 );
Matrix mat = uluaGetMatrix( L, 2 ); Matrix mat = uluaGetMatrix( L, 2 );
@@ -891,7 +891,7 @@ Transform a vector by quaternion rotation
- Success return Vector3 - Success return Vector3
*/ */
int lmathVector3RotateByQuaternion( lua_State *L ) { int lmathVector3RotateByQuaternion( lua_State* L ) {
Vector3 v = uluaGetVector3( L, 1 ); Vector3 v = uluaGetVector3( L, 1 );
Quaternion q = uluaGetQuaternion( L, 2 ); Quaternion q = uluaGetQuaternion( L, 2 );
@@ -907,7 +907,7 @@ Rotates a vector around an axis
- Success return Vector3 - Success return Vector3
*/ */
int lmathVector3RotateByAxisAngle( lua_State *L ) { int lmathVector3RotateByAxisAngle( lua_State* L ) {
Vector3 v = uluaGetVector3( L, 1 ); Vector3 v = uluaGetVector3( L, 1 );
Vector3 axis = uluaGetVector3( L, 2 ); Vector3 axis = uluaGetVector3( L, 2 );
float angle = luaL_checknumber( L, 3 ); float angle = luaL_checknumber( L, 3 );
@@ -924,7 +924,7 @@ Calculate linear interpolation between two vectors
- Success return Vector3 - Success return Vector3
*/ */
int lmathVector3Lerp( lua_State *L ) { int lmathVector3Lerp( lua_State* L ) {
Vector3 v1 = uluaGetVector3( L, 1 ); Vector3 v1 = uluaGetVector3( L, 1 );
Vector3 v2 = uluaGetVector3( L, 2 ); Vector3 v2 = uluaGetVector3( L, 2 );
float amount = luaL_checknumber( L, 3 ); float amount = luaL_checknumber( L, 3 );
@@ -941,7 +941,7 @@ Calculate reflected vector to normal
- Success return Vector3 - Success return Vector3
*/ */
int lmathVector3Reflect( lua_State *L ) { int lmathVector3Reflect( lua_State* L ) {
Vector3 v = uluaGetVector3( L, 1 ); Vector3 v = uluaGetVector3( L, 1 );
Vector3 normal = uluaGetVector3( L, 2 ); Vector3 normal = uluaGetVector3( L, 2 );
@@ -957,7 +957,7 @@ Get min value for each pair of components
- Success return Vector3 - Success return Vector3
*/ */
int lmathVector3Min( lua_State *L ) { int lmathVector3Min( lua_State* L ) {
Vector3 v1 = uluaGetVector3( L, 1 ); Vector3 v1 = uluaGetVector3( L, 1 );
Vector3 v2 = uluaGetVector3( L, 2 ); Vector3 v2 = uluaGetVector3( L, 2 );
@@ -973,7 +973,7 @@ Get max value for each pair of components
- Success return Vector3 - Success return Vector3
*/ */
int lmathVector3Max( lua_State *L ) { int lmathVector3Max( lua_State* L ) {
Vector3 v1 = uluaGetVector3( L, 1 ); Vector3 v1 = uluaGetVector3( L, 1 );
Vector3 v2 = uluaGetVector3( L, 2 ); Vector3 v2 = uluaGetVector3( L, 2 );
@@ -990,7 +990,7 @@ NOTE: Assumes P is on the plane of the triangle
- Success return Vector3 - Success return Vector3
*/ */
int lmathVector3Barycenter( lua_State *L ) { int lmathVector3Barycenter( lua_State* L ) {
Vector3 p = uluaGetVector3( L, 1 ); Vector3 p = uluaGetVector3( L, 1 );
Vector3 a = uluaGetVector3( L, 2 ); Vector3 a = uluaGetVector3( L, 2 );
Vector3 b = uluaGetVector3( L, 3 ); Vector3 b = uluaGetVector3( L, 3 );
@@ -1009,7 +1009,7 @@ NOTE: We are avoiding calling other raymath functions despite available
- Success return Vector3 - Success return Vector3
*/ */
int lmathVector3Unproject( lua_State *L ) { int lmathVector3Unproject( lua_State* L ) {
Vector3 source = uluaGetVector3( L, 1 ); Vector3 source = uluaGetVector3( L, 1 );
Matrix projection = uluaGetMatrix( L, 2 ); Matrix projection = uluaGetMatrix( L, 2 );
Matrix view = uluaGetMatrix( L, 3 ); Matrix view = uluaGetMatrix( L, 3 );
@@ -1026,7 +1026,7 @@ Invert the given vector
- Success return Vector3 - Success return Vector3
*/ */
int lmathVector3Invert( lua_State *L ) { int lmathVector3Invert( lua_State* L ) {
Vector3 v = uluaGetVector3( L, 1 ); Vector3 v = uluaGetVector3( L, 1 );
uluaPushVector3( L, Vector3Invert( v ) ); uluaPushVector3( L, Vector3Invert( v ) );
@@ -1042,7 +1042,7 @@ min and max values specified by the given vectors
- Success return Vector3 - Success return Vector3
*/ */
int lmathVector3Clamp( lua_State *L ) { int lmathVector3Clamp( lua_State* L ) {
Vector3 v = uluaGetVector3( L, 1 ); Vector3 v = uluaGetVector3( L, 1 );
Vector3 min = uluaGetVector3( L, 2 ); Vector3 min = uluaGetVector3( L, 2 );
Vector3 max = uluaGetVector3( L, 3 ); Vector3 max = uluaGetVector3( L, 3 );
@@ -1059,7 +1059,7 @@ Clamp the magnitude of the vector between two values
- Success return Vector3 - Success return Vector3
*/ */
int lmathVector3ClampValue( lua_State *L ) { int lmathVector3ClampValue( lua_State* L ) {
Vector3 v = uluaGetVector3( L, 1 ); Vector3 v = uluaGetVector3( L, 1 );
float min = luaL_checknumber( L, 2 ); float min = luaL_checknumber( L, 2 );
float max = luaL_checknumber( L, 3 ); float max = luaL_checknumber( L, 3 );
@@ -1076,7 +1076,7 @@ Check whether two given vectors are almost equal
- Success return int - Success return int
*/ */
int lmathVector3Equals( lua_State *L ) { int lmathVector3Equals( lua_State* L ) {
Vector3 v1 = uluaGetVector3( L, 1 ); Vector3 v1 = uluaGetVector3( L, 1 );
Vector3 v2 = uluaGetVector3( L, 2 ); Vector3 v2 = uluaGetVector3( L, 2 );
@@ -1097,7 +1097,7 @@ on the other side of the surface
- Success return Vector3 - Success return Vector3
*/ */
int lmathVector3Refract( lua_State *L ) { int lmathVector3Refract( lua_State* L ) {
Vector3 v = uluaGetVector3( L, 1 ); Vector3 v = uluaGetVector3( L, 1 );
Vector3 n = uluaGetVector3( L, 2 ); Vector3 n = uluaGetVector3( L, 2 );
float r = luaL_checknumber( L, 3 ); float r = luaL_checknumber( L, 3 );
@@ -1118,7 +1118,7 @@ Compute matrix determinant
- Success return float - Success return float
*/ */
int lmathMatrixDeterminant( lua_State *L ) { int lmathMatrixDeterminant( lua_State* L ) {
Matrix mat = uluaGetMatrix( L, 1 ); Matrix mat = uluaGetMatrix( L, 1 );
lua_pushnumber( L, MatrixDeterminant( mat ) ); lua_pushnumber( L, MatrixDeterminant( mat ) );
@@ -1133,7 +1133,7 @@ Get the trace of the matrix (sum of the values along the diagonal)
- Success return float - Success return float
*/ */
int lmathMatrixTrace( lua_State *L ) { int lmathMatrixTrace( lua_State* L ) {
Matrix mat = uluaGetMatrix( L, 1 ); Matrix mat = uluaGetMatrix( L, 1 );
lua_pushnumber( L, MatrixTrace( mat ) ); lua_pushnumber( L, MatrixTrace( mat ) );
@@ -1148,7 +1148,7 @@ Transposes provided matrix
- Success return Matrix - Success return Matrix
*/ */
int lmathMatrixTranspose( lua_State *L ) { int lmathMatrixTranspose( lua_State* L ) {
Matrix mat = uluaGetMatrix( L, 1 ); Matrix mat = uluaGetMatrix( L, 1 );
uluaPushMatrix( L, MatrixTranspose( mat ) ); uluaPushMatrix( L, MatrixTranspose( mat ) );
@@ -1163,7 +1163,7 @@ Invert provided matrix
- Success return Matrix - Success return Matrix
*/ */
int lmathMatrixInvert( lua_State *L ) { int lmathMatrixInvert( lua_State* L ) {
Matrix mat = uluaGetMatrix( L, 1 ); Matrix mat = uluaGetMatrix( L, 1 );
uluaPushMatrix( L, MatrixInvert( mat ) ); uluaPushMatrix( L, MatrixInvert( mat ) );
@@ -1178,7 +1178,7 @@ Get identity matrix
- Success return Matrix - Success return Matrix
*/ */
int lmathMatrixIdentity( lua_State *L ) { int lmathMatrixIdentity( lua_State* L ) {
uluaPushMatrix( L, MatrixIdentity() ); uluaPushMatrix( L, MatrixIdentity() );
return 1; return 1;
@@ -1191,7 +1191,7 @@ Add two matrices
- Success return Matrix - Success return Matrix
*/ */
int lmathMatrixAdd( lua_State *L ) { int lmathMatrixAdd( lua_State* L ) {
Matrix mat1 = uluaGetMatrix( L, 1 ); Matrix mat1 = uluaGetMatrix( L, 1 );
Matrix mat2 = uluaGetMatrix( L, 2 ); Matrix mat2 = uluaGetMatrix( L, 2 );
@@ -1207,7 +1207,7 @@ Subtract two matrices (left - right)
- Success return Matrix - Success return Matrix
*/ */
int lmathMatrixSubtract( lua_State *L ) { int lmathMatrixSubtract( lua_State* L ) {
Matrix mat1 = uluaGetMatrix( L, 1 ); Matrix mat1 = uluaGetMatrix( L, 1 );
Matrix mat2 = uluaGetMatrix( L, 2 ); Matrix mat2 = uluaGetMatrix( L, 2 );
@@ -1223,7 +1223,7 @@ Get two matrix multiplication
- Success return Matrix - Success return Matrix
*/ */
int lmathMatrixMultiply( lua_State *L ) { int lmathMatrixMultiply( lua_State* L ) {
Matrix mat1 = uluaGetMatrix( L, 1 ); Matrix mat1 = uluaGetMatrix( L, 1 );
Matrix mat2 = uluaGetMatrix( L, 2 ); Matrix mat2 = uluaGetMatrix( L, 2 );
@@ -1239,7 +1239,7 @@ Get translation matrix
- Success return Matrix - Success return Matrix
*/ */
int lmathMatrixTranslate( lua_State *L ) { int lmathMatrixTranslate( lua_State* L ) {
Vector3 v = uluaGetVector3( L, 1 ); Vector3 v = uluaGetVector3( L, 1 );
uluaPushMatrix( L, MatrixTranslate( v.x, v.y, v.z ) ); uluaPushMatrix( L, MatrixTranslate( v.x, v.y, v.z ) );
@@ -1254,7 +1254,7 @@ Create rotation matrix from axis and angle. NOTE: Angle should be provided in ra
- Success return Matrix - Success return Matrix
*/ */
int lmathMatrixRotate( lua_State *L ) { int lmathMatrixRotate( lua_State* L ) {
Vector3 axis = uluaGetVector3( L, 1 ); Vector3 axis = uluaGetVector3( L, 1 );
float angle = luaL_checknumber( L, 2 ); float angle = luaL_checknumber( L, 2 );
@@ -1270,7 +1270,7 @@ Get x-rotation matrix (angle in radians)
- Success return Matrix - Success return Matrix
*/ */
int lmathMatrixRotateX( lua_State *L ) { int lmathMatrixRotateX( lua_State* L ) {
float angle = luaL_checknumber( L, 1 ); float angle = luaL_checknumber( L, 1 );
uluaPushMatrix( L, MatrixRotateX( angle ) ); uluaPushMatrix( L, MatrixRotateX( angle ) );
@@ -1285,7 +1285,7 @@ Get y-rotation matrix (angle in radians)
- Success return Matrix - Success return Matrix
*/ */
int lmathMatrixRotateY( lua_State *L ) { int lmathMatrixRotateY( lua_State* L ) {
float angle = luaL_checknumber( L, 1 ); float angle = luaL_checknumber( L, 1 );
uluaPushMatrix( L, MatrixRotateY( angle ) ); uluaPushMatrix( L, MatrixRotateY( angle ) );
@@ -1300,7 +1300,7 @@ Get z-rotation matrix (angle in radians)
- Success return Matrix - Success return Matrix
*/ */
int lmathMatrixRotateZ( lua_State *L ) { int lmathMatrixRotateZ( lua_State* L ) {
float angle = luaL_checknumber( L, 1 ); float angle = luaL_checknumber( L, 1 );
uluaPushMatrix( L, MatrixRotateZ( angle ) ); uluaPushMatrix( L, MatrixRotateZ( angle ) );
@@ -1315,7 +1315,7 @@ Get xyz-rotation matrix (angles in radians)
- Success return Matrix - Success return Matrix
*/ */
int lmathMatrixRotateXYZ( lua_State *L ) { int lmathMatrixRotateXYZ( lua_State* L ) {
Vector3 angle = uluaGetVector3( L, 1 ); Vector3 angle = uluaGetVector3( L, 1 );
uluaPushMatrix( L, MatrixRotateXYZ( angle ) ); uluaPushMatrix( L, MatrixRotateXYZ( angle ) );
@@ -1330,7 +1330,7 @@ Get zyx-rotation matrix (angles in radians)
- Success return Matrix - Success return Matrix
*/ */
int lmathMatrixRotateZYX( lua_State *L ) { int lmathMatrixRotateZYX( lua_State* L ) {
Vector3 angle = uluaGetVector3( L, 1 ); Vector3 angle = uluaGetVector3( L, 1 );
uluaPushMatrix( L, MatrixRotateZYX( angle ) ); uluaPushMatrix( L, MatrixRotateZYX( angle ) );
@@ -1345,7 +1345,7 @@ Get scaling matrix
- Success return Matrix - Success return Matrix
*/ */
int lmathMatrixScale( lua_State *L ) { int lmathMatrixScale( lua_State* L ) {
Vector3 v = uluaGetVector3( L, 1 ); Vector3 v = uluaGetVector3( L, 1 );
uluaPushMatrix( L, MatrixScale( v.x, v.y, v.z ) ); uluaPushMatrix( L, MatrixScale( v.x, v.y, v.z ) );
@@ -1360,7 +1360,7 @@ Get perspective projection matrix
- Success return Matrix - Success return Matrix
*/ */
int lmathMatrixFrustum( lua_State *L ) { int lmathMatrixFrustum( lua_State* L ) {
float left = luaL_checknumber( L, 1 ); float left = luaL_checknumber( L, 1 );
float right = luaL_checknumber( L, 2); float right = luaL_checknumber( L, 2);
float bottom = luaL_checknumber( L, 3 ); float bottom = luaL_checknumber( L, 3 );
@@ -1380,7 +1380,7 @@ Get perspective projection matrix
- Success return Matrix - Success return Matrix
*/ */
int lmathMatrixPerspective( lua_State *L ) { int lmathMatrixPerspective( lua_State* L ) {
float fovy = luaL_checknumber( L, 1 ); float fovy = luaL_checknumber( L, 1 );
float aspect = luaL_checknumber( L, 2 ); float aspect = luaL_checknumber( L, 2 );
float near = luaL_checknumber( L, 3 ); float near = luaL_checknumber( L, 3 );
@@ -1398,7 +1398,7 @@ Get orthographic projection matrix
- Success return Matrix - Success return Matrix
*/ */
int lmathMatrixOrtho( lua_State *L ) { int lmathMatrixOrtho( lua_State* L ) {
float left = luaL_checknumber( L, 1 ); float left = luaL_checknumber( L, 1 );
float right = luaL_checknumber( L, 2 ); float right = luaL_checknumber( L, 2 );
float bottom = luaL_checknumber( L, 3 ); float bottom = luaL_checknumber( L, 3 );
@@ -1418,7 +1418,7 @@ Get camera look-at matrix (View matrix)
- Success return Matrix - Success return Matrix
*/ */
int lmathMatrixLookAt( lua_State *L ) { int lmathMatrixLookAt( lua_State* L ) {
Vector3 eye = uluaGetVector3( L, 1 ); Vector3 eye = uluaGetVector3( L, 1 );
Vector3 target = uluaGetVector3( L, 2 ); Vector3 target = uluaGetVector3( L, 2 );
Vector3 up = uluaGetVector3( L, 3 ); Vector3 up = uluaGetVector3( L, 3 );
@@ -1439,7 +1439,7 @@ Add two quaternions
- Success return Quaternion - Success return Quaternion
*/ */
int lmathQuaternionAdd( lua_State *L ) { int lmathQuaternionAdd( lua_State* L ) {
Quaternion q1 = uluaGetQuaternion( L, 1 ); Quaternion q1 = uluaGetQuaternion( L, 1 );
Quaternion q2 = uluaGetQuaternion( L, 2 ); Quaternion q2 = uluaGetQuaternion( L, 2 );
@@ -1455,7 +1455,7 @@ Add quaternion and float value
- Success return Quaternion - Success return Quaternion
*/ */
int lmathQuaternionAddValue( lua_State *L ) { int lmathQuaternionAddValue( lua_State* L ) {
Quaternion q = uluaGetQuaternion( L, 1 ); Quaternion q = uluaGetQuaternion( L, 1 );
float add = luaL_checknumber( L, 2 ); float add = luaL_checknumber( L, 2 );
@@ -1471,7 +1471,7 @@ Subtract two quaternions
- Success return Quaternion - Success return Quaternion
*/ */
int lmathQuaternionSubtract( lua_State *L ) { int lmathQuaternionSubtract( lua_State* L ) {
Quaternion q1 = uluaGetQuaternion( L, 1 ); Quaternion q1 = uluaGetQuaternion( L, 1 );
Quaternion q2 = uluaGetQuaternion( L, 2 ); Quaternion q2 = uluaGetQuaternion( L, 2 );
@@ -1487,7 +1487,7 @@ Subtract quaternion and float value
- Success return Quaternion - Success return Quaternion
*/ */
int lmathQuaternionSubtractValue( lua_State *L ) { int lmathQuaternionSubtractValue( lua_State* L ) {
Quaternion q = uluaGetQuaternion( L, 1 ); Quaternion q = uluaGetQuaternion( L, 1 );
float sub = luaL_checknumber( L, 2 ); float sub = luaL_checknumber( L, 2 );
@@ -1503,7 +1503,7 @@ Get identity quaternion
- Success return Quaternion - Success return Quaternion
*/ */
int lmathQuaternionIdentity( lua_State *L ) { int lmathQuaternionIdentity( lua_State* L ) {
uluaPushQuaternion( L, QuaternionIdentity() ); uluaPushQuaternion( L, QuaternionIdentity() );
return 1; return 1;
@@ -1516,7 +1516,7 @@ Computes the length of a quaternion
- Success return float - Success return float
*/ */
int lmathQuaternionLength( lua_State *L ) { int lmathQuaternionLength( lua_State* L ) {
Quaternion q = uluaGetQuaternion( L, 1 ); Quaternion q = uluaGetQuaternion( L, 1 );
lua_pushnumber( L, QuaternionLength( q ) ); lua_pushnumber( L, QuaternionLength( q ) );
@@ -1531,7 +1531,7 @@ Normalize provided quaternion
- Success return Quaternion - Success return Quaternion
*/ */
int lmathQuaternionNormalize( lua_State *L ) { int lmathQuaternionNormalize( lua_State* L ) {
Quaternion q = uluaGetQuaternion( L, 1 ); Quaternion q = uluaGetQuaternion( L, 1 );
uluaPushQuaternion( L, QuaternionNormalize( q ) ); uluaPushQuaternion( L, QuaternionNormalize( q ) );
@@ -1546,7 +1546,7 @@ Invert provided quaternion
- Success return Quaternion - Success return Quaternion
*/ */
int lmathQuaternionInvert( lua_State *L ) { int lmathQuaternionInvert( lua_State* L ) {
Quaternion q = uluaGetQuaternion( L, 1 ); Quaternion q = uluaGetQuaternion( L, 1 );
uluaPushQuaternion( L, QuaternionInvert( q ) ); uluaPushQuaternion( L, QuaternionInvert( q ) );
@@ -1561,7 +1561,7 @@ Calculate two quaternion multiplication
- Success return Quaternion - Success return Quaternion
*/ */
int lmathQuaternionMultiply( lua_State *L ) { int lmathQuaternionMultiply( lua_State* L ) {
Quaternion q1 = uluaGetQuaternion( L, 1 ); Quaternion q1 = uluaGetQuaternion( L, 1 );
Quaternion q2 = uluaGetQuaternion( L, 2 ); Quaternion q2 = uluaGetQuaternion( L, 2 );
@@ -1577,7 +1577,7 @@ Scale quaternion by float value
- Success return Quaternion - Success return Quaternion
*/ */
int lmathQuaternionScale( lua_State *L ) { int lmathQuaternionScale( lua_State* L ) {
Quaternion q = uluaGetQuaternion( L, 1 ); Quaternion q = uluaGetQuaternion( L, 1 );
float mul = luaL_checknumber( L, 2 ); float mul = luaL_checknumber( L, 2 );
@@ -1593,7 +1593,7 @@ Divide two quaternions
- Success return Quaternion - Success return Quaternion
*/ */
int lmathQuaternionDivide( lua_State *L ) { int lmathQuaternionDivide( lua_State* L ) {
Quaternion q1 = uluaGetQuaternion( L, 1 ); Quaternion q1 = uluaGetQuaternion( L, 1 );
Quaternion q2 = uluaGetQuaternion( L, 2 ); Quaternion q2 = uluaGetQuaternion( L, 2 );
@@ -1609,7 +1609,7 @@ Calculate linear interpolation between two quaternions
- Success return Quaternion - Success return Quaternion
*/ */
int lmathQuaternionLerp( lua_State *L ) { int lmathQuaternionLerp( lua_State* L ) {
Quaternion q1 = uluaGetQuaternion( L, 1 ); Quaternion q1 = uluaGetQuaternion( L, 1 );
Quaternion q2 = uluaGetQuaternion( L, 2 ); Quaternion q2 = uluaGetQuaternion( L, 2 );
float amount = luaL_checknumber( L, 3 ); float amount = luaL_checknumber( L, 3 );
@@ -1626,7 +1626,7 @@ Calculate slerp-optimized interpolation between two quaternions
- Success return Quaternion - Success return Quaternion
*/ */
int lmathQuaternionNlerp( lua_State *L ) { int lmathQuaternionNlerp( lua_State* L ) {
Quaternion q1 = uluaGetQuaternion( L, 1 ); Quaternion q1 = uluaGetQuaternion( L, 1 );
Quaternion q2 = uluaGetQuaternion( L, 2 ); Quaternion q2 = uluaGetQuaternion( L, 2 );
float amount = luaL_checknumber( L, 3 ); float amount = luaL_checknumber( L, 3 );
@@ -1643,7 +1643,7 @@ Calculates spherical linear interpolation between two quaternions
- Success return Quaternion - Success return Quaternion
*/ */
int lmathQuaternionSlerp( lua_State *L ) { int lmathQuaternionSlerp( lua_State* L ) {
Quaternion q1 = uluaGetQuaternion( L, 1 ); Quaternion q1 = uluaGetQuaternion( L, 1 );
Quaternion q2 = uluaGetQuaternion( L, 2 ); Quaternion q2 = uluaGetQuaternion( L, 2 );
float amount = luaL_checknumber( L, 3 ); float amount = luaL_checknumber( L, 3 );
@@ -1660,7 +1660,7 @@ Calculate quaternion based on the rotation from one vector to another
- Success return Quaternion - Success return Quaternion
*/ */
int lmathQuaternionFromVector3ToVector3( lua_State *L ) { int lmathQuaternionFromVector3ToVector3( lua_State* L ) {
Vector3 from = uluaGetVector3( L, 1 ); Vector3 from = uluaGetVector3( L, 1 );
Vector3 to = uluaGetVector3( L, 2 ); Vector3 to = uluaGetVector3( L, 2 );
@@ -1676,7 +1676,7 @@ Get a quaternion for a given rotation matrix
- Success return Quaternion - Success return Quaternion
*/ */
int lmathQuaternionFromMatrix( lua_State *L ) { int lmathQuaternionFromMatrix( lua_State* L ) {
Matrix mat = uluaGetMatrix( L, 1 ); Matrix mat = uluaGetMatrix( L, 1 );
uluaPushQuaternion( L, QuaternionFromMatrix( mat ) ); uluaPushQuaternion( L, QuaternionFromMatrix( mat ) );
@@ -1691,7 +1691,7 @@ Get a quaternion for a given rotation matrix
- Success return Matrix - Success return Matrix
*/ */
int lmathQuaternionToMatrix( lua_State *L ) { int lmathQuaternionToMatrix( lua_State* L ) {
Quaternion q = uluaGetQuaternion( L, 1 ); Quaternion q = uluaGetQuaternion( L, 1 );
uluaPushMatrix( L, QuaternionToMatrix( q ) ); uluaPushMatrix( L, QuaternionToMatrix( q ) );
@@ -1707,7 +1707,7 @@ NOTE: angle must be provided in radians
- Success return Quaternion - Success return Quaternion
*/ */
int lmathQuaternionFromAxisAngle( lua_State *L ) { int lmathQuaternionFromAxisAngle( lua_State* L ) {
Vector3 axis = uluaGetVector3( L, 1 ); Vector3 axis = uluaGetVector3( L, 1 );
float angle = luaL_checknumber( L, 2 ); float angle = luaL_checknumber( L, 2 );
@@ -1723,7 +1723,7 @@ Get the rotation angle and axis for a given quaternion
- Success return Vector3, float - Success return Vector3, float
*/ */
int lmathQuaternionToAxisAngle( lua_State *L ) { int lmathQuaternionToAxisAngle( lua_State* L ) {
Quaternion q = uluaGetQuaternion( L, 1 ); Quaternion q = uluaGetQuaternion( L, 1 );
float angle = 0.0; float angle = 0.0;
Vector3 axis = { 0.0 }; Vector3 axis = { 0.0 };
@@ -1744,7 +1744,7 @@ NOTE: Rotation order is ZYX
- Success return Quaternion - Success return Quaternion
*/ */
int lmathQuaternionFromEuler( lua_State *L ) { int lmathQuaternionFromEuler( lua_State* L ) {
float pitch = luaL_checknumber( L, 1 ); float pitch = luaL_checknumber( L, 1 );
float yaw = luaL_checknumber( L, 2 ); float yaw = luaL_checknumber( L, 2 );
float roll = luaL_checknumber( L, 3 ); float roll = luaL_checknumber( L, 3 );
@@ -1762,7 +1762,7 @@ NOTE: Angles are returned in a Vector3 struct in radians
- Success return Vector3 - Success return Vector3
*/ */
int lmathQuaternionToEuler( lua_State *L ) { int lmathQuaternionToEuler( lua_State* L ) {
Quaternion q = uluaGetQuaternion( L, 1 ); Quaternion q = uluaGetQuaternion( L, 1 );
uluaPushVector3( L, QuaternionToEuler( q ) ); uluaPushVector3( L, QuaternionToEuler( q ) );
@@ -1777,7 +1777,7 @@ Transform a quaternion given a transformation matrix
- Success return Quaternion - Success return Quaternion
*/ */
int lmathQuaternionTransform( lua_State *L ) { int lmathQuaternionTransform( lua_State* L ) {
Quaternion q = uluaGetQuaternion( L, 1 ); Quaternion q = uluaGetQuaternion( L, 1 );
Matrix mat = uluaGetMatrix( L, 2 ); Matrix mat = uluaGetMatrix( L, 2 );
@@ -1793,7 +1793,7 @@ Check whether two given quaternions are almost equal
- Success return int - Success return int
*/ */
int lmathQuaternionEquals( lua_State *L ) { int lmathQuaternionEquals( lua_State* L ) {
Quaternion q1 = uluaGetQuaternion( L, 1 ); Quaternion q1 = uluaGetQuaternion( L, 1 );
Quaternion q2 = uluaGetQuaternion( L, 2 ); Quaternion q2 = uluaGetQuaternion( L, 2 );

View File

@@ -4,7 +4,7 @@
#include "lua_core.h" #include "lua_core.h"
#include "textures.h" #include "textures.h"
static inline void getVector2Array( lua_State *L, int index, Vector2 points[] ) { static inline void getVector2Array( lua_State* L, int index, Vector2 points[] ) {
int t = index, i = 0; int t = index, i = 0;
lua_pushnil( L ); lua_pushnil( L );
@@ -26,8 +26,8 @@ Set texture and rectangle to be used on shapes drawing
NOTE: It can be useful when using basic shapes and one single font, NOTE: It can be useful when using basic shapes and one single font,
defining a font char white rectangle would allow drawing everything in a single draw call defining a font char white rectangle would allow drawing everything in a single draw call
*/ */
int lshapesSetShapesTexture( lua_State *L ) { int lshapesSetShapesTexture( lua_State* L ) {
Texture *texture = uluaGetTexture( L, 1 ); Texture* texture = uluaGetTexture( L, 1 );
Rectangle source = uluaGetRectangle( L, 2 ); Rectangle source = uluaGetRectangle( L, 2 );
SetShapesTexture( *texture, source ); SetShapesTexture( *texture, source );
@@ -40,7 +40,7 @@ int lshapesSetShapesTexture( lua_State *L ) {
Draw a pixel Draw a pixel
*/ */
int lshapesDrawPixel( lua_State *L ) { int lshapesDrawPixel( lua_State* L ) {
Vector2 pos = uluaGetVector2( L, 1 ); Vector2 pos = uluaGetVector2( L, 1 );
Color color = uluaGetColor( L, 2 ); Color color = uluaGetColor( L, 2 );
@@ -54,7 +54,7 @@ int lshapesDrawPixel( lua_State *L ) {
Draw a line defining thickness Draw a line defining thickness
*/ */
int lshapesDrawLine( lua_State *L ) { int lshapesDrawLine( lua_State* L ) {
Vector2 startPos = uluaGetVector2( L, 1 ); Vector2 startPos = uluaGetVector2( L, 1 );
Vector2 endPos = uluaGetVector2( L, 2 ); Vector2 endPos = uluaGetVector2( L, 2 );
float thickness = luaL_checknumber( L, 3 ); float thickness = luaL_checknumber( L, 3 );
@@ -70,7 +70,7 @@ int lshapesDrawLine( lua_State *L ) {
Draw lines sequence Draw lines sequence
*/ */
int lshapesDrawLineStrip( lua_State *L ) { int lshapesDrawLineStrip( lua_State* L ) {
int pointsCount = uluaGetTableLen( L, 1 ); int pointsCount = uluaGetTableLen( L, 1 );
Color color = uluaGetColor( L, 2 ); Color color = uluaGetColor( L, 2 );
@@ -95,7 +95,7 @@ int lshapesDrawLineStrip( lua_State *L ) {
Draw a line using cubic-bezier curves in-out Draw a line using cubic-bezier curves in-out
*/ */
int lshapesDrawLineBezier( lua_State *L ) { int lshapesDrawLineBezier( lua_State* L ) {
Vector2 startPos = uluaGetVector2( L, 1 ); Vector2 startPos = uluaGetVector2( L, 1 );
Vector2 endPos = uluaGetVector2( L, 2 ); Vector2 endPos = uluaGetVector2( L, 2 );
float thickness = luaL_checknumber( L, 3 ); float thickness = luaL_checknumber( L, 3 );
@@ -111,7 +111,7 @@ int lshapesDrawLineBezier( lua_State *L ) {
Draw a color-filled circle Draw a color-filled circle
*/ */
int lshapesDrawCircle( lua_State *L ) { int lshapesDrawCircle( lua_State* L ) {
Vector2 center = uluaGetVector2( L, 1 ); Vector2 center = uluaGetVector2( L, 1 );
float radius = luaL_checknumber( L, 2 ); float radius = luaL_checknumber( L, 2 );
Color color = uluaGetColor( L, 3 ); Color color = uluaGetColor( L, 3 );
@@ -126,7 +126,7 @@ int lshapesDrawCircle( lua_State *L ) {
Draw a piece of a circle Draw a piece of a circle
*/ */
int lshapesDrawCircleSector( lua_State *L ) { int lshapesDrawCircleSector( lua_State* L ) {
Vector2 center = uluaGetVector2( L, 1 ); Vector2 center = uluaGetVector2( L, 1 );
float radius = luaL_checknumber( L, 2 ); float radius = luaL_checknumber( L, 2 );
float startAngle = luaL_checknumber( L, 3 ); float startAngle = luaL_checknumber( L, 3 );
@@ -144,7 +144,7 @@ int lshapesDrawCircleSector( lua_State *L ) {
Draw circle sector outline Draw circle sector outline
*/ */
int lshapesDrawCircleSectorLines( lua_State *L ) { int lshapesDrawCircleSectorLines( lua_State* L ) {
Vector2 center = uluaGetVector2( L, 1 ); Vector2 center = uluaGetVector2( L, 1 );
float radius = luaL_checknumber( L, 2 ); float radius = luaL_checknumber( L, 2 );
float startAngle = luaL_checknumber( L, 3 ); float startAngle = luaL_checknumber( L, 3 );
@@ -162,7 +162,7 @@ int lshapesDrawCircleSectorLines( lua_State *L ) {
Draw a gradient-filled circle Draw a gradient-filled circle
*/ */
int lshapesDrawCircleGradient( lua_State *L ) { int lshapesDrawCircleGradient( lua_State* L ) {
Vector2 center = uluaGetVector2( L, 1 ); Vector2 center = uluaGetVector2( L, 1 );
float radius = luaL_checknumber( L, 2 ); float radius = luaL_checknumber( L, 2 );
Color color1 = uluaGetColor( L, 3 ); Color color1 = uluaGetColor( L, 3 );
@@ -178,7 +178,7 @@ int lshapesDrawCircleGradient( lua_State *L ) {
Draw circle outline Draw circle outline
*/ */
int lshapesDrawCircleLines( lua_State *L ) { int lshapesDrawCircleLines( lua_State* L ) {
Vector2 center = uluaGetVector2( L, 1 ); Vector2 center = uluaGetVector2( L, 1 );
float radius = luaL_checknumber( L, 2 ); float radius = luaL_checknumber( L, 2 );
Color color = uluaGetColor( L, 3 ); Color color = uluaGetColor( L, 3 );
@@ -193,7 +193,7 @@ int lshapesDrawCircleLines( lua_State *L ) {
Draw ellipse Draw ellipse
*/ */
int lshapesDrawEllipse( lua_State *L ) { int lshapesDrawEllipse( lua_State* L ) {
Vector2 center = uluaGetVector2( L, 1 ); Vector2 center = uluaGetVector2( L, 1 );
float radiusH = luaL_checknumber( L, 2 ); float radiusH = luaL_checknumber( L, 2 );
float radiusV = luaL_checknumber( L, 3 ); float radiusV = luaL_checknumber( L, 3 );
@@ -209,7 +209,7 @@ int lshapesDrawEllipse( lua_State *L ) {
Draw ellipse outline Draw ellipse outline
*/ */
int lshapesDrawEllipseLines( lua_State *L ) { int lshapesDrawEllipseLines( lua_State* L ) {
Vector2 center = uluaGetVector2( L, 1 ); Vector2 center = uluaGetVector2( L, 1 );
float radiusH = luaL_checknumber( L, 2 ); float radiusH = luaL_checknumber( L, 2 );
float radiusV = luaL_checknumber( L, 3 ); float radiusV = luaL_checknumber( L, 3 );
@@ -225,7 +225,7 @@ int lshapesDrawEllipseLines( lua_State *L ) {
Draw ring Draw ring
*/ */
int lshapesDrawRing( lua_State *L ) { int lshapesDrawRing( lua_State* L ) {
Vector2 center = uluaGetVector2( L, 1 ); Vector2 center = uluaGetVector2( L, 1 );
float innerRadius = luaL_checknumber( L, 2 ); float innerRadius = luaL_checknumber( L, 2 );
float outerRadius = luaL_checknumber( L, 3 ); float outerRadius = luaL_checknumber( L, 3 );
@@ -244,7 +244,7 @@ int lshapesDrawRing( lua_State *L ) {
Draw ring outline Draw ring outline
*/ */
int lshapesDrawRingLines( lua_State *L ) { int lshapesDrawRingLines( lua_State* L ) {
Vector2 center = uluaGetVector2( L, 1 ); Vector2 center = uluaGetVector2( L, 1 );
float innerRadius = luaL_checknumber( L, 2 ); float innerRadius = luaL_checknumber( L, 2 );
float outerRadius = luaL_checknumber( L, 3 ); float outerRadius = luaL_checknumber( L, 3 );
@@ -263,7 +263,7 @@ int lshapesDrawRingLines( lua_State *L ) {
Draw a color-filled rectangle Draw a color-filled rectangle
*/ */
int lshapesDrawRectangle( lua_State *L ) { int lshapesDrawRectangle( lua_State* L ) {
Rectangle rect = uluaGetRectangle( L, 1 ); Rectangle rect = uluaGetRectangle( L, 1 );
Color color = uluaGetColor( L, 2 ); Color color = uluaGetColor( L, 2 );
@@ -277,7 +277,7 @@ int lshapesDrawRectangle( lua_State *L ) {
Draw a color-filled rectangle with pro parameters Draw a color-filled rectangle with pro parameters
*/ */
int lshapesDrawRectanglePro( lua_State *L ) { int lshapesDrawRectanglePro( lua_State* L ) {
Rectangle rec = uluaGetRectangle( L, 1 ); Rectangle rec = uluaGetRectangle( L, 1 );
Vector2 origin = uluaGetVector2( L, 2 ); Vector2 origin = uluaGetVector2( L, 2 );
float rotation = luaL_checknumber( L, 3 ); float rotation = luaL_checknumber( L, 3 );
@@ -293,7 +293,7 @@ int lshapesDrawRectanglePro( lua_State *L ) {
Draw a vertical-gradient-filled rectangle Draw a vertical-gradient-filled rectangle
*/ */
int lshapesDrawRectangleGradientV( lua_State *L ) { int lshapesDrawRectangleGradientV( lua_State* L ) {
Rectangle rect = uluaGetRectangle( L, 1 ); Rectangle rect = uluaGetRectangle( L, 1 );
Color color1 = uluaGetColor( L, 2 ); Color color1 = uluaGetColor( L, 2 );
Color color2 = uluaGetColor( L, 3 ); Color color2 = uluaGetColor( L, 3 );
@@ -308,7 +308,7 @@ int lshapesDrawRectangleGradientV( lua_State *L ) {
Draw a horizontal-gradient-filled rectangle Draw a horizontal-gradient-filled rectangle
*/ */
int lshapesDrawRectangleGradientH( lua_State *L ) { int lshapesDrawRectangleGradientH( lua_State* L ) {
Rectangle rect = uluaGetRectangle( L, 1 ); Rectangle rect = uluaGetRectangle( L, 1 );
Color color1 = uluaGetColor( L, 2 ); Color color1 = uluaGetColor( L, 2 );
Color color2 = uluaGetColor( L, 3 ); Color color2 = uluaGetColor( L, 3 );
@@ -323,7 +323,7 @@ int lshapesDrawRectangleGradientH( lua_State *L ) {
Draw a gradient-filled rectangle with custom vertex colors Draw a gradient-filled rectangle with custom vertex colors
*/ */
int lshapesDrawRectangleGradientEx( lua_State *L ) { int lshapesDrawRectangleGradientEx( lua_State* L ) {
Rectangle rect = uluaGetRectangle( L, 1 ); Rectangle rect = uluaGetRectangle( L, 1 );
Color color1 = uluaGetColor( L, 2 ); Color color1 = uluaGetColor( L, 2 );
Color color2 = uluaGetColor( L, 3 ); Color color2 = uluaGetColor( L, 3 );
@@ -340,7 +340,7 @@ int lshapesDrawRectangleGradientEx( lua_State *L ) {
Draw rectangle outline Draw rectangle outline
*/ */
int lshapesDrawRectangleLines( lua_State *L ) { int lshapesDrawRectangleLines( lua_State* L ) {
Rectangle rect = uluaGetRectangle( L, 1 ); Rectangle rect = uluaGetRectangle( L, 1 );
Color color = uluaGetColor( L, 2 ); Color color = uluaGetColor( L, 2 );
@@ -354,7 +354,7 @@ int lshapesDrawRectangleLines( lua_State *L ) {
Draw rectangle outline with extended parameters Draw rectangle outline with extended parameters
*/ */
int lshapesDrawRectangleLinesEx( lua_State *L ) { int lshapesDrawRectangleLinesEx( lua_State* L ) {
Rectangle rect = uluaGetRectangle( L, 1 ); Rectangle rect = uluaGetRectangle( L, 1 );
int lineThick = luaL_checkinteger( L, 2 ); int lineThick = luaL_checkinteger( L, 2 );
Color color = uluaGetColor( L, 3 ); Color color = uluaGetColor( L, 3 );
@@ -369,7 +369,7 @@ int lshapesDrawRectangleLinesEx( lua_State *L ) {
Draw rectangle with rounded edges Draw rectangle with rounded edges
*/ */
int lshapesDrawRectangleRounded( lua_State *L ) { int lshapesDrawRectangleRounded( lua_State* L ) {
Rectangle rect = uluaGetRectangle( L, 1 ); Rectangle rect = uluaGetRectangle( L, 1 );
float roundness = luaL_checknumber( L, 2 ); float roundness = luaL_checknumber( L, 2 );
int segments = luaL_checkinteger( L, 3 ); int segments = luaL_checkinteger( L, 3 );
@@ -385,7 +385,7 @@ int lshapesDrawRectangleRounded( lua_State *L ) {
Draw rectangle with rounded edges outline Draw rectangle with rounded edges outline
*/ */
int lshapesDrawRectangleRoundedLines( lua_State *L ) { int lshapesDrawRectangleRoundedLines( lua_State* L ) {
Rectangle rect = uluaGetRectangle( L, 1 ); Rectangle rect = uluaGetRectangle( L, 1 );
float roundness = luaL_checknumber( L, 2 ); float roundness = luaL_checknumber( L, 2 );
int segments = luaL_checkinteger( L, 3 ); int segments = luaL_checkinteger( L, 3 );
@@ -402,7 +402,7 @@ int lshapesDrawRectangleRoundedLines( lua_State *L ) {
Draw a color-filled triangle (Vertex in counter-clockwise order!) Draw a color-filled triangle (Vertex in counter-clockwise order!)
*/ */
int lshapesDrawTriangle( lua_State *L ) { int lshapesDrawTriangle( lua_State* L ) {
Vector2 v1 = uluaGetVector2( L, 1 ); Vector2 v1 = uluaGetVector2( L, 1 );
Vector2 v2 = uluaGetVector2( L, 2 ); Vector2 v2 = uluaGetVector2( L, 2 );
Vector2 v3 = uluaGetVector2( L, 3 ); Vector2 v3 = uluaGetVector2( L, 3 );
@@ -418,7 +418,7 @@ int lshapesDrawTriangle( lua_State *L ) {
Draw triangle outline (Vertex in counter-clockwise order!) Draw triangle outline (Vertex in counter-clockwise order!)
*/ */
int lshapesDrawTriangleLines( lua_State *L ) { int lshapesDrawTriangleLines( lua_State* L ) {
Vector2 v1 = uluaGetVector2( L, 1 ); Vector2 v1 = uluaGetVector2( L, 1 );
Vector2 v2 = uluaGetVector2( L, 2 ); Vector2 v2 = uluaGetVector2( L, 2 );
Vector2 v3 = uluaGetVector2( L, 3 ); Vector2 v3 = uluaGetVector2( L, 3 );
@@ -434,7 +434,7 @@ int lshapesDrawTriangleLines( lua_State *L ) {
Draw a triangle fan defined by points (first vertex is the center) Draw a triangle fan defined by points (first vertex is the center)
*/ */
int lshapesDrawTriangleFan( lua_State *L ) { int lshapesDrawTriangleFan( lua_State* L ) {
int pointsCount = uluaGetTableLen( L, 1 ); int pointsCount = uluaGetTableLen( L, 1 );
Color color = uluaGetColor( L, 2 ); Color color = uluaGetColor( L, 2 );
@@ -459,7 +459,7 @@ int lshapesDrawTriangleFan( lua_State *L ) {
Draw a triangle strip defined by points Draw a triangle strip defined by points
*/ */
int lshapesDrawTriangleStrip( lua_State *L ) { int lshapesDrawTriangleStrip( lua_State* L ) {
int pointsCount = uluaGetTableLen( L, 1 ); int pointsCount = uluaGetTableLen( L, 1 );
Color color = uluaGetColor( L, 2 ); Color color = uluaGetColor( L, 2 );
@@ -484,7 +484,7 @@ int lshapesDrawTriangleStrip( lua_State *L ) {
Draw a regular polygon (Vector version) Draw a regular polygon (Vector version)
*/ */
int lshapesDrawPoly( lua_State *L ) { int lshapesDrawPoly( lua_State* L ) {
Vector2 center = uluaGetVector2( L, 1 ); Vector2 center = uluaGetVector2( L, 1 );
int sides = luaL_checkinteger( L, 2 ); int sides = luaL_checkinteger( L, 2 );
float radius = luaL_checknumber( L, 3 ); float radius = luaL_checknumber( L, 3 );
@@ -501,7 +501,7 @@ int lshapesDrawPoly( lua_State *L ) {
Draw a polygon outline of n sides Draw a polygon outline of n sides
*/ */
int lshapesDrawPolyLines( lua_State *L ) { int lshapesDrawPolyLines( lua_State* L ) {
Vector2 center = uluaGetVector2( L, 1 ); Vector2 center = uluaGetVector2( L, 1 );
int sides = luaL_checkinteger( L, 2 ); int sides = luaL_checkinteger( L, 2 );
float radius = luaL_checknumber( L, 3 ); float radius = luaL_checknumber( L, 3 );
@@ -518,7 +518,7 @@ int lshapesDrawPolyLines( lua_State *L ) {
Draw a polygon outline of n sides with extended parameters Draw a polygon outline of n sides with extended parameters
*/ */
int lshapesDrawPolyLinesEx( lua_State *L ) { int lshapesDrawPolyLinesEx( lua_State* L ) {
Vector2 center = uluaGetVector2( L, 1 ); Vector2 center = uluaGetVector2( L, 1 );
int sides = luaL_checkinteger( L, 2 ); int sides = luaL_checkinteger( L, 2 );
float radius = luaL_checknumber( L, 3 ); float radius = luaL_checknumber( L, 3 );
@@ -540,7 +540,7 @@ int lshapesDrawPolyLinesEx( lua_State *L ) {
Draw spline: Linear, minimum 2 points Draw spline: Linear, minimum 2 points
*/ */
int lshapesDrawSplineLinear( lua_State *L ) { int lshapesDrawSplineLinear( lua_State* L ) {
int pointCount = uluaGetTableLen( L, 1 ); int pointCount = uluaGetTableLen( L, 1 );
Vector2 points[ pointCount ]; Vector2 points[ pointCount ];
float thick = luaL_checknumber( L, 2 ); float thick = luaL_checknumber( L, 2 );
@@ -557,7 +557,7 @@ int lshapesDrawSplineLinear( lua_State *L ) {
Draw spline: B-Spline, minimum 4 points Draw spline: B-Spline, minimum 4 points
*/ */
int lshapesDrawSplineBasis( lua_State *L ) { int lshapesDrawSplineBasis( lua_State* L ) {
int pointCount = uluaGetTableLen( L, 1 ); int pointCount = uluaGetTableLen( L, 1 );
Vector2 points[ pointCount ]; Vector2 points[ pointCount ];
float thick = luaL_checknumber( L, 2 ); float thick = luaL_checknumber( L, 2 );
@@ -574,7 +574,7 @@ int lshapesDrawSplineBasis( lua_State *L ) {
Draw spline: Catmull-Rom, minimum 4 points Draw spline: Catmull-Rom, minimum 4 points
*/ */
int lshapesDrawSplineCatmullRom( lua_State *L ) { int lshapesDrawSplineCatmullRom( lua_State* L ) {
int pointCount = uluaGetTableLen( L, 1 ); int pointCount = uluaGetTableLen( L, 1 );
Vector2 points[ pointCount ]; Vector2 points[ pointCount ];
float thick = luaL_checknumber( L, 2 ); float thick = luaL_checknumber( L, 2 );
@@ -591,7 +591,7 @@ int lshapesDrawSplineCatmullRom( lua_State *L ) {
Draw spline: Quadratic Bezier, minimum 3 points (1 control point): [p1, c2, p3, c4...] Draw spline: Quadratic Bezier, minimum 3 points (1 control point): [p1, c2, p3, c4...]
*/ */
int lshapesDrawSplineBezierQuadratic( lua_State *L ) { int lshapesDrawSplineBezierQuadratic( lua_State* L ) {
int pointCount = uluaGetTableLen( L, 1 ); int pointCount = uluaGetTableLen( L, 1 );
Vector2 points[ pointCount ]; Vector2 points[ pointCount ];
float thick = luaL_checknumber( L, 2 ); float thick = luaL_checknumber( L, 2 );
@@ -608,7 +608,7 @@ int lshapesDrawSplineBezierQuadratic( lua_State *L ) {
Draw spline: Cubic Bezier, minimum 4 points (2 control points): [p1, c2, c3, p4, c5, c6...] Draw spline: Cubic Bezier, minimum 4 points (2 control points): [p1, c2, c3, p4, c5, c6...]
*/ */
int lshapesDrawSplineBezierCubic( lua_State *L ) { int lshapesDrawSplineBezierCubic( lua_State* L ) {
int pointCount = uluaGetTableLen( L, 1 ); int pointCount = uluaGetTableLen( L, 1 );
Vector2 points[ pointCount ]; Vector2 points[ pointCount ];
float thick = luaL_checknumber( L, 2 ); float thick = luaL_checknumber( L, 2 );
@@ -625,7 +625,7 @@ int lshapesDrawSplineBezierCubic( lua_State *L ) {
Draw spline segment: Linear, 2 points Draw spline segment: Linear, 2 points
*/ */
int lshapesDrawSplineSegmentLinear( lua_State *L ) { int lshapesDrawSplineSegmentLinear( lua_State* L ) {
Vector2 p1 = uluaGetVector2( L, 1 ); Vector2 p1 = uluaGetVector2( L, 1 );
Vector2 p2 = uluaGetVector2( L, 2 ); Vector2 p2 = uluaGetVector2( L, 2 );
float thick = luaL_checknumber( L, 3 ); float thick = luaL_checknumber( L, 3 );
@@ -641,7 +641,7 @@ int lshapesDrawSplineSegmentLinear( lua_State *L ) {
Draw spline segment: B-Spline, 4 points Draw spline segment: B-Spline, 4 points
*/ */
int lshapesDrawSplineSegmentBasis( lua_State *L ) { int lshapesDrawSplineSegmentBasis( lua_State* L ) {
Vector2 p1 = uluaGetVector2( L, 1 ); Vector2 p1 = uluaGetVector2( L, 1 );
Vector2 p2 = uluaGetVector2( L, 2 ); Vector2 p2 = uluaGetVector2( L, 2 );
Vector2 p3 = uluaGetVector2( L, 3 ); Vector2 p3 = uluaGetVector2( L, 3 );
@@ -659,7 +659,7 @@ int lshapesDrawSplineSegmentBasis( lua_State *L ) {
Draw spline segment: Catmull-Rom, 4 points Draw spline segment: Catmull-Rom, 4 points
*/ */
int lshapesDrawSplineSegmentCatmullRom( lua_State *L ) { int lshapesDrawSplineSegmentCatmullRom( lua_State* L ) {
Vector2 p1 = uluaGetVector2( L, 1 ); Vector2 p1 = uluaGetVector2( L, 1 );
Vector2 p2 = uluaGetVector2( L, 2 ); Vector2 p2 = uluaGetVector2( L, 2 );
Vector2 p3 = uluaGetVector2( L, 3 ); Vector2 p3 = uluaGetVector2( L, 3 );
@@ -677,7 +677,7 @@ int lshapesDrawSplineSegmentCatmullRom( lua_State *L ) {
Draw spline segment: Quadratic Bezier, 2 points, 1 control point Draw spline segment: Quadratic Bezier, 2 points, 1 control point
*/ */
int lshapesDrawSplineSegmentBezierQuadratic( lua_State *L ) { int lshapesDrawSplineSegmentBezierQuadratic( lua_State* L ) {
Vector2 p1 = uluaGetVector2( L, 1 ); Vector2 p1 = uluaGetVector2( L, 1 );
Vector2 c2 = uluaGetVector2( L, 2 ); Vector2 c2 = uluaGetVector2( L, 2 );
Vector2 p3 = uluaGetVector2( L, 3 ); Vector2 p3 = uluaGetVector2( L, 3 );
@@ -694,7 +694,7 @@ int lshapesDrawSplineSegmentBezierQuadratic( lua_State *L ) {
Draw spline segment: Cubic Bezier, 2 points, 2 control points Draw spline segment: Cubic Bezier, 2 points, 2 control points
*/ */
int lshapesDrawSplineSegmentBezierCubic( lua_State *L ) { int lshapesDrawSplineSegmentBezierCubic( lua_State* L ) {
Vector2 p1 = uluaGetVector2( L, 1 ); Vector2 p1 = uluaGetVector2( L, 1 );
Vector2 c2 = uluaGetVector2( L, 2 ); Vector2 c2 = uluaGetVector2( L, 2 );
Vector2 c3 = uluaGetVector2( L, 3 ); Vector2 c3 = uluaGetVector2( L, 3 );
@@ -718,7 +718,7 @@ Get (evaluate) spline point: Linear
- Success return Vector2 - Success return Vector2
*/ */
int lshapesGetSplinePointLinear( lua_State *L ) { int lshapesGetSplinePointLinear( lua_State* L ) {
Vector2 p1 = uluaGetVector2( L, 1 ); Vector2 p1 = uluaGetVector2( L, 1 );
Vector2 p2 = uluaGetVector2( L, 2 ); Vector2 p2 = uluaGetVector2( L, 2 );
float t = luaL_checknumber( L, 3 ); float t = luaL_checknumber( L, 3 );
@@ -735,7 +735,7 @@ Get (evaluate) spline point: B-Spline
- Success return Vector2 - Success return Vector2
*/ */
int lshapesGetSplinePointBasis( lua_State *L ) { int lshapesGetSplinePointBasis( lua_State* L ) {
Vector2 p1 = uluaGetVector2( L, 1 ); Vector2 p1 = uluaGetVector2( L, 1 );
Vector2 p2 = uluaGetVector2( L, 2 ); Vector2 p2 = uluaGetVector2( L, 2 );
Vector2 p3 = uluaGetVector2( L, 3 ); Vector2 p3 = uluaGetVector2( L, 3 );
@@ -754,7 +754,7 @@ Get (evaluate) spline point: Catmull-Rom
- Success return Vector2 - Success return Vector2
*/ */
int lshapesGetSplinePointCatmullRom( lua_State *L ) { int lshapesGetSplinePointCatmullRom( lua_State* L ) {
Vector2 p1 = uluaGetVector2( L, 1 ); Vector2 p1 = uluaGetVector2( L, 1 );
Vector2 p2 = uluaGetVector2( L, 2 ); Vector2 p2 = uluaGetVector2( L, 2 );
Vector2 p3 = uluaGetVector2( L, 3 ); Vector2 p3 = uluaGetVector2( L, 3 );
@@ -773,7 +773,7 @@ Get (evaluate) spline point: Quadratic Bezier
- Success return Vector2 - Success return Vector2
*/ */
int lshapesGetSplinePointBezierQuad( lua_State *L ) { int lshapesGetSplinePointBezierQuad( lua_State* L ) {
Vector2 p1 = uluaGetVector2( L, 1 ); Vector2 p1 = uluaGetVector2( L, 1 );
Vector2 c2 = uluaGetVector2( L, 2 ); Vector2 c2 = uluaGetVector2( L, 2 );
Vector2 p3 = uluaGetVector2( L, 3 ); Vector2 p3 = uluaGetVector2( L, 3 );
@@ -791,7 +791,7 @@ Get (evaluate) spline point: Cubic Bezier
- Success return Vector2 - Success return Vector2
*/ */
int lshapesGetSplinePointBezierCubic( lua_State *L ) { int lshapesGetSplinePointBezierCubic( lua_State* L ) {
Vector2 p1 = uluaGetVector2( L, 1 ); Vector2 p1 = uluaGetVector2( L, 1 );
Vector2 c2 = uluaGetVector2( L, 2 ); Vector2 c2 = uluaGetVector2( L, 2 );
Vector2 c3 = uluaGetVector2( L, 3 ); Vector2 c3 = uluaGetVector2( L, 3 );
@@ -814,7 +814,7 @@ Check collision between two rectangles
- Success return bool - Success return bool
*/ */
int lshapesCheckCollisionRecs( lua_State *L ) { int lshapesCheckCollisionRecs( lua_State* L ) {
Rectangle rect1 = uluaGetRectangle( L, 1 ); Rectangle rect1 = uluaGetRectangle( L, 1 );
Rectangle rect2 = uluaGetRectangle( L, 2 ); Rectangle rect2 = uluaGetRectangle( L, 2 );
@@ -830,7 +830,7 @@ Check collision between two circles
- Success return bool - Success return bool
*/ */
int lshapesCheckCollisionCircles( lua_State *L ) { int lshapesCheckCollisionCircles( lua_State* L ) {
Vector2 center1 = uluaGetVector2( L, 1 ); Vector2 center1 = uluaGetVector2( L, 1 );
float radius1 = luaL_checknumber( L, 2 ); float radius1 = luaL_checknumber( L, 2 );
Vector2 center2 = uluaGetVector2( L, 3 ); Vector2 center2 = uluaGetVector2( L, 3 );
@@ -848,7 +848,7 @@ Check collision between circle and rectangle
- Success return bool - Success return bool
*/ */
int lshapesCheckCollisionCircleRec( lua_State *L ) { int lshapesCheckCollisionCircleRec( lua_State* L ) {
Vector2 center = uluaGetVector2( L, 1 ); Vector2 center = uluaGetVector2( L, 1 );
float radius = luaL_checknumber( L, 2 ); float radius = luaL_checknumber( L, 2 );
Rectangle rec = uluaGetRectangle( L, 3 ); Rectangle rec = uluaGetRectangle( L, 3 );
@@ -865,7 +865,7 @@ Check if point is inside rectangle
- Success return bool - Success return bool
*/ */
int lshapesCheckCollisionPointRec( lua_State *L ) { int lshapesCheckCollisionPointRec( lua_State* L ) {
Vector2 point = uluaGetVector2( L, 1 ); Vector2 point = uluaGetVector2( L, 1 );
Rectangle rec = uluaGetRectangle( L, 2 ); Rectangle rec = uluaGetRectangle( L, 2 );
@@ -881,7 +881,7 @@ Check if point is inside circle
- Success return bool - Success return bool
*/ */
int lshapesCheckCollisionPointCircle( lua_State *L ) { int lshapesCheckCollisionPointCircle( lua_State* L ) {
Vector2 point = uluaGetVector2( L, 1 ); Vector2 point = uluaGetVector2( L, 1 );
Vector2 center = uluaGetVector2( L, 2 ); Vector2 center = uluaGetVector2( L, 2 );
float radius = luaL_checknumber( L, 3 ); float radius = luaL_checknumber( L, 3 );
@@ -898,7 +898,7 @@ Check if point is inside a triangle
- Success return bool - Success return bool
*/ */
int lshapesCheckCollisionPointTriangle( lua_State *L ) { int lshapesCheckCollisionPointTriangle( lua_State* L ) {
Vector2 point = uluaGetVector2( L, 1 ); Vector2 point = uluaGetVector2( L, 1 );
Vector2 p1 = uluaGetVector2( L, 2 ); Vector2 p1 = uluaGetVector2( L, 2 );
Vector2 p2 = uluaGetVector2( L, 3 ); Vector2 p2 = uluaGetVector2( L, 3 );
@@ -916,7 +916,7 @@ Check if point is within a polygon described by array of vertices
- Success return bool - Success return bool
*/ */
int lshapesCheckCollisionPointPoly( lua_State *L ) { int lshapesCheckCollisionPointPoly( lua_State* L ) {
Vector2 point = uluaGetVector2( L, 1 ); Vector2 point = uluaGetVector2( L, 1 );
int pointCount = uluaGetTableLen( L, 2 ); int pointCount = uluaGetTableLen( L, 2 );
Vector2 points[ pointCount ]; Vector2 points[ pointCount ];
@@ -942,7 +942,7 @@ Check the collision between two lines defined by two points each, returns collis
- Success return bool, Vector2 - Success return bool, Vector2
*/ */
int lshapesCheckCollisionLines( lua_State *L ) { int lshapesCheckCollisionLines( lua_State* L ) {
Vector2 startPos1 = uluaGetVector2( L, 1 ); Vector2 startPos1 = uluaGetVector2( L, 1 );
Vector2 endPos1 = uluaGetVector2( L, 2 ); Vector2 endPos1 = uluaGetVector2( L, 2 );
Vector2 startPos2 = uluaGetVector2( L, 3 ); Vector2 startPos2 = uluaGetVector2( L, 3 );
@@ -963,7 +963,7 @@ Check if point belongs to line created between two points [p1] and [p2] with def
- Success return bool - Success return bool
*/ */
int lshapesCheckCollisionPointLine( lua_State *L ) { int lshapesCheckCollisionPointLine( lua_State* L ) {
Vector2 point = uluaGetVector2( L, 1 ); Vector2 point = uluaGetVector2( L, 1 );
Vector2 p1 = uluaGetVector2( L, 2 ); Vector2 p1 = uluaGetVector2( L, 2 );
Vector2 p2 = uluaGetVector2( L, 3 ); Vector2 p2 = uluaGetVector2( L, 3 );
@@ -981,7 +981,7 @@ Get collision rectangle for two rectangles collision
- Success return Rectangle - Success return Rectangle
*/ */
int lshapesGetCollisionRec( lua_State *L ) { int lshapesGetCollisionRec( lua_State* L ) {
Rectangle rec1 = uluaGetRectangle( L, 1 ); Rectangle rec1 = uluaGetRectangle( L, 1 );
Rectangle rec2 = uluaGetRectangle( L, 2 ); Rectangle rec2 = uluaGetRectangle( L, 2 );

View File

@@ -6,7 +6,7 @@
State *state; State *state;
bool stateInit( int argn, const char **argc, const char *exePath ) { bool stateInit( int argn, const char** argc, const char* exePath ) {
state = malloc( sizeof( State ) ); state = malloc( sizeof( State ) );
state->exePath = malloc( STRING_LEN * sizeof( char ) ); state->exePath = malloc( STRING_LEN * sizeof( char ) );
@@ -32,7 +32,7 @@ bool stateInit( int argn, const char **argc, const char *exePath ) {
state->defaultMaterial = LoadMaterialDefault(); state->defaultMaterial = LoadMaterialDefault();
state->defaultTexture = (Texture){ 1, 1, 1, 1, 7 }; state->defaultTexture = (Texture){ 1, 1, 1, 1, 7 };
state->RLGLcurrentShaderLocs = malloc( RL_MAX_SHADER_LOCATIONS * sizeof( int ) ); state->RLGLcurrentShaderLocs = malloc( RL_MAX_SHADER_LOCATIONS * sizeof( int ) );
int *defaultShaderLocs = rlGetShaderLocsDefault(); int* defaultShaderLocs = rlGetShaderLocsDefault();
for ( int i = 0; i < RL_MAX_SHADER_LOCATIONS; i++ ) { for ( int i = 0; i < RL_MAX_SHADER_LOCATIONS; i++ ) {
state->RLGLcurrentShaderLocs[i] = defaultShaderLocs[i]; state->RLGLcurrentShaderLocs[i] = defaultShaderLocs[i];
@@ -45,7 +45,7 @@ bool stateInit( int argn, const char **argc, const char *exePath ) {
return state->run; return state->run;
} }
void stateInitInterpret( int argn, const char **argc ) { void stateInitInterpret( int argn, const char** argc ) {
state = malloc( sizeof( State ) ); state = malloc( sizeof( State ) );
luaInit( argn, argc ); luaInit( argn, argc );
} }

View File

@@ -4,15 +4,15 @@
#include "textures.h" #include "textures.h"
#include "lua_core.h" #include "lua_core.h"
void unloadGlyphInfo( GlyphInfo *glyph ) { void unloadGlyphInfo( GlyphInfo* glyph ) {
UnloadImage( glyph->image ); UnloadImage( glyph->image );
} }
// DrawTextBoxed is modified DrawTextBoxedSelectable from raylib [text] example - Rectangle bounds // DrawTextBoxed is modified DrawTextBoxedSelectable from raylib [text] example - Rectangle bounds
// Draw text using font inside rectangle limits // Draw text using font inside rectangle limits
static int DrawTextBoxed( Font font, const char *text, Rectangle rec, float fontSize, float spacing, static int DrawTextBoxed( Font font, const char* text, Rectangle rec, float fontSize, float spacing,
bool wordWrap, Color *tints, int tintCount, Color *backTints, int backTintCount ) bool wordWrap, Color* tints, int tintCount, Color* backTints, int backTintCount )
{ {
int length = TextLength(text); // Total length in bytes of the text, scanned by codepoints in loop int length = TextLength(text); // Total length in bytes of the text, scanned by codepoints in loop
@@ -161,7 +161,7 @@ bool wordWrap, Color *tints, int tintCount, Color *backTints, int backTintCount
return mouseChar; return mouseChar;
} }
static inline void getCodepoints( lua_State *L, int codepoints[], int index ) { static inline void getCodepoints( lua_State* L, int codepoints[], int index ) {
int t = index; int t = index;
int i = 0; int i = 0;
lua_pushnil( L ); lua_pushnil( L );
@@ -184,7 +184,7 @@ Get the default Font. Return as lightuserdata
- Success return Font - Success return Font
*/ */
int ltextGetFontDefault( lua_State *L ) { int ltextGetFontDefault( lua_State* L ) {
lua_pushlightuserdata( L, &state->defaultFont ); lua_pushlightuserdata( L, &state->defaultFont );
return 1; return 1;
@@ -198,7 +198,7 @@ Load font from file into GPU memory (VRAM)
- Failure return nil - Failure return nil
- Success return Font - Success return Font
*/ */
int ltextLoadFont( lua_State *L ) { int ltextLoadFont( lua_State* L ) {
if ( FileExists( luaL_checkstring( L, 1 ) ) ) { if ( FileExists( luaL_checkstring( L, 1 ) ) ) {
uluaPushFont( L, LoadFont( lua_tostring( L, 1 ) ) ); uluaPushFont( L, LoadFont( lua_tostring( L, 1 ) ) );
@@ -218,7 +218,7 @@ Load font from file with extended parameters, use NULL for codepoints to load th
- Failure return nil - Failure return nil
- Success return Font - Success return Font
*/ */
int ltextLoadFontEx( lua_State *L ) { int ltextLoadFontEx( lua_State* L ) {
int fontSize = luaL_checkinteger( L, 2 ); int fontSize = luaL_checkinteger( L, 2 );
if ( FileExists( luaL_checkstring( L, 1 ) ) ) { if ( FileExists( luaL_checkstring( L, 1 ) ) ) {
@@ -248,8 +248,8 @@ Load font from Image (XNA style)
- Success return Font - Success return Font
*/ */
int ltextLoadFontFromImage( lua_State *L ) { int ltextLoadFontFromImage( lua_State* L ) {
Image *image = uluaGetImage( L, 1 ); Image* image = uluaGetImage( L, 1 );
Color key = uluaGetColor( L, 2 ); Color key = uluaGetColor( L, 2 );
int firstChar = luaL_checkinteger( L, 3 ); int firstChar = luaL_checkinteger( L, 3 );
@@ -265,9 +265,9 @@ Load font from memory buffer, fileType refers to extension: i.e. '.ttf'. NOTE: f
- Success return Font - Success return Font
*/ */
int ltextLoadFontFromMemory( lua_State *L ) { int ltextLoadFontFromMemory( lua_State* L ) {
const char *fileType = luaL_checkstring( L, 1 ); const char* fileType = luaL_checkstring( L, 1 );
Buffer *fileData = uluaGetBuffer( L, 2 ); Buffer* fileData = uluaGetBuffer( L, 2 );
int fontSize = luaL_checkinteger( L, 3 ); int fontSize = luaL_checkinteger( L, 3 );
if ( lua_istable( L, 4 ) ) { if ( lua_istable( L, 4 ) ) {
@@ -292,7 +292,7 @@ Load Font from data
- Success return Font - Success return Font
*/ */
int ltextLoadFontFromData( lua_State *L ) { int ltextLoadFontFromData( lua_State* L ) {
luaL_checktype( L, 1, LUA_TTABLE ); luaL_checktype( L, 1, LUA_TTABLE );
Font font = { 0 }; Font font = { 0 };
@@ -353,8 +353,8 @@ Check if a font is ready
- Success return bool - Success return bool
*/ */
int ltextIsFontReady( lua_State *L ) { int ltextIsFontReady( lua_State* L ) {
Font *font = uluaGetFont( L, 1 ); Font* font = uluaGetFont( L, 1 );
lua_pushboolean( L, IsFontReady( *font ) ); lua_pushboolean( L, IsFontReady( *font ) );
@@ -368,8 +368,8 @@ Load font data for further use. NOTE: fileData type should be unsigned char
- Success return GlyphInfo{} - Success return GlyphInfo{}
*/ */
int ltextLoadFontData( lua_State *L ) { int ltextLoadFontData( lua_State* L ) {
Buffer *fileData = uluaGetBuffer( L, 1 ); Buffer* fileData = uluaGetBuffer( L, 1 );
int fontSize = luaL_checkinteger( L, 2 ); int fontSize = luaL_checkinteger( L, 2 );
int type = luaL_checkinteger( L, 4 ); int type = luaL_checkinteger( L, 4 );
int codepointCount = 95; // In case no chars count provided, default to 95. int codepointCount = 95; // In case no chars count provided, default to 95.
@@ -379,7 +379,7 @@ int ltextLoadFontData( lua_State *L ) {
int codepoints[ codepointCount ]; int codepoints[ codepointCount ];
getCodepoints( L, codepoints, 3 ); getCodepoints( L, codepoints, 3 );
GlyphInfo *glyphs = LoadFontData( fileData->data, fileData->size, fontSize, codepoints, codepointCount, type ); GlyphInfo* glyphs = LoadFontData( fileData->data, fileData->size, fontSize, codepoints, codepointCount, type );
lua_createtable( L, codepointCount, 0 ); lua_createtable( L, codepointCount, 0 );
for ( int i = 0; i < codepointCount; i++ ) { for ( int i = 0; i < codepointCount; i++ ) {
@@ -391,7 +391,7 @@ int ltextLoadFontData( lua_State *L ) {
return 1; return 1;
} }
/* If no codepoints provided. */ /* If no codepoints provided. */
GlyphInfo *glyphs = LoadFontData( fileData->data, fileData->size, fontSize, NULL, 0, type ); GlyphInfo* glyphs = LoadFontData( fileData->data, fileData->size, fontSize, NULL, 0, type );
lua_createtable( L, codepointCount, 0 ); lua_createtable( L, codepointCount, 0 );
for ( int i = 0; i < codepointCount; i++ ) { for ( int i = 0; i < codepointCount; i++ ) {
@@ -410,7 +410,7 @@ Generate image font atlas using chars info. NOTE: Packing method: 0-Default, 1-S
- Success Image, Rectangle{} - Success Image, Rectangle{}
*/ */
int ltextGenImageFontAtlas( lua_State *L ) { int ltextGenImageFontAtlas( lua_State* L ) {
int fontSize = luaL_checkinteger( L, 2 ); int fontSize = luaL_checkinteger( L, 2 );
int padding = luaL_checkinteger( L, 3 ); int padding = luaL_checkinteger( L, 3 );
int packMethod = luaL_checkinteger( L, 4 ); int packMethod = luaL_checkinteger( L, 4 );
@@ -444,8 +444,8 @@ int ltextGenImageFontAtlas( lua_State *L ) {
Unload font from GPU memory (VRAM) Unload font from GPU memory (VRAM)
*/ */
int ltextUnloadFont( lua_State *L ) { int ltextUnloadFont( lua_State* L ) {
Font *font = uluaGetFont( L, 1 ); Font* font = uluaGetFont( L, 1 );
UnloadFont( *font ); UnloadFont( *font );
@@ -459,9 +459,9 @@ Export font as code file, returns true on success
- Success return bool - Success return bool
*/ */
int ltextExportFontAsCode( lua_State *L ) { int ltextExportFontAsCode( lua_State* L ) {
Font *font = uluaGetFont( L, 1 ); Font* font = uluaGetFont( L, 1 );
const char *fileName = luaL_checkstring( L, 2 ); const char* fileName = luaL_checkstring( L, 2 );
lua_pushboolean( L, ExportFontAsCode( *font, fileName ) ); lua_pushboolean( L, ExportFontAsCode( *font, fileName ) );
@@ -477,7 +477,7 @@ int ltextExportFontAsCode( lua_State *L ) {
Draw current FPS Draw current FPS
*/ */
int ltextDrawFPS( lua_State *L ) { int ltextDrawFPS( lua_State* L ) {
Vector2 pos = uluaGetVector2( L, 1 ); Vector2 pos = uluaGetVector2( L, 1 );
DrawFPS( pos.x, pos.y ); DrawFPS( pos.x, pos.y );
@@ -490,7 +490,7 @@ int ltextDrawFPS( lua_State *L ) {
Draw text (using default font) Draw text (using default font)
*/ */
int ltextDrawText( lua_State *L ) { int ltextDrawText( lua_State* L ) {
Vector2 position = uluaGetVector2( L, 2 ); Vector2 position = uluaGetVector2( L, 2 );
float fontSize = luaL_checknumber( L, 3 ); float fontSize = luaL_checknumber( L, 3 );
Color tint = uluaGetColor( L, 4 ); Color tint = uluaGetColor( L, 4 );
@@ -505,8 +505,8 @@ int ltextDrawText( lua_State *L ) {
Draw text using font and additional parameters Draw text using font and additional parameters
*/ */
int ltextDrawTextEx( lua_State *L ) { int ltextDrawTextEx( lua_State* L ) {
Font *font = uluaGetFont( L, 1 ); Font* font = uluaGetFont( L, 1 );
Vector2 position = uluaGetVector2( L, 3 ); Vector2 position = uluaGetVector2( L, 3 );
float fontSize = luaL_checknumber( L, 4 ); float fontSize = luaL_checknumber( L, 4 );
float spacing = luaL_checknumber( L, 5 ); float spacing = luaL_checknumber( L, 5 );
@@ -522,8 +522,8 @@ int ltextDrawTextEx( lua_State *L ) {
Draw text using Font and pro parameters (rotation) Draw text using Font and pro parameters (rotation)
*/ */
int ltextDrawTextPro( lua_State *L ) { int ltextDrawTextPro( lua_State* L ) {
Font *font = uluaGetFont( L, 1 ); Font* font = uluaGetFont( L, 1 );
Vector2 position = uluaGetVector2( L, 3 ); Vector2 position = uluaGetVector2( L, 3 );
Vector2 origin = uluaGetVector2( L, 4 ); Vector2 origin = uluaGetVector2( L, 4 );
float rotation = luaL_checknumber( L, 5 ); float rotation = luaL_checknumber( L, 5 );
@@ -541,8 +541,8 @@ int ltextDrawTextPro( lua_State *L ) {
Draw one character (codepoint) Draw one character (codepoint)
*/ */
int ltextDrawTextCodepoint( lua_State *L ) { int ltextDrawTextCodepoint( lua_State* L ) {
Font *font = uluaGetFont( L, 1 ); Font* font = uluaGetFont( L, 1 );
int codepoint = luaL_checkinteger( L, 2 ); int codepoint = luaL_checkinteger( L, 2 );
Vector2 position = uluaGetVector2( L, 3 ); Vector2 position = uluaGetVector2( L, 3 );
float fontSize = luaL_checknumber( L, 4 ); float fontSize = luaL_checknumber( L, 4 );
@@ -558,8 +558,8 @@ int ltextDrawTextCodepoint( lua_State *L ) {
Draw multiple character (codepoint) Draw multiple character (codepoint)
*/ */
int ltextDrawTextCodepoints( lua_State *L ) { int ltextDrawTextCodepoints( lua_State* L ) {
Font *font = uluaGetFont( L, 1 ); Font* font = uluaGetFont( L, 1 );
Vector2 position = uluaGetVector2( L, 3 ); Vector2 position = uluaGetVector2( L, 3 );
float fontSize = luaL_checknumber( L, 4 ); float fontSize = luaL_checknumber( L, 4 );
float spacing = luaL_checknumber( L, 5 ); float spacing = luaL_checknumber( L, 5 );
@@ -590,9 +590,9 @@ Draw text using font inside rectangle limits. Return character id from mouse pos
- Success return int - Success return int
*/ */
int ltextDrawTextBoxed( lua_State *L ) { int ltextDrawTextBoxed( lua_State* L ) {
Font *font = uluaGetFont( L, 1 ); Font* font = uluaGetFont( L, 1 );
const char *text = luaL_checkstring( L, 2 ); const char* text = luaL_checkstring( L, 2 );
Rectangle rec = uluaGetRectangle( L, 3 ); Rectangle rec = uluaGetRectangle( L, 3 );
float fontSize = luaL_checknumber( L, 4 ); float fontSize = luaL_checknumber( L, 4 );
float spacing = luaL_checknumber( L, 5 ); float spacing = luaL_checknumber( L, 5 );
@@ -611,9 +611,9 @@ Draw text using font inside rectangle limits with support for tint and backgroun
- Success return int - Success return int
*/ */
int ltextDrawTextBoxedTinted( lua_State *L ) { int ltextDrawTextBoxedTinted( lua_State* L ) {
Font *font = uluaGetFont( L, 1 ); Font* font = uluaGetFont( L, 1 );
const char *text = luaL_checkstring( L, 2 ); const char* text = luaL_checkstring( L, 2 );
Rectangle rec = uluaGetRectangle( L, 3 ); Rectangle rec = uluaGetRectangle( L, 3 );
float fontSize = luaL_checknumber( L, 4 ); float fontSize = luaL_checknumber( L, 4 );
float spacing = luaL_checknumber( L, 5 ); float spacing = luaL_checknumber( L, 5 );
@@ -656,7 +656,7 @@ int ltextDrawTextBoxedTinted( lua_State *L ) {
Set vertical line spacing when drawing with line-breaks Set vertical line spacing when drawing with line-breaks
*/ */
int ltextSetTextLineSpacing( lua_State *L ) { int ltextSetTextLineSpacing( lua_State* L ) {
int spacing = luaL_checkinteger( L, 1 ); int spacing = luaL_checkinteger( L, 1 );
SetTextLineSpacing( spacing ); SetTextLineSpacing( spacing );
@@ -669,8 +669,8 @@ Measure string size for Font
- Success return Vector2 - Success return Vector2
*/ */
int ltextMeasureText( lua_State *L ) { int ltextMeasureText( lua_State* L ) {
Font *font = uluaGetFont( L, 1 ); Font* font = uluaGetFont( L, 1 );
float fontSize = luaL_checknumber( L, 3 ); float fontSize = luaL_checknumber( L, 3 );
float spacing = luaL_checknumber( L, 4 ); float spacing = luaL_checknumber( L, 4 );
@@ -686,8 +686,8 @@ Get glyph index position in font for a codepoint (unicode character), fallback t
- Success return int - Success return int
*/ */
int ltextGetGlyphIndex( lua_State *L ) { int ltextGetGlyphIndex( lua_State* L ) {
Font *font = uluaGetFont( L, 1 ); Font* font = uluaGetFont( L, 1 );
int codepoint = luaL_checkinteger( L, 2 ); int codepoint = luaL_checkinteger( L, 2 );
lua_pushinteger( L, GetGlyphIndex( *font, codepoint ) ); lua_pushinteger( L, GetGlyphIndex( *font, codepoint ) );
@@ -702,8 +702,8 @@ Get glyph font info data for a codepoint (unicode character), fallback to '?' if
- Success return GlyphInfo - Success return GlyphInfo
*/ */
int ltextGetGlyphInfo( lua_State *L ) { int ltextGetGlyphInfo( lua_State* L ) {
Font *font = uluaGetFont( L, 1 ); Font* font = uluaGetFont( L, 1 );
int codepoint = luaL_checkinteger( L, 2 ); int codepoint = luaL_checkinteger( L, 2 );
int id = GetGlyphIndex( *font, codepoint ); int id = GetGlyphIndex( *font, codepoint );
@@ -720,8 +720,8 @@ Get glyph font info data by index. Return as lightuserdata
- Failure return nil - Failure return nil
- Success return GlyphInfo - Success return GlyphInfo
*/ */
int ltextGetGlyphInfoByIndex( lua_State *L ) { int ltextGetGlyphInfoByIndex( lua_State* L ) {
Font *font = uluaGetFont( L, 1 ); Font* font = uluaGetFont( L, 1 );
int index = luaL_checkinteger( L, 2 ); int index = luaL_checkinteger( L, 2 );
if ( 0 <= index && index < font->glyphCount ) { if ( 0 <= index && index < font->glyphCount ) {
@@ -742,8 +742,8 @@ Get glyph rectangle in font atlas for a codepoint (unicode character), fallback
- Success return Rectangle - Success return Rectangle
*/ */
int ltextGetGlyphAtlasRec( lua_State *L ) { int ltextGetGlyphAtlasRec( lua_State* L ) {
Font *font = uluaGetFont( L, 1 ); Font* font = uluaGetFont( L, 1 );
int codepoint = luaL_checkinteger( L, 2 ); int codepoint = luaL_checkinteger( L, 2 );
uluaPushRectangle( L, GetGlyphAtlasRec( *font, codepoint ) ); uluaPushRectangle( L, GetGlyphAtlasRec( *font, codepoint ) );
@@ -759,8 +759,8 @@ Get glyph rectangle in font atlas by index
- Failure return nil - Failure return nil
- Success return Rectangle - Success return Rectangle
*/ */
int ltextGetGlyphAtlasRecByIndex( lua_State *L ) { int ltextGetGlyphAtlasRecByIndex( lua_State* L ) {
Font *font = uluaGetFont( L, 1 ); Font* font = uluaGetFont( L, 1 );
int index = luaL_checkinteger( L, 2 ); int index = luaL_checkinteger( L, 2 );
if ( 0 <= index && index < font->glyphCount ) { if ( 0 <= index && index < font->glyphCount ) {
@@ -781,8 +781,8 @@ Get font base size (default chars height)
- Success return int - Success return int
*/ */
int ltextGetFontBaseSize( lua_State *L ) { int ltextGetFontBaseSize( lua_State* L ) {
Font *font = uluaGetFont( L, 1 ); Font* font = uluaGetFont( L, 1 );
lua_pushinteger( L, font->baseSize ); lua_pushinteger( L, font->baseSize );
@@ -796,8 +796,8 @@ Get font number of glyph characters
- Success return int - Success return int
*/ */
int ltextGetFontGlyphCount( lua_State *L ) { int ltextGetFontGlyphCount( lua_State* L ) {
Font *font = uluaGetFont( L, 1 ); Font* font = uluaGetFont( L, 1 );
lua_pushinteger( L, font->glyphCount ); lua_pushinteger( L, font->glyphCount );
@@ -811,8 +811,8 @@ Get font padding around the glyph characters
- Success return int - Success return int
*/ */
int ltextGetFontGlyphPadding( lua_State *L ) { int ltextGetFontGlyphPadding( lua_State* L ) {
Font *font = uluaGetFont( L, 1 ); Font* font = uluaGetFont( L, 1 );
lua_pushinteger( L, font->glyphPadding ); lua_pushinteger( L, font->glyphPadding );
@@ -826,8 +826,8 @@ Get font texture atlas containing the glyphs. Return as lightuserdata
- Success return Texture - Success return Texture
*/ */
int ltextGetFontTexture( lua_State *L ) { int ltextGetFontTexture( lua_State* L ) {
Font *font = uluaGetFont( L, 1 ); Font* font = uluaGetFont( L, 1 );
lua_pushlightuserdata( L, &font->texture ); lua_pushlightuserdata( L, &font->texture );
@@ -845,7 +845,7 @@ Load GlyphInfo from data
- Success return GlyphInfo - Success return GlyphInfo
*/ */
int ltextLoadGlyphInfo( lua_State *L ) { int ltextLoadGlyphInfo( lua_State* L ) {
luaL_checktype( L, 1, LUA_TTABLE ); luaL_checktype( L, 1, LUA_TTABLE );
GlyphInfo glyph = { 0 }; GlyphInfo glyph = { 0 };
@@ -881,8 +881,8 @@ int ltextLoadGlyphInfo( lua_State *L ) {
Unload glyphInfo image from CPU memory (RAM) Unload glyphInfo image from CPU memory (RAM)
*/ */
int ltextUnloadGlyphInfo( lua_State *L ) { int ltextUnloadGlyphInfo( lua_State* L ) {
GlyphInfo *glyph = uluaGetGlyphInfo( L, 1 ); GlyphInfo* glyph = uluaGetGlyphInfo( L, 1 );
unloadGlyphInfo( glyph ); unloadGlyphInfo( glyph );
@@ -894,8 +894,8 @@ int ltextUnloadGlyphInfo( lua_State *L ) {
Set glyphInfo character value (Unicode) Set glyphInfo character value (Unicode)
*/ */
int ltextSetGlyphInfoValue( lua_State *L ) { int ltextSetGlyphInfoValue( lua_State* L ) {
GlyphInfo *glyph = uluaGetGlyphInfo( L, 1 ); GlyphInfo* glyph = uluaGetGlyphInfo( L, 1 );
int value = luaL_checkinteger( L, 2 ); int value = luaL_checkinteger( L, 2 );
glyph->value = value; glyph->value = value;
@@ -908,8 +908,8 @@ int ltextSetGlyphInfoValue( lua_State *L ) {
Set glyphInfo character offset when drawing Set glyphInfo character offset when drawing
*/ */
int ltextSetGlyphInfoOffset( lua_State *L ) { int ltextSetGlyphInfoOffset( lua_State* L ) {
GlyphInfo *glyph = uluaGetGlyphInfo( L, 1 ); GlyphInfo* glyph = uluaGetGlyphInfo( L, 1 );
Vector2 offset = uluaGetVector2( L, 2 ); Vector2 offset = uluaGetVector2( L, 2 );
glyph->offsetX = (int)offset.x; glyph->offsetX = (int)offset.x;
@@ -923,8 +923,8 @@ int ltextSetGlyphInfoOffset( lua_State *L ) {
Set glyphInfo character advance position X Set glyphInfo character advance position X
*/ */
int ltextSetGlyphInfoAdvanceX( lua_State *L ) { int ltextSetGlyphInfoAdvanceX( lua_State* L ) {
GlyphInfo *glyph = uluaGetGlyphInfo( L, 1 ); GlyphInfo* glyph = uluaGetGlyphInfo( L, 1 );
int advanceX = luaL_checkinteger( L, 2 ); int advanceX = luaL_checkinteger( L, 2 );
glyph->advanceX = advanceX; glyph->advanceX = advanceX;
@@ -937,8 +937,8 @@ int ltextSetGlyphInfoAdvanceX( lua_State *L ) {
Set glyphInfo character image data Set glyphInfo character image data
*/ */
int ltextSetGlyphInfoImage( lua_State *L ) { int ltextSetGlyphInfoImage( lua_State* L ) {
GlyphInfo *glyph = uluaGetGlyphInfo( L, 1 ); GlyphInfo* glyph = uluaGetGlyphInfo( L, 1 );
Image image = *uluaGetImage( L, 2 ); Image image = *uluaGetImage( L, 2 );
glyph->image = image; glyph->image = image;
@@ -953,8 +953,8 @@ Get glyphInfo character value (Unicode)
- Success return int - Success return int
*/ */
int ltextGetGlyphInfoValue( lua_State *L ) { int ltextGetGlyphInfoValue( lua_State* L ) {
GlyphInfo *glyph = uluaGetGlyphInfo( L, 1 ); GlyphInfo* glyph = uluaGetGlyphInfo( L, 1 );
lua_pushinteger( L, glyph->value ); lua_pushinteger( L, glyph->value );
@@ -968,8 +968,8 @@ Get glyphInfo character offset when drawing
- Success return Vector2 - Success return Vector2
*/ */
int ltextGetGlyphInfoOffset( lua_State *L ) { int ltextGetGlyphInfoOffset( lua_State* L ) {
GlyphInfo *glyph = uluaGetGlyphInfo( L, 1 ); GlyphInfo* glyph = uluaGetGlyphInfo( L, 1 );
uluaPushVector2( L, (Vector2){ glyph->offsetX, glyph->offsetY } ); uluaPushVector2( L, (Vector2){ glyph->offsetX, glyph->offsetY } );
@@ -983,8 +983,8 @@ Get glyphInfo character advance position X
- Success return int - Success return int
*/ */
int ltextGetGlyphInfoAdvanceX( lua_State *L ) { int ltextGetGlyphInfoAdvanceX( lua_State* L ) {
GlyphInfo *glyph = uluaGetGlyphInfo( L, 1 ); GlyphInfo* glyph = uluaGetGlyphInfo( L, 1 );
lua_pushinteger( L, glyph->advanceX ); lua_pushinteger( L, glyph->advanceX );
@@ -998,8 +998,8 @@ Get glyphInfo character image data. Return as lightuserdata
- Success return Image - Success return Image
*/ */
int ltextGetGlyphInfoImage( lua_State *L ) { int ltextGetGlyphInfoImage( lua_State* L ) {
GlyphInfo *glyph = uluaGetGlyphInfo( L, 1 ); GlyphInfo* glyph = uluaGetGlyphInfo( L, 1 );
lua_pushlightuserdata( L, &glyph->image ); lua_pushlightuserdata( L, &glyph->image );
@@ -1017,7 +1017,7 @@ Load UTF-8 text encoded from codepoints array
- Success return string - Success return string
*/ */
int ltextLoadUTF8( lua_State *L ) { int ltextLoadUTF8( lua_State* L ) {
int codepointCount = uluaGetTableLen( L, 1 ); int codepointCount = uluaGetTableLen( L, 1 );
int codepoints[ codepointCount ]; int codepoints[ codepointCount ];
getCodepoints( L, codepoints, 1 ); getCodepoints( L, codepoints, 1 );
@@ -1036,7 +1036,7 @@ Load all codepoints from a UTF-8 text string
- Success return int{} - Success return int{}
*/ */
int ltextLoadCodepoints( lua_State *L ) { int ltextLoadCodepoints( lua_State* L ) {
const char* text = luaL_checkstring( L, 1 ); const char* text = luaL_checkstring( L, 1 );
int count = 0; int count = 0;
@@ -1060,7 +1060,7 @@ Get total number of codepoints in a UTF-8 encoded string
- Success return int - Success return int
*/ */
int ltextGetCodepointCount( lua_State *L ) { int ltextGetCodepointCount( lua_State* L ) {
const char* text = luaL_checkstring( L, 1 ); const char* text = luaL_checkstring( L, 1 );
lua_pushinteger( L, GetCodepointCount( text ) ); lua_pushinteger( L, GetCodepointCount( text ) );
@@ -1075,7 +1075,7 @@ Get codepoint in a UTF-8 encoded string, 0x3f('?') is returned on failure
- Success return int, int - Success return int, int
*/ */
int ltextGetCodepoint( lua_State *L ) { int ltextGetCodepoint( lua_State* L ) {
const char* text = luaL_checkstring( L, 1 ); const char* text = luaL_checkstring( L, 1 );
int codepointSize = 0; int codepointSize = 0;
@@ -1092,7 +1092,7 @@ Get next codepoint in a UTF-8 encoded string, 0x3f('?') is returned on failure
- Success return int, int - Success return int, int
*/ */
int ltextGetCodepointNext( lua_State *L ) { int ltextGetCodepointNext( lua_State* L ) {
const char* text = luaL_checkstring( L, 1 ); const char* text = luaL_checkstring( L, 1 );
int codepointSize = 0; int codepointSize = 0;
@@ -1109,7 +1109,7 @@ Get previous codepoint in a UTF-8 encoded string, 0x3f('?') is returned on failu
- Success return int, int - Success return int, int
*/ */
int ltextGetCodepointPrevious( lua_State *L ) { int ltextGetCodepointPrevious( lua_State* L ) {
const char* text = luaL_checkstring( L, 1 ); const char* text = luaL_checkstring( L, 1 );
int codepointSize = 0; int codepointSize = 0;
@@ -1126,7 +1126,7 @@ Encode one codepoint into UTF-8 byte array
- Success return string - Success return string
*/ */
int ltextCodepointToUTF8( lua_State *L ) { int ltextCodepointToUTF8( lua_State* L ) {
int codepoint = luaL_checkinteger( L, 1 ); int codepoint = luaL_checkinteger( L, 1 );
int utf8Size = 0; int utf8Size = 0;
@@ -1150,7 +1150,7 @@ Insert text in a specific position, moves all text forward
- Success return string - Success return string
*/ */
int ltextTextInsert( lua_State *L ) { int ltextTextInsert( lua_State* L ) {
const char* text = luaL_checkstring( L, 1 ); const char* text = luaL_checkstring( L, 1 );
const char* insert = luaL_checkstring( L, 2 ); const char* insert = luaL_checkstring( L, 2 );
int position = luaL_checkinteger( L, 3 ); int position = luaL_checkinteger( L, 3 );
@@ -1180,7 +1180,7 @@ Split text into multiple strings
- Success return string{} - Success return string{}
*/ */
int ltextTextSplit( lua_State *L ) { int ltextTextSplit( lua_State* L ) {
const char* text = luaL_checkstring( L, 1 ); const char* text = luaL_checkstring( L, 1 );
const char* delimiter = luaL_checkstring( L, 2 ); const char* delimiter = luaL_checkstring( L, 2 );

File diff suppressed because it is too large Load Diff