2016-08-06 12:32:35 +03:00
|
|
|
-------------------------------------------------------------------------------------------
|
|
|
|
--
|
|
|
|
-- raylib [core] example - Basic window
|
|
|
|
--
|
|
|
|
-- This example has been created using raylib 1.6 (www.raylib.com)
|
|
|
|
-- raylib is licensed under an unmodified zlib/libpng license (View raylib.h for details)
|
|
|
|
--
|
|
|
|
-- Copyright (c) 2014-2016 Ramon Santamaria (@raysan5)
|
|
|
|
--
|
|
|
|
-------------------------------------------------------------------------------------------
|
|
|
|
|
2016-08-03 22:38:21 +03:00
|
|
|
-- Initialization
|
2016-08-06 12:32:35 +03:00
|
|
|
-------------------------------------------------------------------------------------------
|
2016-08-03 22:38:21 +03:00
|
|
|
local screenWidth = 800
|
|
|
|
local screenHeight = 450
|
|
|
|
|
2016-08-06 12:32:35 +03:00
|
|
|
InitWindow(screenWidth, screenHeight, "raylib [core] example - basic window")
|
2016-08-03 22:38:21 +03:00
|
|
|
|
|
|
|
SetTargetFPS(60) -- Set target frames-per-second
|
2016-08-06 12:32:35 +03:00
|
|
|
-------------------------------------------------------------------------------------------
|
2016-08-03 22:38:21 +03:00
|
|
|
|
2016-08-06 12:32:35 +03:00
|
|
|
-- Main game loop
|
|
|
|
while not WindowShouldClose() do -- Detect window close button or ESC key
|
2016-08-03 22:38:21 +03:00
|
|
|
-- Update
|
2016-08-06 12:32:35 +03:00
|
|
|
---------------------------------------------------------------------------------------
|
|
|
|
-- TODO: Update your variables here
|
|
|
|
---------------------------------------------------------------------------------------
|
2016-08-03 22:38:21 +03:00
|
|
|
|
|
|
|
-- Draw
|
2016-08-06 12:32:35 +03:00
|
|
|
---------------------------------------------------------------------------------------
|
2016-08-03 22:38:21 +03:00
|
|
|
BeginDrawing()
|
|
|
|
|
|
|
|
ClearBackground(RAYWHITE)
|
|
|
|
|
|
|
|
DrawText("Congrats! You created your first window!", 190, 200, 20, LIGHTGRAY)
|
|
|
|
|
|
|
|
EndDrawing()
|
2016-08-06 12:32:35 +03:00
|
|
|
---------------------------------------------------------------------------------------
|
2016-08-03 22:38:21 +03:00
|
|
|
end
|
|
|
|
|
|
|
|
-- De-Initialization
|
2016-08-06 12:32:35 +03:00
|
|
|
-------------------------------------------------------------------------------------------
|
2016-08-03 22:38:21 +03:00
|
|
|
CloseWindow() -- Close window and OpenGL context
|
2016-08-06 12:32:35 +03:00
|
|
|
-------------------------------------------------------------------------------------------
|