diff options
| author | raysan5 <raysan5@gmail.com> | 2016-08-03 21:38:21 +0200 |
|---|---|---|
| committer | raysan5 <raysan5@gmail.com> | 2016-08-03 21:38:21 +0200 |
| commit | 735968e68543bb5141122f181608d0d7ada9a3be (patch) | |
| tree | a8763182a289c9d321d08d51cc54f7169c858310 /examples/core_basic_window.lua | |
| parent | d3d9aaceb12111ebe54f55f23cd87dfb43964f1f (diff) | |
| download | raylib-735968e68543bb5141122f181608d0d7ada9a3be.tar.gz raylib-735968e68543bb5141122f181608d0d7ada9a3be.zip | |
[rlua] new module: raylib Lua binding
Diffstat (limited to 'examples/core_basic_window.lua')
| -rw-r--r-- | examples/core_basic_window.lua | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/examples/core_basic_window.lua b/examples/core_basic_window.lua new file mode 100644 index 00000000..4f288005 --- /dev/null +++ b/examples/core_basic_window.lua @@ -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 +------------------------------------------------------------------------------------
\ No newline at end of file |
