PageRenderTime 22ms CodeModel.GetById 14ms app.highlight 5ms RepoModel.GetById 2ms app.codeStats 0ms

/project/jni/sdl_gfx/include/SDL_framerate.h

https://github.com/aichunyu/FFPlayer
C Header | 79 lines | 36 code | 17 blank | 26 comment | 0 complexity | d3e7162d422b0382d794d96855a86de2 MD5 | raw file
 1
 2/*
 3
 4SDL_framerate: framerate manager
 5
 6LGPL (c) A. Schiffler
 7
 8*/
 9
10#ifndef _SDL_framerate_h
11#define _SDL_framerate_h
12
13/* Set up for C function definitions, even when using C++ */
14#ifdef __cplusplus
15extern "C" {
16#endif
17
18	/* --- */
19
20#include "SDL.h"
21
22	/* --------- Definitions */
23
24/*!
25\brief Highest possible rate supported by framerate controller in Hz (1/s).
26*/
27#define FPS_UPPER_LIMIT		200
28
29/*!
30\brief Lowest possible rate supported by framerate controller in Hz (1/s).
31*/
32#define FPS_LOWER_LIMIT		1
33
34/*!
35\brief Default rate of framerate controller in Hz (1/s).
36*/
37#define FPS_DEFAULT		30
38
39/*! 
40\brief Structure holding the state and timing information of the framerate controller. 
41*/
42	typedef struct {
43		Uint32 framecount;
44		float rateticks;
45		Uint32 lastticks;
46		Uint32 rate;
47	} FPSmanager;
48
49	/* --------- Function prototypes */
50
51#ifdef WIN32
52#  ifdef DLL_EXPORT
53#    define SDL_FRAMERATE_SCOPE __declspec(dllexport)
54#  else
55#    ifdef LIBSDL_GFX_DLL_IMPORT
56#      define SDL_FRAMERATE_SCOPE __declspec(dllimport)
57#    endif
58#  endif
59#endif
60#ifndef SDL_FRAMERATE_SCOPE
61#  define SDL_FRAMERATE_SCOPE extern
62#endif
63
64	/* Functions return 0 or value for sucess and -1 for error */
65
66	SDL_FRAMERATE_SCOPE void SDL_initFramerate(FPSmanager * manager);
67	SDL_FRAMERATE_SCOPE int SDL_setFramerate(FPSmanager * manager, int rate);
68	SDL_FRAMERATE_SCOPE int SDL_getFramerate(FPSmanager * manager);
69	SDL_FRAMERATE_SCOPE int SDL_getFramecount(FPSmanager * manager);
70	SDL_FRAMERATE_SCOPE void SDL_framerateDelay(FPSmanager * manager);
71
72	/* --- */
73
74	/* Ends C function definitions when using C++ */
75#ifdef __cplusplus
76}
77#endif
78
79#endif				/* _SDL_framerate_h */