Fixed various doc and make clean, added textures_software_rendering

This commit is contained in:
TSnake41 2020-12-29 14:03:13 +01:00
parent e4eb705aa6
commit 1fc022b604
3 changed files with 44 additions and 2 deletions

View File

@ -110,7 +110,7 @@ rl.CloseWindow()
### Compatibility
raylib-lua (raylua) currently uses raylib 3.1-dev API with some 3.0 API compatibility
raylib-lua (raylua) currently uses raylib 3.5 API.
(see [compat.lua](https://github.com/TSnake41/raylib-lua/blob/master/src/compat.lua)).
physac and rlgl modules are built-in by default.
raygui is supported, but is minimally tested, please report any issues you have

View File

@ -0,0 +1,42 @@
local lua_color = rl.new("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 = rl.new "Image"
local fb_data = rl.new("Color[?]", width * height)
framebuffer.width = width
framebuffer.height = height
framebuffer.format = rl.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()

View File

@ -89,7 +89,7 @@ src/autogen/builder.c: src/raylua_builder.lua
clean:
rm -rf raylua_s raylua_e libraylua.a src/raylua_e.o src/raylua_s.o \
src/raylua.o src/raylua_self.o src/raylua_builder.o src/autogen/*.c \
src/lib/miniz.o
src/lib/miniz.o src/res/icon.res
$(MAKE) -C luajit clean
$(MAKE) -C raylib/src clean
rm -f raylib/libraylib.a