From a38e76873b5ca3080c8046ae4759866d8cccc4e5 Mon Sep 17 00:00:00 2001 From: jussi Date: Wed, 11 Jun 2025 17:00:25 +0300 Subject: uluaGet* pops lua stack correctly when userdata given in table. --- examples/instancing/main.lua | 6 ++++++ examples/lightmap/main.lua | 10 ++++++++-- 2 files changed, 14 insertions(+), 2 deletions(-) (limited to 'examples') diff --git a/examples/instancing/main.lua b/examples/instancing/main.lua index a20c6a3..1966479 100644 --- a/examples/instancing/main.lua +++ b/examples/instancing/main.lua @@ -29,6 +29,7 @@ function RL.init() RL.SetWindowPosition( { mPos[1] + mSize[1] / 2 - winSize[1] / 2, mPos[2] + mSize[2] / 2 - winSize[2] / 2 } ) RL.SetWindowTitle( "Instancing" ) RL.SetWindowState( RL.FLAG_VSYNC_HINT ) + RL.SetGCUnload( false ) -- Define the camera to look into our 3d world camera = RL.CreateCamera3D() @@ -108,3 +109,8 @@ function RL.draw() RL.DrawFPS( { 10, 10 } ) end + +function RL.exit() + RL.UnloadMaterial( matInstances, true ) + RL.UnloadMesh( cube ) +end diff --git a/examples/lightmap/main.lua b/examples/lightmap/main.lua index 20a2729..d7b576d 100644 --- a/examples/lightmap/main.lua +++ b/examples/lightmap/main.lua @@ -25,6 +25,7 @@ function RL.init() RL.SetWindowState( RL.FLAG_WINDOW_RESIZABLE ) RL.SetWindowState( RL.FLAG_VSYNC_HINT ) RL.SetWindowPosition( { mPos[1] + mSize[1] / 2 - winSize[1] / 2, mPos[2] + mSize[2] / 2 - winSize[2] / 2 } ) + RL.SetGCUnload( false ) camera = Cam3D:new() camera:setPosition( { 0, 8, 16 } ) @@ -48,9 +49,9 @@ function RL.init() tileTexture = RL.LoadTexture( RL.GetBasePath().."../resources/images/tile.png" ) RL.GenTextureMipmaps( tileTexture ) - RL.SetTextureFilter( tileTexture, RL.TEXTURE_FILTER_TRILINEAR ) + RL.SetTextureFilter( tileTexture, RL.TEXTURE_FILTER_BILINEAR ) lightmap = RL.LoadTexture( RL.GetBasePath().."../resources/images/lightmap.png" ) - RL.SetTextureFilter( lightmap, RL.TEXTURE_FILTER_TRILINEAR ) + RL.SetTextureFilter( lightmap, RL.TEXTURE_FILTER_BILINEAR ) shader = RL.LoadShader( RL.GetBasePath().."../resources/shaders/glsl"..GLSL_VERSION.."/lightmap.vs", RL.GetBasePath().."../resources/shaders/glsl"..GLSL_VERSION.."/lightmap.fs" ) @@ -99,3 +100,8 @@ function RL.draw() RL.DrawMesh( mesh, material, matrix ) camera:endMode3D() end + +function RL.exit() + RL.UnloadMaterial( material, true ) + RL.UnloadMesh( mesh ) +end -- cgit v1.2.3