Просмотр исходного кода

make GetTime available to user of library

user 7 лет назад
Родитель
Сommit
48d0c93ace
2 измененных файлов с 5 добавлено и 2 удалено
  1. 2 2
      src/core.c
  2. 3 0
      src/raylib.h

+ 2 - 2
src/core.c

@@ -352,7 +352,7 @@ extern void UnloadDefaultFont(void);        // [Module: text] Unloads default fo
 static void InitGraphicsDevice(int width, int height);  // Initialize graphics device
 static void SetupFramebufferSize(int displayWidth, int displayHeight);
 static void InitTimer(void);                            // Initialize timer
-static double GetTime(void);                            // Returns time since InitTimer() was run
+       double GetTime(void);                            // Returns time since InitTimer() was run
 static void Wait(float ms);                             // Wait for some milliseconds (stop program execution)
 static bool GetKeyStatus(int key);                      // Returns if a key has been pressed
 static bool GetMouseButtonStatus(int button);           // Returns if a mouse button has been pressed
@@ -2120,7 +2120,7 @@ static void InitTimer(void)
 }
 
 // Get current time measure (in seconds) since InitTimer()
-static double GetTime(void)
+double GetTime(void)
 {
 #if defined(PLATFORM_DESKTOP) || defined(PLATFORM_WEB)
     return glfwGetTime();

+ 3 - 0
src/raylib.h

@@ -723,6 +723,9 @@ RLAPI void SetTargetFPS(int fps);                                 // Set target
 RLAPI int GetFPS(void);                                           // Returns current FPS
 RLAPI float GetFrameTime(void);                                   // Returns time in seconds for last frame drawn
 
+RLAPI double GetTime(void);                                       // Return time in seconds
+
+
 // Color-related functions
 RLAPI int GetHexValue(Color color);                               // Returns hexadecimal value for a Color
 RLAPI Color GetColor(int hexValue);                               // Returns a Color struct from hexadecimal value