]> git.jsancho.org Git - guile-irrlicht.git/blobdiff - src/video-driver.cpp
Optional parameters are SCM_UNDEFINED
[guile-irrlicht.git] / src / video-driver.cpp
index 9c81120fb97825ad23f422146a0795569705a9bf..85a720ef59212059c40ac9bff3df99286ee0cc5f 100644 (file)
@@ -24,6 +24,7 @@
 
 #include "color.h"
 #include "device.h"
+#include "gsubr.h"
 #include "gui-environment.h"
 #include "material.h"
 #include "matrix4.h"
@@ -41,16 +42,13 @@ extern "C" {
   init_video_driver (void)
   {
     init_video_driver_type ();
-    scm_c_define_gsubr ("begin-scene", 1, 0, 1, (scm_t_subr)irr_video_beginScene);
-    scm_c_define_gsubr ("draw-vertex-primitive-list", 3, 0, 1,
-                        (scm_t_subr)irr_video_drawVertexPrimitiveList);
-    scm_c_define_gsubr ("end-scene", 1, 0, 0, (scm_t_subr)irr_video_endScene);
-    scm_c_define_gsubr ("get-fps", 1, 0, 0, (scm_t_subr)irr_video_getFPS);
-    scm_c_define_gsubr ("get-texture", 2, 0, 0, (scm_t_subr)irr_video_getTexture);
-    scm_c_define_gsubr ("get-video-driver", 1, 0, 0, (scm_t_subr)irr_getVideoDriver);
-    scm_c_define_gsubr ("set-transform!", 3, 0, 0, (scm_t_subr)irr_video_setTransform);
-    scm_c_export ("begin-scene", "draw-vertex-primitive-list", "end-scene", "get-fps",
-                  "get-texture", "get-video-driver", "set-transform!", NULL);
+    DEFINE_GSUBR ("begin-scene", 1, 0, 1, irr_video_beginScene);
+    DEFINE_GSUBR ("draw-vertex-primitive-list", 3, 0, 1, irr_video_drawVertexPrimitiveList);
+    DEFINE_GSUBR ("end-scene", 1, 0, 0, irr_video_endScene);
+    DEFINE_GSUBR ("get-fps", 1, 0, 0, irr_video_getFPS);
+    DEFINE_GSUBR ("get-texture", 2, 0, 0, irr_video_getTexture);
+    DEFINE_GSUBR ("get-video-driver", 1, 0, 0, irr_getVideoDriver);
+    DEFINE_GSUBR ("set-transform!", 3, 0, 0, irr_video_setTransform);
   }
 
   DEFINE_WRAPPED_TYPE (irr::video::IVideoDriver*, "video-driver",
@@ -61,14 +59,14 @@ extern "C" {
   irr_video_beginScene (SCM wrapped_video_driver,
                         SCM rest)
   {
-    SCM back_buffer = scm_from_bool(1);
-    SCM z_buffer = scm_from_bool(1);
+    SCM back_buffer = SCM_BOOL_T;
+    SCM z_buffer = SCM_BOOL_T;
     SCM color = scm_list_4 (scm_from_uint32 (255),
                             scm_from_uint32 (0),
                             scm_from_uint32 (0),
                             scm_from_uint32 (0));
-    SCM video_data = scm_from_bool(0);
-    SCM source_rect = scm_from_bool(0);
+    SCM video_data = SCM_BOOL_F;
+    SCM source_rect = SCM_BOOL_F;
 
     scm_c_bind_keyword_arguments ("begin-scene", rest, (scm_t_keyword_arguments_flags)0,
                                   scm_from_utf8_keyword ("back-buffer"), &back_buffer,