Beginners_-_GetTime.c 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. #include "raylib.h"
  2. int main(void)
  3. {
  4. // Initialization
  5. //--------------------------------------------------------------------------------------
  6. const int screenWidth = 800;
  7. const int screenHeight = 450;
  8. InitWindow(screenWidth, screenHeight, "raylib example.");
  9. SetTargetFPS(60); // Set our game to run at 60 frames-per-second
  10. //--------------------------------------------------------------------------------------
  11. // Main game loop
  12. while (!WindowShouldClose()) // Detect window close button or ESC key
  13. {
  14. // Update
  15. //----------------------------------------------------------------------------------
  16. //----------------------------------------------------------------------------------
  17. // Draw
  18. //----------------------------------------------------------------------------------
  19. BeginDrawing();
  20. ClearBackground(RAYWHITE);
  21. // Note that time is a float = %f
  22. DrawText(FormatText("GetTime() since initlib : %f",GetTime()),100,100,20,BLACK);
  23. EndDrawing();
  24. //----------------------------------------------------------------------------------
  25. }
  26. // De-Initialization
  27. //--------------------------------------------------------------------------------------
  28. CloseWindow(); // Close window and OpenGL context
  29. //--------------------------------------------------------------------------------------
  30. return 0;
  31. }