revert between 56095 -> 55830 in arch
[AROS.git] / arch / all-hosted / hidd / sdl / sdl_init.c
blob707b6423fc5da4592c2fd283e1a979e3cef94ffa
1 /*
2 * sdl.hidd - SDL graphics/sound/keyboard for AROS hosted
3 * Copyright (c) 2007 Robert Norris. All rights reserved.
4 * Copyright (c) 2007-2010 The AROS Development Team
6 * This program is free software; you can redistribute it and/or modify it
7 * under the same terms as AROS itself.
8 */
10 #include <exec/types.h>
11 #include <proto/hostlib.h>
12 #include <proto/exec.h>
14 #define DEBUG 0
15 #include <aros/debug.h>
17 #include "sdl_intern.h"
19 int sdl_hidd_init(LIBBASETYPEPTR LIBBASE) {
20 SDL_version cver, *rver;
21 int ret;
23 D(bug("[sdl] hidd init\n"));
25 SDL_VERSION(&cver);
26 rver = SP(SDL_Linked_Version);
28 kprintf("sdl.hidd: using SDL version %d.%d.%d\n", rver->major, rver->minor, rver->patch);
30 if (cver.major != rver->major || cver.minor != rver->minor || cver.patch != rver->patch) {
31 kprintf("WARNING: sdl.hidd was compiled against SDL version %d.%d.%d\n", cver.major, cver.minor, cver.patch);
32 kprintf(" You may experience problems\n");
35 /* start sdl. we don't catch any signals with a debug build as it plays
36 * havoc with the debugger */
37 #if DEBUG
38 ret = S(SDL_Init, SDL_INIT_VIDEO | SDL_INIT_NOPARACHUTE);
39 #else
40 ret = S(SDL_Init, SDL_INIT_VIDEO);
41 #endif
43 if (ret != 0) {
44 D(bug("[sdl] couldn't initialise SDL\n"));
45 return FALSE;
48 S(SDL_ShowCursor, SDL_DISABLE);
50 return TRUE;