Fixed various doc and make clean, added textures_software_rendering
This commit is contained in:
parent
e4eb705aa6
commit
1fc022b604
@ -110,7 +110,7 @@ rl.CloseWindow()
|
|||||||
|
|
||||||
### Compatibility
|
### 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)).
|
(see [compat.lua](https://github.com/TSnake41/raylib-lua/blob/master/src/compat.lua)).
|
||||||
physac and rlgl modules are built-in by default.
|
physac and rlgl modules are built-in by default.
|
||||||
raygui is supported, but is minimally tested, please report any issues you have
|
raygui is supported, but is minimally tested, please report any issues you have
|
||||||
|
42
examples/textures_software_rendering.lua
Normal file
42
examples/textures_software_rendering.lua
Normal 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()
|
2
makefile
2
makefile
@ -89,7 +89,7 @@ src/autogen/builder.c: src/raylua_builder.lua
|
|||||||
clean:
|
clean:
|
||||||
rm -rf raylua_s raylua_e libraylua.a src/raylua_e.o src/raylua_s.o \
|
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/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 luajit clean
|
||||||
$(MAKE) -C raylib/src clean
|
$(MAKE) -C raylib/src clean
|
||||||
rm -f raylib/libraylib.a
|
rm -f raylib/libraylib.a
|
||||||
|
Loading…
Reference in New Issue
Block a user