core_basic_window.lua 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. -------------------------------------------------------------------------------------------
  2. --
  3. -- raylib [core] example - Basic window
  4. --
  5. -- This example has been created using raylib 1.6 (www.raylib.com)
  6. -- raylib is licensed under an unmodified zlib/libpng license (View raylib.h for details)
  7. --
  8. -- Copyright (c) 2014-2016 Ramon Santamaria (@raysan5)
  9. --
  10. -------------------------------------------------------------------------------------------
  11. -- Initialization
  12. -------------------------------------------------------------------------------------------
  13. local screenWidth = 800
  14. local screenHeight = 450
  15. InitWindow(screenWidth, screenHeight, "raylib [core] example - basic window")
  16. SetTargetFPS(60) -- Set target frames-per-second
  17. -------------------------------------------------------------------------------------------
  18. -- Main game loop
  19. while not WindowShouldClose() do -- Detect window close button or ESC key
  20. -- Update
  21. ---------------------------------------------------------------------------------------
  22. -- TODO: Update your variables here
  23. ---------------------------------------------------------------------------------------
  24. -- Draw
  25. ---------------------------------------------------------------------------------------
  26. BeginDrawing()
  27. ClearBackground(RAYWHITE)
  28. DrawText("Congrats! You created your first window!", 190, 200, 20, LIGHTGRAY)
  29. EndDrawing()
  30. ---------------------------------------------------------------------------------------
  31. end
  32. -- De-Initialization
  33. -------------------------------------------------------------------------------------------
  34. CloseWindow() -- Close window and OpenGL context
  35. -------------------------------------------------------------------------------------------