1install_allegro(3) Allegro manual install_allegro(3)
2
3
4
6 install_allegro - Initialise the Allegro library.
7
9 #include <allegro.h>
10
11
12 int install_allegro(int system_id, int *errno_ptr, int
13 (*atexit_ptr)());
14
16 Initialises the Allegro library. You must call either this or alle‐
17 gro_init() before doing anything other than using the Unicode routines.
18 If you want to use a text mode other than UTF-8, you can set it with
19 set_uformat() before you call this. The other functions that can be
20 called before this one will be marked explicitly in the documentation,
21 like set_config_file().
22
23 The available system ID codes will vary from one platform to another,
24 but you will almost always want to pass SYSTEM_AUTODETECT. Alterna‐
25 tively, SYSTEM_NONE installs a stripped down version of Allegro that
26 won't even try to touch your hardware or do anything platform specific:
27 this can be useful for situations where you only want to manipulate
28 memory bitmaps, such as the text mode datafile tools or the Windows GDI
29 interfacing functions.
30
31 The `errno_ptr' and `atexit_ptr' parameters should point to the errno
32 variable and atexit function from your libc: these are required because
33 when Allegro is linked as a DLL, it doesn't have direct access to your
34 local libc data. `atexit_ptr' may be NULL, in which case it is your
35 responsibility to call allegro_exit() manually. Example:
36
37 install_allegro(SYSTEM_AUTODETECT, &errno, atexit);
38
40 This function returns zero on success and non-zero on failure (e.g. no
41 system driver could be used). Note: in previous versions of Allegro
42 this function would abort on error.
43
44
46 allegro_init(3), allegro_exit(3), set_uformat(3), set_config_file(3)
47
48
49
50Allegro version 4.4.2 install_allegro(3)