+ return scm_from_int ((int)SDL_SetVideoMode (scm_to_int (width), scm_to_int (height), \
+ scm_to_int (bpp), scm_to_int (flags)));
+}
+
+SCM
+gacela_SDL_WM_SetCaption (SCM title, SCM icon)
+{
+ SDL_WM_SetCaption (scm_to_locale_string(title), scm_to_locale_string(icon));
+ return SCM_UNSPECIFIED;
+}
+
+SCM
+gacela_SDL_Flip (SCM screen)
+{
+ return scm_from_int (SDL_Flip ((SDL_Surface *)scm_to_int (screen)));
+}
+
+SCM
+gacela_SDL_FreeSurface (SCM surface)
+{
+ SDL_FreeSurface ((SDL_Surface *)scm_to_int (surface));
+ return SCM_UNSPECIFIED;
+}
+
+SCM
+gacela_SDL_Delay (SCM ms)
+{
+ SDL_Delay (scm_to_int (ms));
+ return SCM_UNSPECIFIED;
+}
+
+SCM
+gacela_SDL_GetTicks (void)
+{
+ return scm_from_int (SDL_GetTicks ());
+}
+
+SCM
+gacela_SDL_DisplayFormat (SCM surface)
+{
+ return scm_from_int ((int)SDL_DisplayFormat ((SDL_Surface *)scm_to_int (surface)));
+}
+
+SCM
+gacela_SDL_MapRGB (SCM format, SCM r, SCM g, SCM b)
+{
+ return scm_from_int (SDL_MapRGB ((SDL_PixelFormat *)scm_to_int (format), scm_to_int (r), scm_to_int (g), scm_to_int (b)));
+}
+
+SCM
+gacela_SDL_SetColorKey (SCM surface, SCM flag, SCM key)
+{
+ return scm_from_int (SDL_SetColorKey ((SDL_Surface *)scm_to_int (surface), scm_to_int (flag), scm_to_int (key)));
+}
+
+SCM
+gacela_SDL_LoadBMP (SCM file)
+{
+ return scm_from_int ((int)SDL_LoadBMP (scm_to_locale_string (file)));
+}
+
+SCM
+gacela_IMG_Load (SCM filename)
+{
+ return scm_from_int ((int)IMG_Load (scm_to_locale_string (filename)));
+}
+
+SCM
+gacela_SDL_GetVideoInfo (void)
+{
+ const SDL_VideoInfo *info;
+ SCM vi;
+
+ info = SDL_GetVideoInfo ();
+ vi = scm_list_n (SCM_UNDEFINED);
+
+ vi = scm_cons (scm_cons (scm_from_locale_symbol ("blit_hw"), scm_from_int (info->blit_hw)), vi);
+ vi = scm_cons (scm_cons (scm_from_locale_symbol ("hw_available"), scm_from_int (info->hw_available)), vi);
+
+ return vi;
+}
+
+SCM
+gacela_SDL_GL_SetAttribute (SCM attr, SCM value)
+{
+ return scm_from_int (SDL_GL_SetAttribute (scm_to_int (attr), scm_to_int (value)));
+}
+
+SCM
+gacela_SDL_PollEvent (void)
+{
+ SDL_Event sdl_event;
+ SCM event;
+
+ event = scm_list_n (SCM_UNDEFINED);
+
+ if (SDL_PollEvent (&sdl_event)) {
+ switch (sdl_event.type) {
+ case SDL_KEYDOWN:
+ case SDL_KEYUP:
+ event = scm_cons (scm_cons (scm_from_locale_symbol ("key.keysym.sym"), scm_from_int (sdl_event.key.keysym.sym)), event);
+ break;
+ }
+ event = scm_cons (scm_cons (scm_from_locale_symbol ("type"), scm_from_int (sdl_event.type)), event);
+ }
+
+ return event;
+}
+
+SCM
+gacela_SDL_GL_SwapBuffers (void)
+{
+ SDL_GL_SwapBuffers ();
+ return SCM_UNSPECIFIED;
+}
+
+SCM
+gacela_SDL_EnableKeyRepeat (SCM delay, SCM interval)
+{
+ return scm_from_int (SDL_EnableKeyRepeat (scm_to_int (delay), scm_to_int (interval)));
+}
+
+SCM
+gacela_Mix_OpenAudio (SCM frequency, SCM format, SCM channels, SCM chunksize)
+{
+ return scm_from_int (Mix_OpenAudio (scm_to_int (frequency), scm_to_int (format), scm_to_int (channels), scm_to_int (chunksize)));
+}
+
+SCM
+gacela_Mix_LoadMUS (SCM file)
+{
+ return scm_from_int ((int)Mix_LoadMUS (scm_to_locale_string (file)));
+}
+
+SCM
+gacela_Mix_LoadWAV (SCM file)
+{
+ return scm_from_int ((int)Mix_LoadWAV (scm_to_locale_string (file)));
+}
+
+SCM
+gacela_Mix_PlayChannel (SCM channel, SCM chunk, SCM loops)
+{
+ return scm_from_int (Mix_PlayChannel (scm_to_int (channel), (Mix_Chunk *)scm_to_int (chunk), scm_to_int (loops)));
+}
+
+SCM
+gacela_Mix_PlayMusic (SCM music, SCM loops)
+{
+ return scm_from_int (Mix_PlayMusic ((Mix_Music *)scm_to_int (music), scm_to_int (loops)));
+}
+
+SCM
+gacela_Mix_PlayingMusic (void)
+{
+ return scm_from_int (Mix_PlayingMusic ());
+}
+
+SCM
+gacela_Mix_PausedMusic (void)
+{
+ return scm_from_int (Mix_PausedMusic ());
+}
+
+SCM
+gacela_Mix_PauseMusic (void)
+{
+ Mix_PauseMusic ();
+ return SCM_UNSPECIFIED;
+}
+
+SCM
+gacela_Mix_ResumeMusic (void)
+{
+ Mix_ResumeMusic ();
+ return SCM_UNSPECIFIED;
+}
+
+SCM
+gacela_Mix_HaltMusic (void)
+{
+ return scm_from_int (Mix_HaltMusic ());