summaryrefslogtreecommitdiffstats
path: root/doc/manual/example5/function.c
blob: 457b4a424052cfcbd5256c24b3267b1c1fd64e84 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
static ScreenInfo default;
static int initialized = 0;

ScreenInfo* default_screen_depth() {
  if (!initialized) {
    default.redBits = 8;
    default.greenBits = 8;
    default.blueBits = 8;
    initialized = 1;
  }
  return &default;
}

void set_screen_depth(ScreenInfo* info) {
  /* Do something ... */
}