]> git.jsancho.org Git - gacela.git/blobdiff - src/gacela_SDL.c
(no commit message)
[gacela.git] / src / gacela_SDL.c
index 07ab34799965feb91908b8fb1f03305deccc696a..ce2f2cc9f0f94166c2d09565ded2754176af2dd9 100644 (file)
@@ -75,6 +75,22 @@ get_surface_height (SCM surface_smob)
   return scm_from_int (surface->h);
 }
 
+SCM
+get_surface_pixels (SCM surface_smob)
+{
+  SDL_Surface *surface = get_surface_address (surface_smob);
+
+  return scm_from_int (surface->pixels);
+}
+
+SCM
+get_surface_format_BytesPerPixel (SCM surface_smob)
+{
+  SDL_Surface *surface = get_surface_address (surface_smob);
+
+  return scm_from_int (surface->format->BytesPerPixel);
+}
+
 SCM
 mark_surface (SCM surface_smob)
 {
@@ -133,7 +149,7 @@ gacela_SDL_SetVideoMode (SCM width, SCM height, SCM bpp, SCM flags)
     return make_surface (scm_from_locale_string ("screen"), screen);
   }
   else {
-    return SCM_UNSPECIFIED;
+    return SCM_BOOL_F;
   }
 }
 
@@ -190,7 +206,7 @@ gacela_SDL_LoadBMP (SCM file)
     return make_surface (file, image);
   }
   else {
-    return SCM_UNSPECIFIED;
+    return SCM_BOOL_F;
   }
 }
 
@@ -203,7 +219,7 @@ gacela_IMG_Load (SCM filename)
     return make_surface (filename, image);
   }
   else {
-    return SCM_UNSPECIFIED;
+    return SCM_BOOL_F;
   }
 }
 
@@ -355,6 +371,8 @@ SDL_register_functions (void* data)
   scm_set_smob_print (surface_tag, print_surface);
   scm_c_define_gsubr ("surface-w", 1, 0, 0, get_surface_width);
   scm_c_define_gsubr ("surface-h", 1, 0, 0, get_surface_height);
+  scm_c_define_gsubr ("surface-pixels", 1, 0, 0, get_surface_pixels);
+  scm_c_define_gsubr ("surface-format-BytesPerPixel", 1, 0, 0, get_surface_format_BytesPerPixel);
 
   scm_c_define ("SDL_INIT_TIMER", scm_from_int (SDL_INIT_TIMER));
   scm_c_define ("SDL_INIT_AUDIO", scm_from_int (SDL_INIT_AUDIO));