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.

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