forked from coolsee/OpenMugen
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathSDL_framerate.h
50 lines (27 loc) · 798 Bytes
/
SDL_framerate.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
/*
SDL_framerate: framerate manager
LGPL (c) A. Schiffler
*/
#ifndef _SDL_framerate_h
#define _SDL_framerate_h
#include <SDL.h>
/* --------- Definitions */
/* Some rates in Hz */
#define FPS_UPPER_LIMIT 200
#define FPS_LOWER_LIMIT 1
#define FPS_DEFAULT 30
/* --------- Structure variables */
typedef struct {
Uint32 framecount;
float rateticks;
Uint32 lastticks;
Uint32 rate;
} FPSmanager;
/* Functions return 0 or value for sucess and -1 for error */
void SDL_initFramerate(FPSmanager * manager);
int SDL_setFramerate(FPSmanager * manager, int rate);
int SDL_getFramerate(FPSmanager * manager);
void SDL_framerateDelay(FPSmanager * manager);
/* --- */
/* Ends C function definitions when using C++ */
#endif /* _SDL_framerate_h */