5 Module GAME_ENV
gullradriel edited this page 2026-10-09 00:55:18 +02:00

GAME APPS: game environment management utilities

Structures

Name
struct GAME_ENV
Game Environment structure.

Functions

Name
GAME_ENV * load_game_config(char * config_name)
load a game config from file
int init_game_env(GAME_ENV ** game)
initialize a new game environment
void destroy_game_env(GAME_ENV ** game)
destroy a game environment

Defines

Name
GFX_WINDOWED
display mode: windowed
GFX_FULLSCREEN_WINDOW
display mode: fullscreen windowed
GFX_FULLSCREEN
display mode: fullscreen
CPU_USE_NICE
let the other process have some times
CPU_USE_LESS
wait more
CPU_USE_FULL
full use of CPU

Functions Documentation

function load_game_config

GAME_ENV * load_game_config(
    char * config_name
)

load a game config from file

Parameters:

  • config_name path to the game configuration file

Return: allocated GAME_ENV with loaded settings, or NULL on error

function init_game_env

int init_game_env(
    GAME_ENV ** game
)

initialize a new game environment

Parameters:

  • game a pointer to a game structure to allocate

Return: TRUE or FALSE

function destroy_game_env

void destroy_game_env(
    GAME_ENV ** game
)

destroy a game environment

Parameters:

  • game a pointer to a game structure to destroy

Macros Documentation

define GFX_WINDOWED

#define GFX_WINDOWED 0

display mode: windowed

define GFX_FULLSCREEN_WINDOW

#define GFX_FULLSCREEN_WINDOW 2

display mode: fullscreen windowed

define GFX_FULLSCREEN

#define GFX_FULLSCREEN 1

display mode: fullscreen

define CPU_USE_NICE

#define CPU_USE_NICE 0

let the other process have some times

define CPU_USE_LESS

#define CPU_USE_LESS 10

wait more

define CPU_USE_FULL

#define CPU_USE_FULL -1

full use of CPU