Reintroducing Unload functions. Is*Ready functions. GC_UNLOAD setting and check function.

This commit is contained in:
jussi
2023-10-30 22:40:20 +02:00
parent 6e0d577d63
commit c3295e014d
37 changed files with 853 additions and 646 deletions

178
API.md
View File

@@ -45,16 +45,6 @@ This function will be called on program close. Cleanup could be done here.
Arguments are stored in 'RL.arg' array.
## Default objects
> RL.defaultFont
Default Font object
> RL.defaultMaterial
Default Material object
## Types
Raylib structs in Lua
@@ -1804,6 +1794,20 @@ Load Buffer. Type should be one of the Buffer types
---
> RL.UnloadBuffer( Buffer buffer )
Unload buffer data
---
> enabled = RL.IsGCUnloadEnabled()
Check if Lua garbage collection is set to unload object data
- Success return bool
---
## Core - Cursor
---
@@ -1918,6 +1922,14 @@ NOTE: Set nil if no shader
---
> isReady = RL.IsShaderReady( Shader shader )
Check if a shader is ready
- Success return bool
---
> RL.BeginShaderMode( Shader shader )
Begin custom shader drawing
@@ -1986,6 +1998,12 @@ NOTE: Even one value should be in table
---
> RL.UnloadShader( Shader shader )
Unload shader from GPU memory (VRAM)
---
## Core - Input-related Keyboard
---
@@ -3106,6 +3124,20 @@ Load image from screen buffer and (screenshot)
---
> isReady = RL.IsImageReady( Image image )
Check if an image is ready
- Success return bool
---
> RL.UnloadImage( Image image )
Unload image from CPU memory (RAM)
---
> success = RL.ExportImage( Image image, string fileName )
Export image data to file, returns true on success
@@ -3543,6 +3575,26 @@ Check if a texture is ready
---
> RL.UnloadTexture( Texture texture )
Unload texture from GPU memory (VRAM)
---
> isReady = RL.IsRenderTextureReady( RenderTexture target )
Check if a render texture is ready
- Success return bool
---
> RL.UnloadRenderTexture( RenderTexture target )
Unload render texture from GPU memory (VRAM)
---
> RL.UpdateTexture( Texture texture, int{} pixels )
Update GPU texture with new data
@@ -3801,7 +3853,7 @@ Get pixel data size in bytes for certain format
> RL.GetFontDefault()
Get the default Font
Get the default Font. Return as lightuserdata
---
@@ -3831,6 +3883,20 @@ Load font from Image ( XNA style)
---
> isReady = RL.IsFontReady( Font font )
Check if a font is ready
- Success return bool
---
> RL.UnloadFont( Font font )
Unload font from GPU memory (VRAM)
---
## Text - Draw
---
@@ -3891,7 +3957,7 @@ Get font padding around the glyph characters
> texture = RL.GetFontTexture( Font font )
Get font texture atlas containing the glyphs.
Get font texture atlas containing the glyphs. Returns as lightuserdata
- Success return Texture
@@ -4106,6 +4172,12 @@ Note! Mainly intented to be used with custom meshes.
---
> RL.UnloadMesh( Mesh mesh )
Unload mesh data from CPU and GPU
---
> RL.DrawMesh( Mesh mesh, Material material, Matrix transform )
Draw a 3d mesh with material and transform
@@ -4154,9 +4226,17 @@ Compute mesh tangents
---
> material = RL.GetMaterialDefault()
Default material for reference. Return as lightuserdata
- Success return Material
---
> material = RL.LoadMaterialDefault()
Load default material
Load default material as new object
- Success return Material
@@ -4170,6 +4250,20 @@ Load material from table. See material table definition
---
> isReady = RL.IsMaterialReady( Material material )
Check if a material is ready
- Success return bool
---
> RL.UnloadMaterial( Material material )
Unload material from GPU memory (VRAM)
---
> RL.SetMaterialTexture( Material material, int mapType, Texture texture )
Set texture for a material map type (MATERIAL_MAP_ALBEDO, MATERIAL_MAP_METALNESS...)
@@ -4228,7 +4322,7 @@ Get color from material map type
Get material shader
- Success return Shader. Returns as lightuserdata
- Success return Shader. Return as lightuserdata
---
@@ -4261,6 +4355,20 @@ Load model from generated mesh (Default material)
---
> isReady = RL.IsModelReady( Model model )
Check if a model is ready
- Success return bool
---
> RL.UnloadModel( Model model )
Unload model (including meshes) from memory (RAM and/or VRAM)
---
> RL.DrawModel( Model model, Vector3 position, float scale, Color tint )
Draw a model (With texture if set)
@@ -4460,6 +4568,14 @@ Load wave data from file
---
> isReady = RL.IsWaveReady( Wave wave )
Checks if wave data is ready
- Success return bool
---
> sound = RL.LoadSoundFromWave( Wave wave )
Load sound from wave data
@@ -4468,6 +4584,26 @@ Load sound from wave data
---
> isReady = RL.IsSoundReady( Sound sound )
Checks if a sound is ready
- Success return bool
---
> RL.UnloadWave( Wave wave )
Unload wave data
---
> RL.UnloadSound( Sound sound )
Unload sound
---
> success = RL.ExportWave( Wave wave, string fileName )
Export wave data to file, returns true on success
@@ -4570,6 +4706,20 @@ Load music stream from file
---
> isReady = RL.IsMusicReady( Music music )
Checks if a music stream is ready
- Success return bool
---
> RL.UnloadMusicStream( Music music )
Unload music stream
---
> RL.PlayMusicStream( Music music )
Start music playing