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.

53 lines
2.1 KiB

  1. /*******************************************************************************************
  2. *
  3. * raylib [shapes] example - Draw raylib logo using basic shapes
  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) 2014 Ramon Santamaria (Ray San - raysan@raysanweb.com)
  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 [shapes] example - raylib logo using shapes");
  19. //--------------------------------------------------------------------------------------
  20. // Main game loop
  21. while (!WindowShouldClose()) // Detect window close button or ESC key
  22. {
  23. // Update
  24. //----------------------------------------------------------------------------------
  25. // TODO: Update your variables here
  26. //----------------------------------------------------------------------------------
  27. // Draw
  28. //----------------------------------------------------------------------------------
  29. BeginDrawing();
  30. ClearBackground(RAYWHITE);
  31. DrawRectangle(screenWidth/2 - 128, screenHeight/2 - 128, 256, 256, BLACK);
  32. DrawRectangle(screenWidth/2 - 112, screenHeight/2 - 112, 224, 224, RAYWHITE);
  33. DrawText("raylib", screenWidth/2 - 44, screenHeight/2 + 48, 50, BLACK);
  34. DrawText("this is NOT a texture!", 350, 370, 10, GRAY);
  35. EndDrawing();
  36. //----------------------------------------------------------------------------------
  37. }
  38. // De-Initialization
  39. //--------------------------------------------------------------------------------------
  40. CloseWindow(); // Close window and OpenGL context
  41. //--------------------------------------------------------------------------------------
  42. return 0;
  43. }