summaryrefslogtreecommitdiff
path: root/API.md
diff options
context:
space:
mode:
authorjussi2023-11-20 21:04:53 +0200
committerjussi2023-11-20 21:04:53 +0200
commit05eaafb79e6fa1bebff157e94563334d7ead700b (patch)
tree574ae0af685967df067efe11058dc50478558333 /API.md
parent7765a23a2c90e6d02f6278eed1b1b9b9375bc941 (diff)
downloadreilua-enhanced-05eaafb79e6fa1bebff157e94563334d7ead700b.tar.gz
reilua-enhanced-05eaafb79e6fa1bebff157e94563334d7ead700b.tar.bz2
reilua-enhanced-05eaafb79e6fa1bebff157e94563334d7ead700b.zip
Initial changes for Raylib 5.0 and some missing functions.
Diffstat (limited to 'API.md')
-rw-r--r--API.md332
1 files changed, 241 insertions, 91 deletions
diff --git a/API.md b/API.md
index f8086af..8c79c10 100644
--- a/API.md
+++ b/API.md
@@ -1803,67 +1803,67 @@ Shader attribute type: vec4 (4 float)
---
-> PIXELFORMAT_COMPRESSED_DXT1_RGB = 11
+> PIXELFORMAT_COMPRESSED_DXT1_RGB = 14
4 bpp (no alpha)
---
-> PIXELFORMAT_COMPRESSED_DXT1_RGBA = 12
+> PIXELFORMAT_COMPRESSED_DXT1_RGBA = 15
4 bpp (1 bit alpha)
---
-> PIXELFORMAT_COMPRESSED_DXT3_RGBA = 13
+> PIXELFORMAT_COMPRESSED_DXT3_RGBA = 16
8 bpp
---
-> PIXELFORMAT_COMPRESSED_DXT5_RGBA = 14
+> PIXELFORMAT_COMPRESSED_DXT5_RGBA = 17
8 bpp
---
-> PIXELFORMAT_COMPRESSED_ETC1_RGB = 15
+> PIXELFORMAT_COMPRESSED_ETC1_RGB = 18
4 bpp
---
-> PIXELFORMAT_COMPRESSED_ETC2_RGB = 16
+> PIXELFORMAT_COMPRESSED_ETC2_RGB = 19
4 bpp
---
-> PIXELFORMAT_COMPRESSED_ETC2_EAC_RGBA = 17
+> PIXELFORMAT_COMPRESSED_ETC2_EAC_RGBA = 20
8 bpp
---
-> PIXELFORMAT_COMPRESSED_PVRT_RGB = 18
+> PIXELFORMAT_COMPRESSED_PVRT_RGB = 21
4 bpp
---
-> PIXELFORMAT_COMPRESSED_PVRT_RGBA = 19
+> PIXELFORMAT_COMPRESSED_PVRT_RGBA = 22
4 bpp
---
-> PIXELFORMAT_COMPRESSED_ASTC_4x4_RGBA = 20
+> PIXELFORMAT_COMPRESSED_ASTC_4x4_RGBA = 23
8 bpp
---
-> PIXELFORMAT_COMPRESSED_ASTC_8x8_RGBA = 21
+> PIXELFORMAT_COMPRESSED_ASTC_8x8_RGBA = 24
2 bpp
@@ -3540,6 +3540,12 @@ GLFW event joystick
---
+> RL.CloseWindow()
+
+Close window and unload OpenGL context and free all resources
+
+---
+
> state = RL.IsWindowReady()
Check if window has been initialized successfully
@@ -3588,121 +3594,147 @@ Check if window is currently focused (only PLATFORM_DESKTOP)
---
-> RL.SetWindowMonitor( int monitor )
+> resized = RL.IsWindowResized()
-Set monitor for the current window (fullscreen mode)
+Check if window has been resized from last frame
+
+- Success return bool
---
-> RL.SetWindowPosition( Vector2 pos )
+> state = RL.IsWindowState( int flag )
-Set window position on screen
+Check if one specific window flag is enabled (FLAG_FULLSCREEN_MODE, FLAG_WINDOW_RESIZABLE...)
+
+- Success return bool
---
-> RL.SetWindowSize( Vector2 size )
+> RL.SetWindowState( int flag )
-Set window dimensions
+Set window configuration state using flags (FLAG_FULLSCREEN_MODE, FLAG_WINDOW_RESIZABLE...)
---
-> RL.SetWindowOpacity( float opacity )
+> resized = RL.ClearWindowState( int flag )
-Set window opacity [0.0f..1.0f] (only PLATFORM_DESKTOP)
+Clear window configuration state flags (FLAG_FULLSCREEN_MODE, FLAG_WINDOW_RESIZABLE...)
----
+- Success return bool
-> windowHandle = RL.GetWindowHandle()
+---
-Get native window handle. Return as lightuserdata
+> RL.ToggleFullscreen()
-- Success return lightuserdata
+Toggle window state: fullscreen/windowed (only PLATFORM_DESKTOP)
---
-> RL.SetWindowMinSize( Vector2 size )
+> RL.ToggleBorderlessWindowed()
-Set window minimum dimensions (for FLAG_WINDOW_RESIZABLE)
+Toggle window state: borderless windowed (only PLATFORM_DESKTOP)
---
-> position = RL.GetMonitorPosition( int monitor )
-
-Get specified monitor position
+> RL.MaximizeWindow()
-- Success return Vector2
+Set window state: maximized, if resizable (only PLATFORM_DESKTOP)
---
-> size = RL.GetMonitorSize( int monitor )
+> RL.MinimizeWindow()
-Get specified monitor size
-
-- Success return Vector2
+Set window state: minimized, if resizable (only PLATFORM_DESKTOP)
---
-> position = RL.GetWindowPosition()
+> RL.RestoreWindow()
-Get window position on monitor
+Set window state: not minimized/maximized (only PLATFORM_DESKTOP)
-- Success return Vector2
+---
+
+> RL.SetWindowIcon( Image image )
+
+Set icon for window (Only PLATFORM_DESKTOP)
---
-> size = RL.GetScreenSize()
+> RL.SetWindowIcons( Image{} images )
-Get screen size
+Set icon for window (multiple images, RGBA 32bit, only PLATFORM_DESKTOP)
-- Success return Vector2
+---
+
+> RL.SetWindowTitle( string title )
+
+Set title for window (only PLATFORM_DESKTOP and PLATFORM_WEB)
---
-> RL.SetWindowState( int flag )
+> RL.SetWindowPosition( Vector2 pos )
-Set window configuration state using flags (FLAG_FULLSCREEN_MODE, FLAG_WINDOW_RESIZABLE...)
+Set window position on screen
---
-> state = RL.IsWindowState( int flag )
+> RL.SetWindowMonitor( int monitor )
-Check if one specific window flag is enabled (FLAG_FULLSCREEN_MODE, FLAG_WINDOW_RESIZABLE...)
+Set monitor for the current window
-- Success return bool
+---
+
+> RL.SetWindowMinSize( Vector2 size )
+
+Set window minimum dimensions (for FLAG_WINDOW_RESIZABLE)
---
-> resized = RL.ClearWindowState( int flag )
+> RL.SetWindowMaxSize( Vector2 size )
-Clear window configuration state flags (FLAG_FULLSCREEN_MODE, FLAG_WINDOW_RESIZABLE...)
+Set window maximum dimensions (for FLAG_WINDOW_RESIZABLE)
-- Success return bool
+---
+
+> RL.SetWindowSize( Vector2 size )
+
+Set window dimensions
---
-> resized = RL.IsWindowResized()
+> RL.SetWindowOpacity( float opacity )
-Check if window has been resized from last frame
+Set window opacity [0.0f..1.0f] (only PLATFORM_DESKTOP)
-- Success return bool
+---
+
+> RL.SetWindowFocused()
+
+Set window focused (only PLATFORM_DESKTOP)
---
-> RL.SetWindowIcon( Image image )
+> windowHandle = RL.GetWindowHandle()
-Set icon for window (Only PLATFORM_DESKTOP)
+Get native window handle. Return as lightuserdata
+
+- Success return lightuserdata
---
-> RL.SetWindowIcons( Image{} images )
+> size = RL.GetScreenSize()
-Set icon for window (multiple images, RGBA 32bit, only PLATFORM_DESKTOP)
+Get screen size
+
+- Success return Vector2
---
-> RL.SetWindowTitle( string title )
+> size = RL.GetRenderSize()
-Set title for window (Only PLATFORM_DESKTOP)
+Get render size
+
+- Success return Vector2
---
@@ -3722,6 +3754,22 @@ Get current connected monitor
---
+> position = RL.GetMonitorPosition( int monitor )
+
+Get specified monitor position
+
+- Success return Vector2
+
+---
+
+> size = RL.GetMonitorSize( int monitor )
+
+Get specified monitor size
+
+- Success return Vector2
+
+---
+
> size = RL.GetMonitorPhysicalSize( int monitor )
Get specified monitor physical size in millimetres
@@ -3738,25 +3786,27 @@ Get specified monitor refresh rate
---
-> dpi = RL.GetWindowScaleDPI()
+> position = RL.GetWindowPosition()
-Get window scale DPI factor
+Get window position on monitor
- Success return Vector2
---
-> name = RL.GetMonitorName( int monitor )
+> dpi = RL.GetWindowScaleDPI()
-Get the human-readable, UTF-8 encoded name of the monitor
+Get window scale DPI factor
-- Success return string
+- Success return Vector2
---
-> RL.CloseWindow()
+> name = RL.GetMonitorName( int monitor )
-Close window and unload OpenGL context and free all resources
+Get the human-readable, UTF-8 encoded name of the specified monitor
+
+- Success return string
---
@@ -4100,6 +4150,32 @@ Get elapsed time in seconds since InitWindow()
---
+## Core - Random values generation functions
+
+---
+
+> RL.SetRandomSeed( int seed )
+
+Set the seed for the random number generator
+
+---
+
+> time = RL.GetRandomValue( int min, int max )
+
+Get a random value between min and max (both included)
+
+- Success return int
+
+---
+
+> sequence = RL.GetRandomValue( int count, int min, int max )
+
+Load random values sequence, no values repeated
+
+- Success return int{}
+
+---
+
## Core - Misc
---
@@ -4144,7 +4220,7 @@ Get the log level for bad function calls and invalid data formats.
> RL.OpenURL( string url )
-Open URL with default system browser (If available)
+Open URL with default system browser (if available)
---
@@ -4254,6 +4330,14 @@ Get current working directory (Uses static string)
---
+> directory = RL.GetApplicationDirectory()
+
+Get the directory of the running application (uses static string)
+
+- Success return string
+
+---
+
> fileNames = RL.LoadDirectoryFiles( string dirPath )
Load directory filepaths
@@ -4444,6 +4528,14 @@ Detect if a gamepad is available
---
+> name = RL.GetGamepadName( int gamepad )
+
+Return gamepad internal name id
+
+- Success return string
+
+---
+
> pressed = RL.IsGamepadButtonPressed( int gamepad, int button )
Detect if a gamepad button has been pressed once
@@ -4484,11 +4576,11 @@ Return axis movement value for a gamepad axis
---
-> name = RL.GetGamepadName( int gamepad )
+> result = RL.SetGamepadMappings( string mappings )
-Return gamepad internal name id
+Set internal gamepad mappings (SDL_GameControllerDB)
-- Success return string
+- Success return int
---
@@ -5005,27 +5097,15 @@ Draw a line defining thickness
---
-> RL.DrawLineBezier( Vector2 startPos, Vector2 endPos, float thickness, Color color )
-
-Draw a line using cubic-bezier curves in-out
-
----
-
-> RL.DrawLineBezierQuad( Vector2 startPos, Vector2 endPos, Vector2 controlPos, float thickness, Color color )
-
-Draw line using quadratic bezier curves with a control point
-
----
-
-> RL.DrawLineBezierCubic( Vector2 startPos, Vector2 endPos, Vector2 startControlPos, Vector2 endControlPos, float thickness, Color color )
+> RL.DrawLineStrip( Vector2{} points, Color color )
-Draw line using quadratic bezier curves with a control point
+Draw lines sequence
---
-> RL.DrawLineStrip( Vector2{} points, Color color )
+> RL.DrawLineBezier( Vector2 startPos, Vector2 endPos, float thickness, Color color )
-Draw lines sequence
+Draw a line using cubic-bezier curves in-out
---
@@ -5285,6 +5365,14 @@ Load image from RAW file data
---
+> image = RL.LoadImageSvg( string fileNameOrString, Vector2 size )
+
+Load image from SVG file data or string with specified size
+
+- Success return Image
+
+---
+
> image, frameCount = RL.LoadImageAnim( string fileName )
Load image sequence from file (frames appended to image.data). All frames are returned in RGBA format
@@ -5340,6 +5428,14 @@ Export image data to file, returns true on success
---
+> buffer = RL.ExportImageToMemory( Image image, string fileType )
+
+Export image to memory buffer
+
+- Success return Buffer
+
+---
+
> success = RL.ExportImageAsCode( Image image, string fileName )
Export image as code file defining an array of bytes, returns true on success
@@ -5360,25 +5456,25 @@ Generate image: plain color
---
-> image = RL.GenImageGradientV( Vector2 size, Color top, Color bottom )
+> image = RL.GenImageGradientLinear( Vector2 size, int direction, Color a, Color b )
-Generate image: vertical gradient
+Generate image: linear gradient, direction in degrees [0..360], 0=Vertical gradient
- Success return Image
---
-> image = RL.GenImageGradientH( Vector2 size, Color left, Color right )
+> image = RL.GenImageGradientRadial( Vector2 size, float density, Color inner, Color outer )
-Generate image: horizontal gradient
+Generate image: radial gradient
- Success return Image
---
-> image = RL.GenImageGradientRadial( Vector2 size, float density, Color inner, Color outer )
+> image = RL.GenImageGradientSquare( Vector2 size, float density, Color inner, Color outer )
-Generate image: radial gradient
+Generate image: square gradient
- Success return Image
@@ -5542,6 +5638,12 @@ Flip image horizontally
---
+> RL.ImageRotate( Image image, int degrees )
+
+Rotate image by input angle in degrees (-359 to 359)
+
+---
+
> RL.ImageRotateCW( Image image )
Rotate image clockwise 90deg
@@ -6048,9 +6150,9 @@ Load font from file into GPU memory (VRAM)
---
-> font = RL.LoadFontEx( string fileName, int fontSize, int{} fontChars )
+> font = RL.LoadFontEx( string fileName, int fontSize, int{} codepoints )
-Load font from file with extended parameters, use NULL for fontChars to load the default character set
+Load font from file with extended parameters, use NULL for codepoints to load the default character set
- Failure return nil
- Success return Font
@@ -6139,6 +6241,12 @@ Draw text using font inside rectangle limits with support for tint and backgroun
---
+> size = RL.SetTextLineSpacing( int spacing )
+
+Set vertical line spacing when drawing with line-breaks
+
+---
+
> size = RL.MeasureText( Font font, string text, float fontSize, float spacing )
Measure string size for Font
@@ -6834,12 +6942,40 @@ Get collision info between ray and quad
---
+> RL.InitAudioDevice()
+
+Initialize audio device and context
+
+---
+
+> RL.CloseAudioDevice()
+
+Close the audio device and context
+
+---
+
+> isReady = RL.IsAudioDeviceReady()
+
+Check if audio device has been initialized successfully
+
+- Success return bool
+
+---
+
> RL.SetMasterVolume( float volume )
Set master volume (listener)
---
+> isReady = RL.GetMasterVolume()
+
+Get master volume (listener)
+
+- Success return float
+
+---
+
## Audio - Wave/Sound loading/unloading functions
---
@@ -6878,6 +7014,14 @@ Load sound from wave data
---
+> sound = RL.LoadSoundAlias( Sound source )
+
+Create a new sound that shares the same sample data as the source sound, does not own the sound data
+
+- Success return Sound
+
+---
+
> isReady = RL.IsSoundReady( Sound sound )
Checks if a sound is ready
@@ -6898,6 +7042,12 @@ Unload sound
---
+> RL.UnloadSoundAlias( Sound alias )
+
+Unload a sound alias (does not deallocate sample data)
+
+---
+
> success = RL.ExportWave( Wave wave, string fileName )
Export wave data to file, returns true on success