You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

52 lines
1.9 KiB

  1. /*******************************************************************************************
  2. *
  3. * raylib [core] example - Basic window
  4. *
  5. * This example has been created using raylib 1.0 (www.raylib.com)
  6. * raylib is licensed under an unmodified zlib/libpng license (View raylib.h for details)
  7. *
  8. * Copyright (c) 2013-2024 Ramon Santamaria (@raysan5)
  9. *
  10. ********************************************************************************************/
  11. #include "raylib.h"
  12. int main()
  13. {
  14. // Initialization
  15. //--------------------------------------------------------------------------------------
  16. int screenWidth = 800;
  17. int screenHeight = 450;
  18. InitWindow(screenWidth, screenHeight, "raylib [core] example - basic window");
  19. SetTargetFPS(60);
  20. //--------------------------------------------------------------------------------------
  21. // Main game loop
  22. while (!WindowShouldClose()) // Detect window close button or ESC key
  23. {
  24. // Update
  25. //----------------------------------------------------------------------------------
  26. // TODO: Update your variables here
  27. //----------------------------------------------------------------------------------
  28. // Draw
  29. //----------------------------------------------------------------------------------
  30. BeginDrawing();
  31. ClearBackground(RAYWHITE);
  32. DrawText("Congrats! You created your first window!", 190, 200, 20, LIGHTGRAY);
  33. EndDrawing();
  34. //----------------------------------------------------------------------------------
  35. }
  36. // De-Initialization
  37. //--------------------------------------------------------------------------------------
  38. CloseWindow(); // Close window and OpenGL context
  39. //--------------------------------------------------------------------------------------
  40. return 0;
  41. }