]> git.jsancho.org Git - guile-irrlicht.git/commitdiff
Define procedures with keywords from C code
authorJavier Sancho <jsf@jsancho.org>
Thu, 19 Mar 2020 11:54:29 +0000 (12:54 +0100)
committerJavier Sancho <jsf@jsancho.org>
Thu, 19 Mar 2020 11:54:29 +0000 (12:54 +0100)
19 files changed:
Makefile.am
irrlicht.scm
irrlicht/device.scm [deleted file]
irrlicht/gui.scm [deleted file]
irrlicht/irr.scm [deleted file]
irrlicht/scene.scm [deleted file]
irrlicht/video.scm [deleted file]
src/animated-mesh-scene-node.cpp
src/device.cpp
src/device.h
src/gui-environment.cpp
src/gui-environment.h
src/material-flags.cpp
src/reference-counted.cpp
src/scene-manager.cpp
src/scene-manager.h
src/scene-node.cpp
src/video-driver.cpp
src/video-driver.h

index e1d88a167b84406ab25c27132e1ee8858d06faa3..08a5f1dfe74b17533120e981cde0f2ac355c4c8e 100644 (file)
@@ -70,10 +70,4 @@ SUFFIXES = .scm .go
 moddir = @GUILE_SITE@
 godir = @GUILE_SITE_CCACHE@
 
-SOURCES = \
-  irrlicht.scm \
-  irrlicht/device.scm \
-  irrlicht/gui.scm \
-  irrlicht/irr.scm \
-  irrlicht/scene.scm \
-  irrlicht/video.scm
+SOURCES = irrlicht.scm
index 57ecbbcae71786d90337b3c4533908f788935196..14e4457c909ac6cfc1ec3fc4791e6b1355331deb 100644 (file)
 
 (define-module (irrlicht))
 
-(eval-when (eval load compile)
-  ;; load public symbols into current module
-  (let ((public-modules
-         '((irrlicht device)
-           (irrlicht gui)
-           (irrlicht irr)
-           (irrlicht scene)
-           (irrlicht video)))
-        (current-interface
-         (module-public-interface (current-module))))
-    (for-each
-     (lambda (m)
-       (module-use! current-interface (resolve-interface m)))
-     public-modules)))
+(load-extension "libguile-irrlicht" "init_guile_irrlicht")
diff --git a/irrlicht/device.scm b/irrlicht/device.scm
deleted file mode 100644 (file)
index 58d2127..0000000
+++ /dev/null
@@ -1,46 +0,0 @@
-;;; guile-irrlicht --- FFI bindings for Irrlicht Engine
-;;; Copyright (C) 2019 Javier Sancho <jsf@jsancho.org>
-;;;
-;;; This file is part of guile-irrlicht.
-;;;
-;;; Guile-irrlicht is free software; you can redistribute it and/or modify
-;;; it under the terms of the GNU Lesser General Public License as
-;;; published by the Free Software Foundation; either version 3 of the
-;;; License, or (at your option) any later version.
-;;;
-;;; Guile-irrlicht is distributed in the hope that it will be useful, but
-;;; WITHOUT ANY WARRANTY; without even the implied warranty of
-;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-;;; General Public License for more details.
-;;;
-;;; You should have received a copy of the GNU Lesser General Public
-;;; License along with guile-irrlicht.  If not, see
-;;; <http://www.gnu.org/licenses/>.
-
-
-(define-module (irrlicht device)
-  #:export (create-device
-            get-gui-environment
-            get-scene-manager
-            get-video-driver
-            run
-            set-window-caption!))
-
-(load-extension "libguile-irrlicht" "init_guile_irrlicht")
-
-(define irr-create-device create-device)
-(define* (create-device #:key
-                        (device-type 'software)
-                        (window-size '(640 480))
-                        (bits 16)
-                        (fullscreen #f)
-                        (stencilbuffer #f)
-                        (vsync #f)
-                        (receiver 0))
-  (irr-create-device device-type
-                     window-size
-                     bits
-                     fullscreen
-                     stencilbuffer
-                     vsync
-                     receiver))
diff --git a/irrlicht/gui.scm b/irrlicht/gui.scm
deleted file mode 100644 (file)
index 2299574..0000000
+++ /dev/null
@@ -1,41 +0,0 @@
-;;; guile-irrlicht --- FFI bindings for Irrlicht Engine
-;;; Copyright (C) 2019 Javier Sancho <jsf@jsancho.org>
-;;;
-;;; This file is part of guile-irrlicht.
-;;;
-;;; Guile-irrlicht is free software; you can redistribute it and/or modify
-;;; it under the terms of the GNU Lesser General Public License as
-;;; published by the Free Software Foundation; either version 3 of the
-;;; License, or (at your option) any later version.
-;;;
-;;; Guile-irrlicht is distributed in the hope that it will be useful, but
-;;; WITHOUT ANY WARRANTY; without even the implied warranty of
-;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-;;; General Public License for more details.
-;;;
-;;; You should have received a copy of the GNU Lesser General Public
-;;; License along with guile-irrlicht.  If not, see
-;;; <http://www.gnu.org/licenses/>.
-
-
-(define-module (irrlicht gui)
-  #:export (add-static-text!))
-
-(load-extension "libguile-irrlicht" "init_guile_irrlicht")
-
-(define irr-add-static-text! add-static-text!)
-(define* (add-static-text! guienv text rectangle
-                           #:key
-                           (border #f)
-                           (word-wrap #t)
-                           (parent #f)
-                           (id -1)
-                           (fill-background #f))
-  (irr-add-static-text! guienv
-                        text
-                        rectangle
-                        border
-                        word-wrap
-                        parent
-                        id
-                        fill-background))
diff --git a/irrlicht/irr.scm b/irrlicht/irr.scm
deleted file mode 100644 (file)
index 9b89142..0000000
+++ /dev/null
@@ -1,24 +0,0 @@
-;;; guile-irrlicht --- FFI bindings for Irrlicht Engine
-;;; Copyright (C) 2019 Javier Sancho <jsf@jsancho.org>
-;;;
-;;; This file is part of guile-irrlicht.
-;;;
-;;; Guile-irrlicht is free software; you can redistribute it and/or modify
-;;; it under the terms of the GNU Lesser General Public License as
-;;; published by the Free Software Foundation; either version 3 of the
-;;; License, or (at your option) any later version.
-;;;
-;;; Guile-irrlicht is distributed in the hope that it will be useful, but
-;;; WITHOUT ANY WARRANTY; without even the implied warranty of
-;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-;;; General Public License for more details.
-;;;
-;;; You should have received a copy of the GNU Lesser General Public
-;;; License along with guile-irrlicht.  If not, see
-;;; <http://www.gnu.org/licenses/>.
-
-
-(define-module (irrlicht irr)
-  #:export (drop!))
-
-(load-extension "libguile-irrlicht" "init_guile_irrlicht")
diff --git a/irrlicht/scene.scm b/irrlicht/scene.scm
deleted file mode 100644 (file)
index 115d2e8..0000000
+++ /dev/null
@@ -1,62 +0,0 @@
-;;; guile-irrlicht --- FFI bindings for Irrlicht Engine
-;;; Copyright (C) 2019 Javier Sancho <jsf@jsancho.org>
-;;;
-;;; This file is part of guile-irrlicht.
-;;;
-;;; Guile-irrlicht is free software; you can redistribute it and/or modify
-;;; it under the terms of the GNU Lesser General Public License as
-;;; published by the Free Software Foundation; either version 3 of the
-;;; License, or (at your option) any later version.
-;;;
-;;; Guile-irrlicht is distributed in the hope that it will be useful, but
-;;; WITHOUT ANY WARRANTY; without even the implied warranty of
-;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-;;; General Public License for more details.
-;;;
-;;; You should have received a copy of the GNU Lesser General Public
-;;; License along with guile-irrlicht.  If not, see
-;;; <http://www.gnu.org/licenses/>.
-
-
-(define-module (irrlicht scene)
-  #:export (add-animated-mesh-scene-node!
-            add-camera-scene-node!
-            get-mesh
-            set-material-flag!
-            set-material-texture!
-            set-md2-animation!))
-
-(load-extension "libguile-irrlicht" "init_guile_irrlicht")
-
-(define irr-add-animated-mesh-scene-node! add-animated-mesh-scene-node!)
-(define* (add-animated-mesh-scene-node! scene-manager mesh
-                                        #:key
-                                        (parent #f)
-                                        (id -1)
-                                        (position '(0 0 0))
-                                        (rotation '(0 0 0))
-                                        (scale '(1 1 1))
-                                        (also-add-if-mesh-pointer-zero #f))
-  (irr-add-animated-mesh-scene-node! scene-manager
-                                     mesh
-                                     parent
-                                     id
-                                     position
-                                     rotation
-                                     scale
-                                     also-add-if-mesh-pointer-zero))
-
-(define irr-add-camera-scene-node! add-camera-scene-node!)
-(define* (add-camera-scene-node! scene-manager
-                                 #:key
-                                 (parent #f)
-                                 (position '(0 0 0))
-                                 (lookat '(0 0 100))
-                                 (id -1)
-                                 (make-active #t))
-  (irr-add-camera-scene-node! scene-manager
-                              parent
-                              position
-                              lookat
-                              id
-                              make-active))
diff --git a/irrlicht/video.scm b/irrlicht/video.scm
deleted file mode 100644 (file)
index 9999595..0000000
+++ /dev/null
@@ -1,40 +0,0 @@
-;;; guile-irrlicht --- FFI bindings for Irrlicht Engine
-;;; Copyright (C) 2020 Javier Sancho <jsf@jsancho.org>
-;;;
-;;; This file is part of guile-irrlicht.
-;;;
-;;; Guile-irrlicht is free software; you can redistribute it and/or modify
-;;; it under the terms of the GNU Lesser General Public License as
-;;; published by the Free Software Foundation; either version 3 of the
-;;; License, or (at your option) any later version.
-;;;
-;;; Guile-irrlicht is distributed in the hope that it will be useful, but
-;;; WITHOUT ANY WARRANTY; without even the implied warranty of
-;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-;;; General Public License for more details.
-;;;
-;;; You should have received a copy of the GNU Lesser General Public
-;;; License along with guile-irrlicht.  If not, see
-;;; <http://www.gnu.org/licenses/>.
-
-
-(define-module (irrlicht video)
-  #:export (begin-scene
-            get-texture))
-
-(load-extension "libguile-irrlicht" "init_guile_irrlicht")
-
-(define irr-begin-scene begin-scene)
-(define* (begin-scene video-driver
-                      #:key
-                      (back-buffer #t)
-                      (z-buffer #t)
-                      (color '(255 0 0 0))
-                      (video-data #f)
-                      (source-rect #f))
-  (irr-begin-scene video-driver
-                   back-buffer
-                   z-buffer
-                   color
-                   video-data
-                   source-rect))
index 87fac47396e3f898d2920c930995e010c0899c7e..ceb5ec201cbe4000d39728ed9ecfaabe582067fa 100644 (file)
@@ -32,6 +32,7 @@ extern "C" {
   {
     init_animated_mesh_scene_node_type ();
     scm_c_define_gsubr ("set-md2-animation!", 2, 0, 0, (scm_t_subr)irr_scene_setMD2Animation);
+    scm_c_export ("set-md2-animation!", NULL);
   }
 
   DEFINE_WRAPPED_TYPE (irr::scene::IAnimatedMeshSceneNode*, "animated-mesh-scene-node",
index a02cd0564f221c6b130285d813eeca0660f6b967..3b5b9b9f76d1b820c755e6580b71d7db9bd9dd51 100644 (file)
@@ -34,9 +34,10 @@ extern "C" {
   init_device (void)
   {
     init_device_type ();
-    scm_c_define_gsubr ("create-device", 7, 0, 0, (scm_t_subr)irr_createDevice);
+    scm_c_define_gsubr ("create-device", 0, 0, 1, (scm_t_subr)irr_createDevice);
     scm_c_define_gsubr ("run", 1, 0, 0, (scm_t_subr)irr_run);
     scm_c_define_gsubr ("set-window-caption!", 2, 0, 0, (scm_t_subr)irr_setWindowCaption);
+    scm_c_export ("create-device", "run", "set-window-caption!", NULL);
   }
 
   DEFINE_WRAPPED_TYPE (irr::IrrlichtDevice*, "device",
@@ -44,17 +45,30 @@ extern "C" {
                        wrap_device, unwrap_device);
 
   SCM
-  irr_createDevice (SCM deviceType,
-                    SCM windowSize,
-                    SCM bits,
-                    SCM fullscreen,
-                    SCM stencilbuffer,
-                    SCM vsync,
-                    SCM receiver)
+  irr_createDevice (SCM rest)
   {
+    SCM device_type = scm_from_utf8_symbol ("software");
+    SCM window_size = scm_list_2 (scm_from_uint32 (640),
+                                  scm_from_uint32 (480));
+    SCM bits = scm_from_uint32 (16);
+    SCM fullscreen = scm_from_bool (0);
+    SCM stencilbuffer = scm_from_bool (0);
+    SCM vsync = scm_from_bool (0);
+    SCM receiver = scm_from_bool (0);
+
+    scm_c_bind_keyword_arguments ("create-device", rest, (scm_t_keyword_arguments_flags)0,
+                                  scm_from_utf8_keyword ("device-type"), &device_type,
+                                  scm_from_utf8_keyword ("window-size"), &window_size,
+                                  scm_from_utf8_keyword ("bits"), &bits,
+                                  scm_from_utf8_keyword ("fullscreen"), &fullscreen,
+                                  scm_from_utf8_keyword ("stencilbuffer"), &stencilbuffer,
+                                  scm_from_utf8_keyword ("vsync"), &vsync,
+                                  scm_from_utf8_keyword ("receiver"), &receiver,
+                                  SCM_UNDEFINED);
+
     irr::IrrlichtDevice* device =
-      irr::createDevice (scm_to_driver_type (deviceType),
-                         scm_to_dimension2d_u32 (windowSize),
+      irr::createDevice (scm_to_driver_type (device_type),
+                         scm_to_dimension2d_u32 (window_size),
                          scm_to_uint32 (bits),
                          scm_to_bool (fullscreen),
                          scm_to_bool (stencilbuffer),
index 5422b1fc65b3d458cf0d3576f620edcf419d7cbc..31195c6deb9d96b891e9e9989cf44436530d6ddb 100644 (file)
@@ -35,13 +35,7 @@ extern "C" {
                         device_p, wrap_device, unwrap_device);
 
   SCM
-  irr_createDevice (SCM deviceType,
-                    SCM windowSize,
-                    SCM bits,
-                    SCM fullscreen,
-                    SCM stencilbuffer,
-                    SCM vsync,
-                    SCM receiver);
+  irr_createDevice (SCM rest);
 
   SCM
   irr_run (SCM wrapped_device);
index ca59a3196a809e167c39fbf365f6e21f38d884e1..fb13f53d363f901f1e7b2692523c3daf4e7a4d70 100644 (file)
@@ -36,8 +36,9 @@ extern "C" {
   init_gui_environment (void)
   {
     init_gui_environment_type ();
-    scm_c_define_gsubr ("add-static-text!", 8, 0, 0, (scm_t_subr)irr_gui_addStaticText);
+    scm_c_define_gsubr ("add-static-text!", 3, 0, 1, (scm_t_subr)irr_gui_addStaticText);
     scm_c_define_gsubr ("get-gui-environment", 1, 0, 0, (scm_t_subr)irr_getGUIEnvironment);
+    scm_c_export ("add-static-text!", "get-gui-environment", NULL);
   }
 
   DEFINE_WRAPPED_TYPE (irr::gui::IGUIEnvironment*, "gui-environment",
@@ -61,24 +62,34 @@ extern "C" {
   }
 
   SCM
-  irr_gui_addStaticText (SCM wrappedGUIEnvironment,
+  irr_gui_addStaticText (SCM wrapped_gui_environment,
                          SCM text,
                          SCM rectangle,
-                         SCM border,
-                         SCM wordWrap,
-                         SCM parent,
-                         SCM id,
-                         SCM fillBackground)
+                         SCM rest)
   {
-    irr::gui::IGUIEnvironment* guienv = unwrap_gui_environment (wrappedGUIEnvironment);
+    SCM border = scm_from_bool (0);
+    SCM word_wrap = scm_from_bool (1);
+    SCM parent = scm_from_bool (0);
+    SCM id = scm_from_int32 (-1);
+    SCM fill_background = scm_from_bool (0);
+
+    scm_c_bind_keyword_arguments ("add-static-text!", rest, (scm_t_keyword_arguments_flags)0,
+                                  scm_from_utf8_keyword ("border"), &border,
+                                  scm_from_utf8_keyword ("word-wrap"), &word_wrap,
+                                  scm_from_utf8_keyword ("parent"), &parent,
+                                  scm_from_utf8_keyword ("id"), &id,
+                                  scm_from_utf8_keyword ("fill-background"), &fill_background,
+                                  SCM_UNDEFINED);
+
+    irr::gui::IGUIEnvironment* guienv = unwrap_gui_environment (wrapped_gui_environment);
     irr::gui::IGUIStaticText* staticText =
       guienv->addStaticText (scm_to_wide_char_string (text),
                              scm_to_rect_s32 (rectangle),
                              scm_to_bool (border),
-                             scm_to_bool (wordWrap),
+                             scm_to_bool (word_wrap),
                              scm_is_false (parent) ? 0 : unwrap_gui_element (parent),
                              scm_to_int32 (id),
-                             scm_to_bool (fillBackground));
+                             scm_to_bool (fill_background));
     return wrap_gui_static_text (staticText);
   }
 
index caac2eeda7653f21c0ac15ab9f4797974101340d..dd3f597d051d6239de7bc2c3a561a831d5a04ef6 100644 (file)
@@ -38,14 +38,10 @@ extern "C" {
   irr_getGUIEnvironment (SCM wrapped_obj);
 
   SCM
-  irr_gui_addStaticText (SCM guienv,
+  irr_gui_addStaticText (SCM wrapped_gui_environment,
                          SCM text,
                          SCM rectangle,
-                         SCM border,
-                         SCM wordWrap,
-                         SCM parent,
-                         SCM id,
-                         SCM fillBackground);
+                         SCM rest);
 
 }
 
index d700e4c3bb258e24738e516f585f4fd2d790b40e..90aa64e9d335fa58c5ae26178eafa77dd9e282a0 100644 (file)
@@ -31,6 +31,7 @@ extern "C" {
   init_material_flag (void)
   {
     scm_c_define_gsubr ("set-material-flag!", 3, 0, 0, (scm_t_subr)irr_scene_setMaterialFlag);
+    scm_c_export ("set-material-flag!", NULL);
   }
 
   SCM
index 58878d38f019c17d32bea88d9d9522b1f0f85909..eabc3efa0706d16d07deb53dc69fa3925f554a53 100644 (file)
@@ -31,6 +31,7 @@ extern "C" {
   init_reference_counted (void)
   {
     scm_c_define_gsubr ("drop!", 1, 0, 0, (scm_t_subr)irr_drop);
+    scm_c_export ("drop!", NULL);
   }
 
   SCM
index 3c080d566439b46e26932de4ee08408783a9bb35..cb7f80c94d0249106ff105ae3d39b0a91e5fa681 100644 (file)
@@ -37,12 +37,14 @@ extern "C" {
   init_scene_manager (void)
   {
     init_scene_manager_type ();
-    scm_c_define_gsubr ("add-animated-mesh-scene-node!", 8, 0, 0,
+    scm_c_define_gsubr ("add-animated-mesh-scene-node!", 2, 0, 1,
                         (scm_t_subr)irr_scene_addAnimatedMeshSceneNode);
-    scm_c_define_gsubr ("add-camera-scene-node!", 6, 0, 0,
+    scm_c_define_gsubr ("add-camera-scene-node!", 1, 0, 1,
                         (scm_t_subr)irr_scene_addCameraSceneNode);
     scm_c_define_gsubr ("get-mesh", 2, 0, 0, (scm_t_subr)irr_scene_getMesh);
     scm_c_define_gsubr ("get-scene-manager", 1, 0, 0, (scm_t_subr)irr_getSceneManager);
+    scm_c_export ("add-animated-mesh-scene-node!", "add-camera-scene-node!",
+                  "get-mesh", "get-scene-manager", NULL);
   }
 
   DEFINE_WRAPPED_TYPE (irr::scene::ISceneManager*, "scene-manager",
@@ -52,13 +54,30 @@ extern "C" {
   SCM
   irr_scene_addAnimatedMeshSceneNode (SCM wrapped_scene_manager,
                                       SCM mesh,
-                                      SCM parent,
-                                      SCM id,
-                                      SCM position,
-                                      SCM rotation,
-                                      SCM scale,
-                                      SCM alsoAddIfMeshPointerZero)
+                                      SCM rest)
   {
+    SCM parent = scm_from_bool (0);
+    SCM id = scm_from_int32 (-1);
+    SCM position = scm_list_3 (scm_from_double (0),
+                               scm_from_double (0),
+                               scm_from_double (0));
+    SCM rotation = scm_list_3 (scm_from_double (0),
+                               scm_from_double (0),
+                               scm_from_double (0));
+    SCM scale = scm_list_3 (scm_from_double (1),
+                            scm_from_double (1),
+                            scm_from_double (1));
+    SCM also_add_if_mesh_pointer_zero = scm_from_bool (0);
+
+    scm_c_bind_keyword_arguments ("add-animated-mesh-scene-node!", rest, (scm_t_keyword_arguments_flags)0,
+                                  scm_from_utf8_keyword ("parent"), &parent,
+                                  scm_from_utf8_keyword ("id"), &id,
+                                  scm_from_utf8_keyword ("position"), &position,
+                                  scm_from_utf8_keyword ("rotation"), &rotation,
+                                  scm_from_utf8_keyword ("scale"), &scale,
+                                  scm_from_utf8_keyword ("also-add-if-mesh-pointer-zero"), &also_add_if_mesh_pointer_zero,
+                                  SCM_UNDEFINED);
+
     irr::scene::ISceneManager* smgr = unwrap_scene_manager (wrapped_scene_manager);
     irr::scene::IAnimatedMeshSceneNode* node =
       smgr->addAnimatedMeshSceneNode (unwrap_animated_mesh (mesh),
@@ -67,18 +86,32 @@ extern "C" {
                                       scm_to_vector3df (position),
                                       scm_to_vector3df (rotation),
                                       scm_to_vector3df (scale),
-                                      scm_to_bool (alsoAddIfMeshPointerZero));
+                                      scm_to_bool (also_add_if_mesh_pointer_zero));
     return wrap_animated_mesh_scene_node (node);
   }
 
   SCM
   irr_scene_addCameraSceneNode (SCM wrapped_scene_manager,
-                                SCM parent,
-                                SCM position,
-                                SCM lookat,
-                                SCM id,
-                                SCM make_active)
+                                SCM rest)
   {
+    SCM parent = scm_from_bool (0);
+    SCM position = scm_list_3 (scm_from_double (0),
+                               scm_from_double (0),
+                               scm_from_double (0));
+    SCM lookat = scm_list_3 (scm_from_double (0),
+                             scm_from_double (0),
+                             scm_from_double (100));
+    SCM id = scm_from_int32 (-1);
+    SCM make_active = scm_from_bool (1);
+
+    scm_c_bind_keyword_arguments ("add-camera-scene-node!", rest, (scm_t_keyword_arguments_flags)0,
+                                  scm_from_utf8_keyword ("parent"), &parent,
+                                  scm_from_utf8_keyword ("position"), &position,
+                                  scm_from_utf8_keyword ("lookat"), &lookat,
+                                  scm_from_utf8_keyword ("id"), &id,
+                                  scm_from_utf8_keyword ("make-active"), &make_active,
+                                  SCM_UNDEFINED);
+
     irr::scene::ISceneManager* scene_manager = unwrap_scene_manager (wrapped_scene_manager);
     irr::scene::ICameraSceneNode* camera =
       scene_manager->addCameraSceneNode (scm_is_false (parent) ? 0 : unwrap_scene_node (parent),
index aa5d442a235ed83fdacadf1bdb4613e78fe2680a..f65548ef68edb7e316f7bab0358db919fffcb5b1 100644 (file)
@@ -37,20 +37,11 @@ extern "C" {
   SCM
   irr_scene_addAnimatedMeshSceneNode (SCM wrapped_scene_manager,
                                       SCM mesh,
-                                      SCM parent,
-                                      SCM id,
-                                      SCM position,
-                                      SCM rotation,
-                                      SCM scale,
-                                      SCM alsoAddIfMeshPointerZero);
+                                      SCM rest);
 
   SCM
   irr_scene_addCameraSceneNode (SCM wrapped_scene_manager,
-                                SCM parent,
-                                SCM position,
-                                SCM lookat,
-                                SCM id,
-                                SCM make_active);
+                                SCM rest);
 
   SCM
   irr_scene_getMesh (SCM wrapped_scene_manager,
index 16ddbf6a7fab932d9c9a396b82147f2913ecc5aa..859fbc88a085e22a95999a52794f99f3a944c25c 100644 (file)
@@ -33,6 +33,7 @@ extern "C" {
   {
     init_scene_node_type ();
     scm_c_define_gsubr ("set-material-texture!", 3, 0, 0, (scm_t_subr)irr_scene_setMaterialTexture);
+    scm_c_export ("set-material-texture!", NULL);
   }
 
   DEFINE_WRAPPED_TYPE (irr::scene::ISceneNode*, "scene-node",
index dc9cce60da4a42012f2e91fd31ff4912e8f2f732..57231a6d2623bd342aa934df16b4a9ccbefcd7d7 100644 (file)
@@ -35,9 +35,10 @@ extern "C" {
   init_video_driver (void)
   {
     init_video_driver_type ();
-    scm_c_define_gsubr ("begin-scene", 6, 0, 0, (scm_t_subr)irr_video_beginScene);
+    scm_c_define_gsubr ("begin-scene", 1, 0, 1, (scm_t_subr)irr_video_beginScene);
     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_export ("begin-scene", "get-texture", "get-video-driver", NULL);
   }
 
   DEFINE_WRAPPED_TYPE (irr::video::IVideoDriver*, "video-driver",
@@ -46,12 +47,25 @@ extern "C" {
 
   SCM
   irr_video_beginScene (SCM wrapped_video_driver,
-                        SCM back_buffer,
-                        SCM z_buffer,
-                        SCM color,
-                        SCM video_data,
-                        SCM source_rect)
+                        SCM rest)
   {
+    SCM back_buffer = scm_from_bool(1);
+    SCM z_buffer = scm_from_bool(1);
+    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_c_bind_keyword_arguments ("begin-scene", rest, (scm_t_keyword_arguments_flags)0,
+                                  scm_from_utf8_keyword ("back-buffer"), &back_buffer,
+                                  scm_from_utf8_keyword ("z-buffer"), &z_buffer,
+                                  scm_from_utf8_keyword ("color"), &color,
+                                  scm_from_utf8_keyword ("video-data"), &video_data,
+                                  scm_from_utf8_keyword ("source-rect"), &source_rect,
+                                  SCM_UNDEFINED);
+
     irr::video::IVideoDriver* driver = unwrap_video_driver (wrapped_video_driver);
     irr::core::rect<irr::s32>* sourceRectAddress = 0;
     if (!scm_is_false (source_rect))
index 65df39ace0802f173714372cc338f0215ee40b65..64bf068b65dafb2ea7e46309a30af06fe8137e19 100644 (file)
@@ -36,11 +36,7 @@ extern "C" {
 
   SCM
   irr_video_beginScene (SCM wrapped_video_driver,
-                        SCM back_buffer,
-                        SCM z_buffer,
-                        SCM color,
-                        SCM video_data,
-                        SCM source_rect);
+                        SCM rest);
 
   SCM
   irr_video_getTexture (SCM wrapped_video_driver,