From b2b821929505aea2535d38382b743ad5dd5d1fa0 Mon Sep 17 00:00:00 2001 From: jussi Date: Fri, 16 Feb 2024 17:28:09 +0200 Subject: GetBufferData extra arguments. GetBufferElementSize and GetBufferLength. --- examples/compress_data/main.lua | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'examples/compress_data/main.lua') diff --git a/examples/compress_data/main.lua b/examples/compress_data/main.lua index bf6c162..3ee724c 100644 --- a/examples/compress_data/main.lua +++ b/examples/compress_data/main.lua @@ -21,7 +21,7 @@ local function compressDecompressData() deCompressedText = "" - for _, c in ipairs( RL.GetBufferData( deCompBuffer ) ) do + for _, c in ipairs( RL.GetBufferData( deCompBuffer, 0, RL.GetBufferLength( deCompBuffer ) ) ) do deCompressedText = deCompressedText..string.char( c ) end end @@ -30,14 +30,14 @@ function RL.draw() RL.ClearBackground( RL.RAYWHITE ) RL.DrawText( "Decompressed text: "..deCompressedText, { 20, 200 }, 20, textColor ) - if RL.GuiButton( { 20, 20, 168, 32 }, "Compress/Decompress Data" ) then + if 0 < RL.GuiButton( { 20, 20, 168, 32 }, "Compress/Decompress Data" ) then compressDecompressData() end local pressed = false pressed, text = RL.GuiTextBox( { 220, 20, 400, 32 }, text, 64, editMode ) - if pressed then + if 0 < pressed then editMode = not editMode end end -- cgit v1.2.3