2 * sdl.hidd - SDL graphics/sound/keyboard for AROS hosted
3 * Copyright (c) 2007 Robert Norris. All rights reserved.
5 * This program is free software; you can redistribute it and/or modify it
6 * under the same terms as AROS itself.
9 #include <aros/symbolsets.h>
11 #include <exec/types.h>
12 #include <proto/hostlib.h>
13 #include <proto/exec.h>
16 #include <aros/debug.h>
18 #include "sdl_intern.h"
20 #include LC_LIBDEFS_FILE
22 static int sdl_hidd_init(LIBBASETYPEPTR LIBBASE
) {
23 SDL_version cver
, *rver
;
27 D(bug("[sdl] hidd init\n"));
30 rver
= S(SDL_Linked_Version
);
32 kprintf("sdl.hidd: using SDL version %d.%d.%d\n", rver
->major
, rver
->minor
, rver
->patch
);
34 if (cver
.major
!= rver
->major
|| cver
.minor
!= rver
->minor
|| cver
.patch
!= rver
->patch
) {
35 kprintf("WARNING: sdl.hidd was compiled against SDL version %d.%d.%d\n", cver
.major
, cver
.minor
, cver
.patch
);
36 kprintf(" You may experience problems\n");
39 InitSemaphore(&LIBBASE
->lock
);
41 /* start sdl. we don't catch any signals with a debug build as it plays
42 * havoc with the debugger */
44 ret
= S(SDL_Init
, SDL_INIT_EVERYTHING
| SDL_INIT_NOPARACHUTE
);
46 ret
= S(SDL_Init
, SDL_INIT_EVERYTHING
);
50 D(bug("[sdl] couldn't initialise SDL\n"));
54 S(SDL_ShowCursor
, SDL_DISABLE
);
59 static int sdl_hidd_expunge(LIBBASETYPEPTR LIBBASE
) {
60 D(bug("[sdl] hidd expunge\n"));
67 ADD2INITLIB(sdl_hidd_init
, 1)
68 ADD2EXPUNGELIB(sdl_hidd_expunge
, 1)