diff -urN SDL-1.2.13/README.Haiku SDL-1.2.13-haiku/README.Haiku --- SDL-1.2.13/README.Haiku 1970-01-01 00:00:00.000000000 +0000 +++ SDL-1.2.13-haiku/README.Haiku 2009-02-15 23:35:54.000000000 +0000 @@ -0,0 +1,13 @@ + +SDL on Haiku +============== + +You can build SDL on Haiku like any other GNU style package. +e.g. ./configure && make && make install +By default it is installed in /boot/develop/tools/gnupro/{bin,lib,etc.} + +Once you install SDL, you need to copy libSDL.so to /boot/home/config/lib, +so it can be found by the dynamic linker. + +Enjoy! + Sam Lantinga (slouken@libsdl.org) diff -urN SDL-1.2.13/configure.in SDL-1.2.13-haiku/configure.in --- SDL-1.2.13/configure.in 2009-02-15 23:41:29.000000000 +0000 +++ SDL-1.2.13-haiku/configure.in 2009-02-15 23:35:54.000000000 +0000 @@ -40,7 +40,7 @@ AC_SUBST(LT_AGE) dnl Detect the canonical build and host environments -AC_CONFIG_AUX_DIRS($srcdir/build-scripts) +AC_CONFIG_AUX_DIR([build-scripts]) AC_CANONICAL_HOST AC_C_BIGENDIAN if test x$ac_cv_c_bigendian = xyes; then @@ -2456,7 +2456,7 @@ SDL_CFLAGS="$SDL_CFLAGS -Dmain=SDL_main" SDL_LIBS="-lmingw32 -lSDLmain $SDL_LIBS -mwindows" ;; - *-*-beos*) + *-*-beos* | *-*-haiku*) ARCH=beos ac_default_prefix=/boot/develop/tools/gnupro CheckDummyVideo diff -urN SDL-1.2.13/include/SDL_platform.h SDL-1.2.13-haiku/include/SDL_platform.h --- SDL-1.2.13/include/SDL_platform.h 2009-02-15 23:41:29.000000000 +0000 +++ SDL-1.2.13-haiku/include/SDL_platform.h 2009-02-15 23:39:24.000000000 +0000 @@ -33,6 +33,10 @@ #undef __BEOS__ #define __BEOS__ 1 #endif +#if defined(__HAIKU__) +#undef __HAIKU__ +#define __HAIKU__ 1 +#endif #if defined(bsdi) || defined(__bsdi) || defined(__bsdi__) #undef __BSDI__ #define __BSDI__ 1 diff -urN SDL-1.2.13/include/begin_code.h SDL-1.2.13-haiku/include/begin_code.h --- SDL-1.2.13/include/begin_code.h 2009-02-15 23:41:28.000000000 +0000 +++ SDL-1.2.13-haiku/include/begin_code.h 2009-02-15 23:35:54.000000000 +0000 @@ -33,7 +33,7 @@ /* Some compilers use a special export keyword */ #ifndef DECLSPEC -# if defined(__BEOS__) +# if defined(__BEOS__) || defined(__HAIKU__) # if defined(__GNUC__) # define DECLSPEC __declspec(dllexport) # else diff -urN SDL-1.2.13/src/video/bwindow/SDL_sysvideo.cc SDL-1.2.13-haiku/src/video/bwindow/SDL_sysvideo.cc --- SDL-1.2.13/src/video/bwindow/SDL_sysvideo.cc 2009-02-15 23:41:31.000000000 +0000 +++ SDL-1.2.13-haiku/src/video/bwindow/SDL_sysvideo.cc 2009-02-15 23:36:16.000000000 +0000 static void BE_FreeHWSurface(_THIS, SDL_Surface *surface); static int BE_ToggleFullScreen(_THIS, int fullscreen); -static SDL_Overlay *BE_CreateYUVOverlay(_THIS, int width, int height, Uint32 format, SDL_Surface *display); +SDL_Overlay *BE_CreateYUVOverlay(_THIS, int width, int height, Uint32 format, SDL_Surface *display); /* OpenGL functions */ #if SDL_VIDEO_OPENGL @@ -637,8 +637,12 @@ int32 cookie = 0; while (get_next_image_info(0,&cookie,&info) == B_OK) { void *location = NULL; - if (get_image_symbol((image_id)cookie,"glBegin",B_SYMBOL_TYPE_ANY,&location) == B_OK) { - _this->gl_config.dll_handle = (void*)cookie; +#ifdef __HAIKU__ + if (get_image_symbol(info.id,"glBegin",B_SYMBOL_TYPE_ANY,&location) == B_OK) { // This is how it actually works in Haiku +#else + if (get_image_symbol((image_id)cookie,"glBegin",B_SYMBOL_TYPE_ANY,&location) == B_OK) { // I don't know if that *did* work in BeOS +#endif + _this->gl_config.dll_handle = (void*)info.id; _this->gl_config.driver_loaded = 1; SDL_strlcpy(_this->gl_config.driver_path, "libGL.so", SDL_arraysize(_this->gl_config.driver_path)); } diff -urN SDL-1.2.13/test/configure.in SDL-1.2.13-haiku/test/configure.in --- SDL-1.2.13/test/configure.in 2009-02-15 23:41:29.000000000 +0000 +++ SDL-1.2.13-haiku/test/configure.in 2009-02-15 23:35:54.000000000 +0000 @@ -20,7 +20,7 @@ MATHLIB="" SYS_GL_LIBS="-lopengl32" ;; - *-*-beos*) + *-*-beos* | *-*-haiku*) EXE="" MATHLIB="" SYS_GL_LIBS="-lGL" diff -urN SDL-1.2.13/test/testplatform.c SDL-1.2.13-haiku/test/testplatform.c --- SDL-1.2.13/test/testplatform.c 2009-02-15 23:41:29.000000000 +0000 +++ SDL-1.2.13-haiku/test/testplatform.c 2009-02-15 23:48:14.000000000 +0000 @@ -162,6 +162,8 @@ "Dreamcast" #elif __FREEBSD__ "FreeBSD" +#elif __HAIKU__ + "Haiku" #elif __HPUX__ "HP-UX" #elif __IRIX__ diff -rup SDL-1.2.13/src/video/bwindow/SDL_sysyuv.cc SDL-1.2.13-haiku/src/video/bwindow/SDL_sysyuv.cc --- SDL-1.2.13/src/video/bwindow/SDL_sysyuv.cc 2009-02-25 15:32:44.000000000 +0100 +++ SDL-1.2.13-haiku/src/video/bwindow/SDL_sysyuv.cc 2009-02-25 15:29:59.000000000 +0100 @@ -94,7 +94,7 @@ BBitmap * BE_GetOverlayBitmap(BRect boun // See [btw: Cb=U, Cr=V] // See also http://www.fourcc.org/indexyuv.htm -enum color_space convert_color_space(Uint32 format) { +color_space convert_color_space(Uint32 format) { switch (format) { case SDL_YV12_OVERLAY: return B_YUV9;