View lcov test coverage results on http://www.gnu.org/software/liquidwar6/coverage/src/lib/gfx/index.html.
backend: the graphical backend to use
video_mode: the video mode to use at start up
resize_callback: a callback function which will be called at each resize event
Sets up the graphical backend for good, initializing a video mode and allocating ressources. This call can typically fail if there's no device available, if the user doesn't have enough rights to access the hardware, and so on.
Return value: 1 on success, 0 if not
backend: the backend to quit
Uninitializes the backend, that is, exits the graphical mode. All threads that use graphics must be closed when this is called.
Return value: none.
backend: the backend to represent
Returns a readable version of the backend object.
Return value: a newly allocated pointer.
backend: the backend to use
video_mode: the new video mode
This function changes the video mode. Note that the first time you set up the graphical environment you must call
lw6gfx_init
but to change the current mode, use this function. It should reload backend data automatically if needed (textures for instance). Note that before giving up and failing this function will try alternate video modes, and you're not garanteed to have the right mode after the call, even if it returns true. To check this, uselw6gfx_get_video_mode
.Return value: 1 on success, 0 on failure;
backend: the backend to use
video_mode: the current video mode (will be overwritten, out parameter)
This function returns the current video mode.
Return value: 1 on success, 0 on failure;
backend: the backend to use
fullscreen_modes: the available fullscreen modes (will be overwritten, out parameter)
This function returns the current video mode.
Return value: 1 on success, 0 on failure;
backend: the backend to use
This function "pumps" events, that is gets pending events, puts them in queues, maintains internal states up to date. You really must call this very often or no input will be processed at all.
Return value: a pointer on the internal input state, musn't be freed.
backend: the graphical backend to use
mask: display flag, tells what to display
look: the look, the skin, contains display options
level: the level to display
game_struct: the game_struct associated with the level
game_state: the game_state associated with the level
local_cursors: the cursor to center the focus on
menu: the menu to display
progress: the value of the progress indicator
fps: the number of frames per second to display
mps: the number of moves per second to display
log_list: log messages to display
capture: wether to enable capture mode or not
gfx_debug: wether to enable gfx debugging tools
debug_team_id: for debug display, team to display informations about
debug_layer_id: for debug display, layer to display
This is the major drawing function, the one that encapsulates all others. As the program uses a separate thread to display things, we just pass this function many parameters, and let it do its job alone. So many parameters might sometimes be useless. It also allows the graphics backend decide wether menus and hud and background should interact. Or not.
Return value: 1 on success, 0 on failure.
argc: argc, as passed to
main
argv: argv, as passed to
main
List available gfx backends. The hash contains pairs with id and name for each backend. The id is the technical key you can use to load the backend, the name is something more readable you can display in an interface. The backend objects themselves are not instanciated by this (in fact, they are, but released on the fly) you need to load and initialize them afterwards.
Return value: hash containing id/name pairs.
argc: argc, as passed to
main
argv: argv, as passed to
main
name: string containing gfx key, typically got from
lw6gfx_get_backends
Creates a gfx backend, this is just about loading the dynamic library if needed, and/or check gfx engine is available, and connect to it. It does not perform initialization.
Return value: gfx backend.