Bläddra i källkod

sokol_app.h, sokol_time.h: update header documentation

Andre Weissflog 3 år sedan
förälder
incheckning
9b1b387c02
2 ändrade filer med 6 tillägg och 0 borttagningar
  1. 4 0
      sokol_app.h
  2. 2 0
      sokol_time.h

+ 4 - 0
sokol_app.h

@@ -244,6 +244,10 @@
             the default framebuffer size as float values instead of integer. This
             the default framebuffer size as float values instead of integer. This
             may help to prevent casting back and forth between int and float
             may help to prevent casting back and forth between int and float
             in more strongly typed languages than C and C++.
             in more strongly typed languages than C and C++.
+            
+        double sapp_frame_duration(void)
+            Returns the frame duration in seconds averaged over a number of
+            frames to smooth out any jittering spikes.
 
 
         int sapp_color_format(void)
         int sapp_color_format(void)
         int sapp_depth_format(void)
         int sapp_depth_format(void)

+ 2 - 0
sokol_time.h

@@ -61,6 +61,8 @@
         The main purpose of this function is to remove jitter/inaccuracies from
         The main purpose of this function is to remove jitter/inaccuracies from
         measured frame times, and instead use the display refresh rate as
         measured frame times, and instead use the display refresh rate as
         frame duration.
         frame duration.
+        NOTE: for more robust frame timing, consider using the
+        sokol_app.h function sapp_frame_duration()
 
 
     Use the following functions to convert a duration in ticks into
     Use the following functions to convert a duration in ticks into
     useful time units:
     useful time units: