local v=require("\102\102\105")local M=require("\114\097\121\108\105\098")local O=M.Color(3,3,128,255)local U,J=800,450 M.SetConfigFlags(M.FLAG_VSYNC_HINT)M.SetTraceLogLevel(M.LOG_WARNING)M.InitWindow(U,J,"\114\097\121\108\105\098 \091\115\104\097\112\101\115\093 \101\120\097\109\112\108\101 - \115\111\102\116\119\097\114\101 \114\101\110\100\101\114\101\100 \114\097\121\108\105\098 \108\111\103\111")local W=v.new("\073\109\097\103\101")local K=v.new("\067\111\108\111\114\091\063\093",U*J)W.width=U W.height=J W.format=M.PIXELFORMAT_UNCOMPRESSED_R8G8B8A8 W.mipmaps=1 W.data=K local F=M.LoadTextureFromImage(W)while not M.WindowShouldClose()do for v=0,U*J-1,1 do K[v]=M.RAYWHITE end M.ImageDrawRectangle(W,U/2-128,J/2-128,256,256,O)M.ImageDrawRectangle(W,U/2-112,J/2-112,224,224,M.RAYWHITE)M.ImageDrawText(W,"\114\097\121\108\105\098",U/2-44,J/2+24,50,O)M.ImageDrawText(W,"\076\117\097",U/2-44,J/2+65,50,O)M.ImageDrawText(W,"\116\104\105\115 \105\115 \078\079\084 \097 \116\101\120\116\117\114\101\033",350,370,10,M.GRAY)M.UpdateTexture(F,K)M.BeginDrawing()M.ClearBackground(M.RAYWHITE)M.DrawTexture(F,0,0,M.WHITE)M.DrawFPS(10,10)M.EndDrawing()end M.CloseWindow()
local ffi = require("ffi")
local rl = require("raylib")

local lua_color = rl.Color(3, 3, 128, 255)

local width, height = 800, 450

rl.SetConfigFlags(rl.FLAG_VSYNC_HINT)
rl.SetTraceLogLevel(rl.LOG_WARNING)
rl.InitWindow(width, height, "raylib [shapes] example - software rendered raylib logo")

local framebuffer = ffi.new("Image")
local fb_data = ffi.new("Color[?]", width * height)

framebuffer.width = width
framebuffer.height = height
framebuffer.format = rl.PIXELFORMAT_UNCOMPRESSED_R8G8B8A8
framebuffer.mipmaps = 1
framebuffer.data = fb_data

local fb_texture = rl.LoadTextureFromImage(framebuffer)

while not rl.WindowShouldClose() do
  --rl.ImageClearBackground(framebuffer, rl.RAYWHITE)
  for i = 0, width * height - 1 do
    fb_data[i] = rl.RAYWHITE
  end

  rl.ImageDrawRectangle(framebuffer, width / 2 - 128, height / 2 - 128, 256, 256, lua_color)
  rl.ImageDrawRectangle(framebuffer, width / 2 - 112, height / 2 - 112, 224, 224, rl.RAYWHITE)
  rl.ImageDrawText(framebuffer, "raylib", width / 2 - 44, height / 2 + 24, 50, lua_color)
  rl.ImageDrawText(framebuffer, "Lua", width / 2 - 44, height / 2 + 65, 50, lua_color)

  rl.ImageDrawText(framebuffer, "this is NOT a texture!", 350, 370, 10, rl.GRAY)

  rl.UpdateTexture(fb_texture, fb_data)

  rl.BeginDrawing()
  rl.ClearBackground(rl.RAYWHITE)
  rl.DrawTexture(fb_texture, 0, 0, rl.WHITE)
  rl.DrawFPS(10, 10)
  rl.EndDrawing()
end

rl.CloseWindow()
