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.

66 lines
2.5 KiB

  1. /*******************************************************************************************
  2. *
  3. * raylib [core] example - Basic window
  4. *
  5. * Welcome to raylib!
  6. *
  7. * To test examples, just press F6 and execute raylib_compile_execute script
  8. * Note that compiled executable is placed in the same folder as .c file
  9. *
  10. * You can find all basic examples on C:\raylib\raylib\examples folder or
  11. * raylib official webpage: www.raylib.com
  12. *
  13. * Enjoy using raylib. :)
  14. *
  15. * Example originally created with raylib 1.0, last time updated with raylib 1.0
  16. *
  17. * Example licensed under an unmodified zlib/libpng license, which is an OSI-certified,
  18. * BSD-like license that allows static linking with closed source software
  19. *
  20. * Copyright (c) 2013-2023 Ramon Santamaria (@raysan5)
  21. *
  22. ********************************************************************************************/
  23. #include "raylib.h"
  24. //------------------------------------------------------------------------------------
  25. // Program main entry point
  26. //------------------------------------------------------------------------------------
  27. int main(void)
  28. {
  29. // Initialization
  30. //--------------------------------------------------------------------------------------
  31. const int screenWidth = 800;
  32. const int screenHeight = 450;
  33. InitWindow(screenWidth, screenHeight, "raylib [core] example - basic window");
  34. SetTargetFPS(60); // Set our game to run at 60 frames-per-second
  35. //--------------------------------------------------------------------------------------
  36. // Main game loop
  37. while (!WindowShouldClose()) // Detect window close button or ESC key
  38. {
  39. // Update
  40. //----------------------------------------------------------------------------------
  41. // TODO: Update your variables here
  42. //----------------------------------------------------------------------------------
  43. // Draw
  44. //----------------------------------------------------------------------------------
  45. BeginDrawing();
  46. ClearBackground(RAYWHITE);
  47. DrawText("Congrats! You created your first window!", 190, 200, 20, LIGHTGRAY);
  48. EndDrawing();
  49. //----------------------------------------------------------------------------------
  50. }
  51. // De-Initialization
  52. //--------------------------------------------------------------------------------------
  53. CloseWindow(); // Close window and OpenGL context
  54. //--------------------------------------------------------------------------------------
  55. return 0;
  56. }