2 * sdl.hidd - SDL graphics/sound/keyboard for AROS hosted
3 * Copyright (c) 2007 Robert Norris. All rights reserved.
4 * Copyright (c) 2007-2009 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.
10 #include <aros/symbolsets.h>
12 #include <exec/types.h>
13 #include <proto/hostlib.h>
14 #include <proto/exec.h>
17 #include <aros/debug.h>
19 #include "sdl_intern.h"
21 #include LC_LIBDEFS_FILE
23 static int sdl_hidd_init(LIBBASETYPEPTR LIBBASE
) {
24 SDL_version cver
, *rver
;
28 D(bug("[sdl] hidd init\n"));
31 rver
= S(SDL_Linked_Version
);
33 kprintf("sdl.hidd: using SDL version %d.%d.%d\n", rver
->major
, rver
->minor
, rver
->patch
);
35 if (cver
.major
!= rver
->major
|| cver
.minor
!= rver
->minor
|| cver
.patch
!= rver
->patch
) {
36 kprintf("WARNING: sdl.hidd was compiled against SDL version %d.%d.%d\n", cver
.major
, cver
.minor
, cver
.patch
);
37 kprintf(" You may experience problems\n");
40 InitSemaphore(&LIBBASE
->lock
);
42 /* start sdl. we don't catch any signals with a debug build as it plays
43 * havoc with the debugger */
45 ret
= S(SDL_Init
, SDL_INIT_VIDEO
| SDL_INIT_NOPARACHUTE
);
47 ret
= S(SDL_Init
, SDL_INIT_VIDEO
);
51 D(bug("[sdl] couldn't initialise SDL\n"));
55 S(SDL_ShowCursor
, SDL_DISABLE
);
60 static int sdl_hidd_expunge(LIBBASETYPEPTR LIBBASE
) {
61 D(bug("[sdl] hidd expunge\n"));
63 if (LIBBASE
->sdl_handle
)
69 ADD2INITLIB(sdl_hidd_init
, 1)
70 ADD2EXPUNGELIB(sdl_hidd_expunge
, 1)