/*
 * zazsdl12.h: the part of the SDL 1.2 API that Zaz uses, on top of SDL2, for the fredygames.com browser
 * build (Emscripten). Implemented in zazsdl12.c. The game includes "SDL/SDL.h"; the build puts this
 * directory first in the include path.
 *
 * Copyright (C) 2026 FredyGames. GNU GPL version 3 or later, like Zaz.
 */
#ifndef ZAZ_SDL12_H
#define ZAZ_SDL12_H

#include <SDL.h>

#ifdef __cplusplus
extern "C" {
#endif

#define SDL_SWSURFACE 0x00000000
#define SDL_HWSURFACE 0x00000001
#define SDL_OPENGL 0x00000002
#define SDL_FULLSCREEN 0x80000000

typedef enum
{
  SDL_GRAB_QUERY = -1,
  SDL_GRAB_OFF = 0,
  SDL_GRAB_ON = 1
} SDL_GrabMode;

typedef struct
{
  Uint32 hw_available:1;
  Uint32 wm_available:1;
  Uint32 video_mem;
  SDL_PixelFormat *vfmt;
} SDL_VideoInfo;

const SDL_VideoInfo *SDL_GetVideoInfo (void);
SDL_Rect **SDL_ListModes (SDL_PixelFormat * format, Uint32 flags);
SDL_Surface *SDL_SetVideoMode (int width, int height, int bpp, Uint32 flags);
void SDL_GL_SwapBuffers (void);
void SDL_WM_SetCaption (const char *title, const char *icon);
SDL_GrabMode SDL_WM_GrabInput (SDL_GrabMode mode);
void SDL_WarpMouse (Uint16 x, Uint16 y);
int SDL_EnableUNICODE (int enable);
/* the character a key types, as SDL 1.2 put it in keysym.unicode (letters, digits and signs; shift
 * gives capitals) */
Uint16 zaz_keysym_unicode (const SDL_Keysym * keysym);
/* SDL 1.2 names */
typedef SDL_Keycode SDLKey;
typedef SDL_Keymod SDLMod;
#define SDL_mutexP(m) SDL_LockMutex (m)
#define SDL_mutexV(m) SDL_UnlockMutex (m)

#ifdef __cplusplus
}
#endif

#endif
