project_files/frontlib/frontlib.h
changeset 7160 c42949cfdd92
parent 7158 a0573014ff4f
child 7314 6171f0bad318
equal deleted inserted replaced
7158:a0573014ff4f 7160:c42949cfdd92
       
     1 /*
       
     2  * Public header file for the hedgewars frontent networking library.
       
     3  *
       
     4  * This is the only header you should need to include from frontend code.
       
     5  */
       
     6 
       
     7 #ifndef FRONTLIB_H_
       
     8 #define FRONTLIB_H_
       
     9 
       
    10 #define FRONTLIB_SDL_ALREADY_INITIALIZED 1
       
    11 
       
    12 /**
       
    13  * Call this function before anything else in this library.
       
    14  *
       
    15  * If the calling program uses SDL, it needs to call SDL_Init before initializing
       
    16  * this library and then pass FRONTLIB_SDL_ALREADY_INITIALIZED as flag to this function.
       
    17  *
       
    18  * Otherwise, pass 0 to let this library handle SDL_Init an SDL_Quit itself.
       
    19  *
       
    20  * Returns 0 on success, -1 on error.
       
    21  */
       
    22 int flib_init(int flags);
       
    23 
       
    24 /**
       
    25  * Free resources associated with the library. Call this function once
       
    26  * the library is no longer needed. You can re-initialize the library by calling
       
    27  * flib_init again.
       
    28  */
       
    29 void flib_quit();
       
    30 
       
    31 #endif /* FRONTLIB_H_ */