app.d 476 B

12345678910111213141516171819202122232425
  1. import std.stdio;
  2. import raylib;
  3. void main()
  4. {
  5. writeln("Starting a raylib example.");
  6. SetTargetFPS(60);
  7. InitWindow(800, 640, "Hello, World!");
  8. scope (exit)
  9. CloseWindow(); // see https://dlang.org/spec/statement.html#scope-guard-statement
  10. while (!WindowShouldClose())
  11. {
  12. BeginDrawing();
  13. scope (exit)
  14. EndDrawing();
  15. ClearBackground(RAYWHITE);
  16. DrawText("Hello, World!", 330, 300, 28, BLACK);
  17. }
  18. writeln("Ending a raylib example.");
  19. }