Agar


Note: The Agar manual pages follow certain conventions, notably concerning function return values. Please read AG_Intro(3) first.


SYNOPSIS

#include <agar/core.h>

DESCRIPTION

These functions are responsible for the initialization of Agar's internals and subsystems.

Note: This manual page is specific to the Agar-Core library. For initialization functions related to Agar-GUI, see AG_InitGraphics(3).


void AG_GetVersion (AG_AgarVersion *ver)

int AG_InitCore (const char *progname, Uint flags)

void AG_AtExitFunc (void (*fn)(void))

void AG_Quit (void)

void AG_Destroy (void)


The AG_InitCore() function initializes the internal data structures of the Agar-Core library. It must be invoked before any other AG_ function. The progname argument is an arbitrary name for the application. Available flags options include:
AG_VERBOSEAllow errors and warning output on console.
AG_CREATE_DATADIRIf it does not exist, automatically create a ~/.<progname> data directory on startup.
AG_NO_CFG_AUTOLOADSkip loading of AG_Config(3) configuration data on startup.

The AG_AtExitFunc() registers a function that will be invoked automatically by AG_Destroy().

AG_Quit() immediately terminates the application by releasing resources allocated by Agar-Core and invoking exit(2).

The AG_Destroy() function immediately frees all resources allocated by Agar.


AGAR VERSION INFORMATION


void AG_GetVersion (AG_AgarVersion *ver)

bool AG_VERSION_ATLEAST (int major, int minor, int patchlevel)


The AG_GetVersion() function fills an AG_AgarVersion structure with version information:
typedef struct ag_agar_version {
	int major;
	int minor;
	int patch;
	const char *release;
} AG_AgarVersion;

Agar does not need to have been previously initialized for AG_GetVersion() to work.

The AG_VERSION_ATLEAST() macro evaluates to true if the current Agar version is equal to, or exceeds the given version number.

SEE ALSO

AG_Intro(3), AG_InitGraphics(3)

HISTORY

The AG_InitCore() function first appeared in Agar 1.0. Agar 1.4.0 saw the introduction of AG_InitGraphics(3).