[rlua] new module: raylib Lua binding
This commit is contained in:
parent
d3d9aaceb1
commit
735968e685
10 changed files with 5289 additions and 0 deletions
41
examples/core_basic_window.lua
Normal file
41
examples/core_basic_window.lua
Normal file
|
@ -0,0 +1,41 @@
|
|||
-- Initialization
|
||||
----------------------------------------------------------------------------------------
|
||||
local screenWidth = 800
|
||||
local screenHeight = 450
|
||||
|
||||
InitWindow(screenWidth, screenHeight, "raylib [rlua] example - basic window")
|
||||
|
||||
InitAudioDevice()
|
||||
|
||||
--local pause = false
|
||||
--local texture = LoadTexture("resources/texture.png")
|
||||
|
||||
SetTargetFPS(60) -- Set target frames-per-second
|
||||
----------------------------------------------------------------------------------------
|
||||
|
||||
while not WindowShouldClose() do
|
||||
-- Update
|
||||
------------------------------------------------------------------------------------
|
||||
--if (IsKeyPressed(KEY.SPACE)) then
|
||||
-- pause = not pause
|
||||
--end
|
||||
------------------------------------------------------------------------------------
|
||||
|
||||
-- Draw
|
||||
------------------------------------------------------------------------------------
|
||||
BeginDrawing()
|
||||
|
||||
ClearBackground(RAYWHITE)
|
||||
|
||||
DrawText("Congrats! You created your first window!", 190, 200, 20, LIGHTGRAY)
|
||||
|
||||
EndDrawing()
|
||||
------------------------------------------------------------------------------------
|
||||
end
|
||||
|
||||
-- De-Initialization
|
||||
------------------------------------------------------------------------------------
|
||||
CloseAudioDevice() -- Close audio device
|
||||
|
||||
CloseWindow() -- Close window and OpenGL context
|
||||
------------------------------------------------------------------------------------
|
Loading…
Add table
Add a link
Reference in a new issue