app.d 462 B

1234567891011121314151617181920212223
  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) CloseWindow(); // see https://dlang.org/spec/statement.html#scope-guard-statement
  9. while (!WindowShouldClose())
  10. {
  11. BeginDrawing();
  12. scope(exit) EndDrawing();
  13. ClearBackground(RAYWHITE);
  14. DrawText("Hello, World!", 330, 300, 28, BLACK);
  15. }
  16. writeln("Ending a raylib example.");
  17. }