added concrete implementations of putc(), getc(), getchar() and gets()
[tangerine.git] / arch / all-sdl / hidd / sdl_init.c
blobe6af0fbef19acdaa6ad8403d833eccf268951b6a
1 /*
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.
7 */
9 #include <aros/symbolsets.h>
11 #include <exec/types.h>
12 #include <proto/hostlib.h>
13 #include <proto/exec.h>
15 #define DEBUG 0
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;
24 int i, ret;
25 char *err;
27 D(bug("[sdl] hidd init\n"));
29 SDL_VERSION(&cver);
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 */
43 #if DEBUG
44 ret = S(SDL_Init, SDL_INIT_EVERYTHING | SDL_INIT_NOPARACHUTE);
45 #else
46 ret = S(SDL_Init, SDL_INIT_EVERYTHING);
47 #endif
49 if (ret != 0) {
50 D(bug("[sdl] couldn't initialise SDL\n"));
51 return FALSE;
54 S(SDL_ShowCursor, SDL_DISABLE);
56 return TRUE;
59 static int sdl_hidd_expunge(LIBBASETYPEPTR LIBBASE) {
60 D(bug("[sdl] hidd expunge\n"));
62 SV(SDL_Quit);
64 return TRUE;
67 ADD2INITLIB(sdl_hidd_init, 1)
68 ADD2EXPUNGELIB(sdl_hidd_expunge, 1)