
#ifdef __cplusplus
extern "C" {
#endif

#include "allegro.h"
#include <SDL.h>

// typedef SDL_Color* PALETTE;
// typedef long fixed; // What an idea !
// #define RGB SDL_Color

extern SDL_Surface *sdl_screen;
extern SDL_PixelFormat *color_format;
extern SDL_Overlay *sdl_overlay;

void sdl_init();
void sdl_done();

void setup_gfx_modes();

// Bitmap functions
BITMAP *sdl_create_bitmap_ex(int bpp, int w, int h);
void sdl_destroy_bitmap(BITMAP *bmp);
#define sdl_create_bitmap(w, h) sdl_create_bitmap_ex(display_cfg.bpp,w,h)
struct BITMAP *surface_to_bmp(SDL_Surface *s);

void destroy_bitmap(struct BITMAP *bmp);

// Mouse... Very different now... Just declare the vars, and see later...
void set_mouse_range(int x1, int y1, int x2, int y2); // does nothing !

// Strings
#ifndef strlwr
#define strlwr(s) while(s) if (*s>='A' && *s<='Z') *s+=32;
#endif
void put_backslash(char *s);

// Joystick
void init_joys(); // Does nothing for now

struct BITMAP *sdl_create_sub_bitmap(struct BITMAP *src, int x, int y, int w, int h);
UINT16 bytes_per_pixel(BITMAP *screen);

SDL_Surface *get_sdl_surface(BITMAP *b);

#ifdef __cplusplus
}
#endif
