Nelze vybrat více než 25 témat Téma musí začínat písmenem nebo číslem, může obsahovat pomlčky („-“) a může být dlouhé až 35 znaků.

62 řádky
2.3 KiB

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