]> icculus.org git repositories - btb/d2x.git/blob - arch/sdl/init.c
fix compiler warning
[btb/d2x.git] / arch / sdl / init.c
1 /* $ Id: $ */
2 /*
3  *
4  * SDL architecture support
5  *
6  *
7  */
8
9 #ifdef HAVE_CONFIG_H
10 #include <conf.h>
11 #endif
12
13 #include <stdlib.h>
14 #include <stdio.h>
15 #include <SDL/SDL.h>
16 #include "text.h"
17 #include "event.h"
18 #include "error.h"
19 #include "args.h"
20 #include "digi.h"
21
22 extern void d_mouse_init();
23
24 void sdl_close()
25 {
26         SDL_Quit();
27 }
28
29 void arch_sdl_init()
30 {
31 #if defined(SDL_VIDEO) || defined(SDL_GL_VIDEO)
32         if (SDL_Init(SDL_INIT_VIDEO) < 0)
33         {
34                 Error("SDL library video initialisation failed: %s.",SDL_GetError());
35         }
36 #endif
37 #ifdef SDL_INPUT
38         if (!FindArg("-nomouse"))
39                 d_mouse_init();
40 #endif
41         if (!FindArg("-nosound"))
42                 digi_init();
43         atexit(sdl_close);
44 }