1get_desktop_resolution(3)       Allegro manual       get_desktop_resolution(3)
2
3
4

NAME

6       get_desktop_resolution - Finds out the desktop resolution. Allegro game
7       programming library.
8

SYNOPSIS

10       #include <allegro.h>
11
12
13       int get_desktop_resolution(int *width, int *height);
14

DESCRIPTION

16       Finds out the currently selected desktop resolution. You can  use  this
17       information  to  avoid creating windows bigger than the current resolu‐
18       tion.  This is especially important for some windowed drivers which are
19       unable  to  create windows bigger than the desktop. Each parameter is a
20       pointer to an integer where one dimension of the screen will be stored.
21
22       Under some OSes, switching to a full screen graphics mode may automati‐
23       cally  change the desktop resolution. You have, therefore, to call this
24       function before setting any graphics mode in order to retrieve the real
25       desktop resolution. Example:
26
27          int width, height;
28
29          allegro_init();
30          ...
31          if (get_desktop_resolution(&width, &height) == 0) {
32             /* Got the resolution correctly */
33          }
34

RETURN VALUE

36       Returns  zero  on  success, or a negative number if this information is
37       not available or does not apply, in which case the values stored in the
38       variables you provided for `width' and `height' are undefined.
39
40

SEE ALSO

42       desktop_color_depth(3), set_gfx_mode(3)
43
44
45
46Allegro                          version 4.4.3       get_desktop_resolution(3)
Impressum