- Main Page
- Data Structures
- Files

- File List
- Globals

# SDL_framerate.h

Go to the documentation of this file.

    00001
    00002 /*
    00003
    00004 SDL_framerate: framerate manager
    00005
    00006 LGPL (c) A. Schiffler
    00007
    00008 */
    00009
    00010 #ifndef _SDL_framerate_h
    00011 #define _SDL_framerate_h
    00012
    00013 /* Set up for C function definitions, even when using C++ */
    00014 #ifdef __cplusplus
    00015 extern "C" {
    00016 #endif
    00017
    00018         /* --- */
    00019
    00020 #include "SDL.h"
    00021
    00022         /* --------- Definitions */
    00023
    00027 #define FPS_UPPER_LIMIT         200
    00028
    00032 #define FPS_LOWER_LIMIT         1
    00033
    00037 #define FPS_DEFAULT             30
    00038
    00042         typedef struct {
    00043                 Uint32 framecount;
    00044                 float rateticks;
    00045                 Uint32 lastticks;
    00046                 Uint32 rate;
    00047         } FPSmanager;
    00048
    00049         /* ---- Function Prototypes */
    00050
    00051 #if defined(WIN32) || defined(WIN64)
    00052 #  if defined(DLL_EXPORT) && !defined(LIBSDL_GFX_DLL_IMPORT)
    00053 #    define SDL_FRAMERATE_SCOPE __declspec(dllexport)
    00054 #  else
    00055 #    ifdef LIBSDL_GFX_DLL_IMPORT
    00056 #      define SDL_FRAMERATE_SCOPE __declspec(dllimport)
    00057 #    endif
    00058 #  endif
    00059 #endif
    00060 #ifndef SDL_FRAMERATE_SCOPE
    00061 #  define SDL_FRAMERATE_SCOPE extern
    00062 #endif
    00063
    00064         /* Functions return 0 or value for sucess and -1 for error */
    00065
    00066         SDL_FRAMERATE_SCOPE void SDL_initFramerate(FPSmanager * manager);
    00067         SDL_FRAMERATE_SCOPE int SDL_setFramerate(FPSmanager * manager, int rate);
    00068         SDL_FRAMERATE_SCOPE int SDL_getFramerate(FPSmanager * manager);
    00069         SDL_FRAMERATE_SCOPE int SDL_getFramecount(FPSmanager * manager);
    00070         SDL_FRAMERATE_SCOPE void SDL_framerateDelay(FPSmanager * manager);
    00071
    00072         /* --- */
    00073
    00074         /* Ends C function definitions when using C++ */
    00075 #ifdef __cplusplus
    00076 }
    00077 #endif
    00078
    00079 #endif                          /* _SDL_framerate_h */