project_files/frontlib/frontlib.h
author Medo <smaxein@googlemail.com>
Sat, 09 Jun 2012 03:28:38 +0200
changeset 7179 f84805e6df03
parent 7160 c42949cfdd92
child 7314 6171f0bad318
permissions -rw-r--r--
Implemented game launching API for the frontlib. It is still buggy though, and not all game settings can be conveniently created/modified yet.

/*
 * Public header file for the hedgewars frontent networking library.
 *
 * This is the only header you should need to include from frontend code.
 */

#ifndef FRONTLIB_H_
#define FRONTLIB_H_

#define FRONTLIB_SDL_ALREADY_INITIALIZED 1

/**
 * Call this function before anything else in this library.
 *
 * If the calling program uses SDL, it needs to call SDL_Init before initializing
 * this library and then pass FRONTLIB_SDL_ALREADY_INITIALIZED as flag to this function.
 *
 * Otherwise, pass 0 to let this library handle SDL_Init an SDL_Quit itself.
 *
 * Returns 0 on success, -1 on error.
 */
int flib_init(int flags);

/**
 * Free resources associated with the library. Call this function once
 * the library is no longer needed. You can re-initialize the library by calling
 * flib_init again.
 */
void flib_quit();

#endif /* FRONTLIB_H_ */