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.

60 lines
2.5 KiB

пре 1 година
пре 2 година
пре 5 година
пре 5 година
пре 5 година
пре 11 година
пре 11 година
пре 11 година
пре 11 година
пре 11 година
пре 11 година
пре 11 година
пре 11 година
пре 11 година
  1. /*******************************************************************************************
  2. *
  3. * raylib [shapes] example - Draw raylib logo using basic shapes
  4. *
  5. * Example originally created with raylib 1.0, last time updated with raylib 1.0
  6. *
  7. * Example licensed under an unmodified zlib/libpng license, which is an OSI-certified,
  8. * BSD-like license that allows static linking with closed source software
  9. *
  10. * Copyright (c) 2014-2024 Ramon Santamaria (@raysan5)
  11. *
  12. ********************************************************************************************/
  13. #include "raylib.h"
  14. //------------------------------------------------------------------------------------
  15. // Program main entry point
  16. //------------------------------------------------------------------------------------
  17. int main(void)
  18. {
  19. // Initialization
  20. //--------------------------------------------------------------------------------------
  21. const int screenWidth = 800;
  22. const int screenHeight = 450;
  23. InitWindow(screenWidth, screenHeight, "raylib [shapes] example - raylib logo using shapes");
  24. SetTargetFPS(60); // Set our game to run at 60 frames-per-second
  25. //--------------------------------------------------------------------------------------
  26. // Main game loop
  27. while (!WindowShouldClose()) // Detect window close button or ESC key
  28. {
  29. // Update
  30. //----------------------------------------------------------------------------------
  31. // TODO: Update your variables here
  32. //----------------------------------------------------------------------------------
  33. // Draw
  34. //----------------------------------------------------------------------------------
  35. BeginDrawing();
  36. ClearBackground(RAYWHITE);
  37. DrawRectangle(screenWidth/2 - 128, screenHeight/2 - 128, 256, 256, BLACK);
  38. DrawRectangle(screenWidth/2 - 112, screenHeight/2 - 112, 224, 224, RAYWHITE);
  39. DrawText("raylib", screenWidth/2 - 44, screenHeight/2 + 48, 50, BLACK);
  40. DrawText("this is NOT a texture!", 350, 370, 10, GRAY);
  41. EndDrawing();
  42. //----------------------------------------------------------------------------------
  43. }
  44. // De-Initialization
  45. //--------------------------------------------------------------------------------------
  46. CloseWindow(); // Close window and OpenGL context
  47. //--------------------------------------------------------------------------------------
  48. return 0;
  49. }