GetBufferData extra arguments. GetBufferElementSize and GetBufferLength.

This commit is contained in:
jussi
2024-02-16 17:28:09 +02:00
parent 48adbe20dc
commit b2b8219295
7 changed files with 102 additions and 26 deletions

View File

@@ -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