]> git.jsancho.org Git - gacela.git/blobdiff - src/sdl.c
Adding SDL_GetError.
[gacela.git] / src / sdl.c
index 8b9791a18ea8babc48620bfe2b924d39b5119ed3..c59d607d3733ca7fba88e18c0c54a92eea538a7c 100644 (file)
--- a/src/sdl.c
+++ b/src/sdl.c
@@ -21,7 +21,6 @@
 #include <SDL/SDL_image.h>
 #include <SDL/SDL_mixer.h>
 #include <SDL/SDL_rotozoom.h>
-#include "gacela_SDL.h"
 
 struct surface
 {
@@ -196,6 +195,12 @@ gacela_SDL_GetTicks (void)
   return scm_from_int (SDL_GetTicks ());
 }
 
+SCM
+gacela_SDL_GetError (void)
+{
+  return scm_from_locale_string (SDL_GetError ());
+}
+
 SCM
 gacela_SDL_DisplayFormat (SCM surface)
 {
@@ -275,8 +280,8 @@ gacela_SDL_GetVideoInfo (void)
   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);
+  vi = scm_cons (scm_cons (scm_from_utf8_symbol ("blit_hw"), scm_from_int (info->blit_hw)), vi);
+  vi = scm_cons (scm_cons (scm_from_utf8_symbol ("hw_available"), scm_from_int (info->hw_available)), vi);
 
   return vi;
 }
@@ -502,6 +507,7 @@ init_gacela_sdl (void *data)
   scm_c_define_gsubr ("SDL_Flip", 1, 0, 0, gacela_SDL_Flip);
   scm_c_define_gsubr ("SDL_Delay", 1, 0, 0, gacela_SDL_Delay);
   scm_c_define_gsubr ("SDL_GetTicks", 0, 0, 0, gacela_SDL_GetTicks);
+  scm_c_define_gsubr ("SDL_GetError", 0, 0, 0, gacela_SDL_GetError);
   scm_c_define_gsubr ("SDL_DisplayFormat", 1, 0, 0, gacela_SDL_DisplayFormat);
   scm_c_define_gsubr ("SDL_DisplayFormatAlpha", 1, 0, 0, gacela_SDL_DisplayFormatAlpha);
   scm_c_define_gsubr ("SDL_MapRGB", 4, 0, 0, gacela_SDL_MapRGB);
@@ -531,7 +537,7 @@ init_gacela_sdl (void *data)
 }
 
 void
-gacela_sdl_init ()
+scm_init_gacela_sdl ()
 {
-  scm_c_define_module ("gacela sdl", init_gacela_sdl, NULL);
+  init_gacela_sdl (NULL);
 }