]> icculus.org git repositories - btb/d2x.git/blob - arch/sdl/init.c
get rid of compiler warnings
[btb/d2x.git] / arch / sdl / init.c
1 /* $Id: init.c,v 1.11 2003-01-15 02:42:41 btb Exp $ */
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
16 #include <SDL.h>
17
18 #include "text.h"
19 #include "event.h"
20 #include "error.h"
21 #include "args.h"
22 #include "digi.h"
23
24 extern void d_mouse_init();
25
26 void sdl_close()
27 {
28         SDL_Quit();
29 }
30
31 void arch_sdl_init()
32 {
33 #if defined(SDL_VIDEO) || defined(SDL_GL_VIDEO)
34         if (SDL_Init(SDL_INIT_VIDEO) < 0)
35         {
36                 Error("SDL library video initialisation failed: %s.",SDL_GetError());
37         }
38 #endif
39 #ifdef SDL_INPUT
40         if (!FindArg("-nomouse"))
41                 d_mouse_init();
42 #endif
43         if (!FindArg("-nosound"))
44                 digi_init();
45         atexit(sdl_close);
46 }