Voxvision  1
Creating and manipulating voxel octrees
fps-control.h
Go to the documentation of this file.
1 
5 #ifndef FRAME_COUNTER_H
6 #define FRAME_COUNTER_H
7 #include <SDL2/SDL.h>
8 #include "../voxvision.h"
9 
13 #define vox_fpsstatus_updated(status) (status)&1
14 
18 #define vox_fpsstatus_fps(status) (status)>>1
19 
23 #define vox_fpsstatus(fps, updated) ((fps)<<1 | ((updated) ? 1: 0))
24 
31 {
32  unsigned int status;
38  Uint32 frame_time;
44 };
45 
49 typedef struct vox_fps_info (^vox_fps_controller_t)(void);
50 
62 VOX_EXPORT vox_fps_controller_t vox_make_fps_controller (unsigned int fps);
63 
67 VOX_EXPORT void vox_destroy_fps_controller (vox_fps_controller_t controller);
68 
69 #endif
VOX_EXPORT void vox_destroy_fps_controller(vox_fps_controller_t controller)
Destroy FPS controller created earlier.
VOX_EXPORT vox_fps_controller_t vox_make_fps_controller(unsigned int fps)
Make FPS controller.
struct vox_fps_info(^ vox_fps_controller_t)(void)
FPS controller type.
Frame counter info.
Definition: fps-control.h:31
unsigned int status
FPS controller status.
Definition: fps-control.h:32
Uint32 frame_time
Time taken to render the previous frame.
Definition: fps-control.h:38