From 3394d6066c9092a5444c9273f52cea01e2eaf10f Mon Sep 17 00:00:00 2001 From: Javier Sancho Date: Thu, 19 Mar 2020 12:54:29 +0100 Subject: [PATCH] Define procedures with keywords from C code --- Makefile.am | 8 +---- irrlicht.scm | 15 +------- irrlicht/device.scm | 46 ------------------------ irrlicht/gui.scm | 41 --------------------- irrlicht/irr.scm | 24 ------------- irrlicht/scene.scm | 62 -------------------------------- irrlicht/video.scm | 40 --------------------- src/animated-mesh-scene-node.cpp | 1 + src/device.cpp | 34 ++++++++++++------ src/device.h | 8 +---- src/gui-environment.cpp | 31 ++++++++++------ src/gui-environment.h | 8 ++--- src/material-flags.cpp | 1 + src/reference-counted.cpp | 1 + src/scene-manager.cpp | 61 +++++++++++++++++++++++-------- src/scene-manager.h | 13 ++----- src/scene-node.cpp | 1 + src/video-driver.cpp | 26 ++++++++++---- src/video-driver.h | 6 +--- 19 files changed, 124 insertions(+), 303 deletions(-) delete mode 100644 irrlicht/device.scm delete mode 100644 irrlicht/gui.scm delete mode 100644 irrlicht/irr.scm delete mode 100644 irrlicht/scene.scm delete mode 100644 irrlicht/video.scm diff --git a/Makefile.am b/Makefile.am index e1d88a1..08a5f1d 100644 --- a/Makefile.am +++ b/Makefile.am @@ -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 diff --git a/irrlicht.scm b/irrlicht.scm index 57ecbbc..14e4457 100644 --- a/irrlicht.scm +++ b/irrlicht.scm @@ -20,17 +20,4 @@ (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 index 58d2127..0000000 --- a/irrlicht/device.scm +++ /dev/null @@ -1,46 +0,0 @@ -;;; guile-irrlicht --- FFI bindings for Irrlicht Engine -;;; Copyright (C) 2019 Javier Sancho -;;; -;;; 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 -;;; . - - -(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 index 2299574..0000000 --- a/irrlicht/gui.scm +++ /dev/null @@ -1,41 +0,0 @@ -;;; guile-irrlicht --- FFI bindings for Irrlicht Engine -;;; Copyright (C) 2019 Javier Sancho -;;; -;;; 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 -;;; . - - -(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 index 9b89142..0000000 --- a/irrlicht/irr.scm +++ /dev/null @@ -1,24 +0,0 @@ -;;; guile-irrlicht --- FFI bindings for Irrlicht Engine -;;; Copyright (C) 2019 Javier Sancho -;;; -;;; 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 -;;; . - - -(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 index 115d2e8..0000000 --- a/irrlicht/scene.scm +++ /dev/null @@ -1,62 +0,0 @@ -;;; guile-irrlicht --- FFI bindings for Irrlicht Engine -;;; Copyright (C) 2019 Javier Sancho -;;; -;;; 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 -;;; . - - -(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 index 9999595..0000000 --- a/irrlicht/video.scm +++ /dev/null @@ -1,40 +0,0 @@ -;;; guile-irrlicht --- FFI bindings for Irrlicht Engine -;;; Copyright (C) 2020 Javier Sancho -;;; -;;; 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 -;;; . - - -(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)) diff --git a/src/animated-mesh-scene-node.cpp b/src/animated-mesh-scene-node.cpp index 87fac47..ceb5ec2 100644 --- a/src/animated-mesh-scene-node.cpp +++ b/src/animated-mesh-scene-node.cpp @@ -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", diff --git a/src/device.cpp b/src/device.cpp index a02cd05..3b5b9b9 100644 --- a/src/device.cpp +++ b/src/device.cpp @@ -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), diff --git a/src/device.h b/src/device.h index 5422b1f..31195c6 100644 --- a/src/device.h +++ b/src/device.h @@ -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); diff --git a/src/gui-environment.cpp b/src/gui-environment.cpp index ca59a31..fb13f53 100644 --- a/src/gui-environment.cpp +++ b/src/gui-environment.cpp @@ -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); } diff --git a/src/gui-environment.h b/src/gui-environment.h index caac2ee..dd3f597 100644 --- a/src/gui-environment.h +++ b/src/gui-environment.h @@ -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); } diff --git a/src/material-flags.cpp b/src/material-flags.cpp index d700e4c..90aa64e 100644 --- a/src/material-flags.cpp +++ b/src/material-flags.cpp @@ -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 diff --git a/src/reference-counted.cpp b/src/reference-counted.cpp index 58878d3..eabc3ef 100644 --- a/src/reference-counted.cpp +++ b/src/reference-counted.cpp @@ -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 diff --git a/src/scene-manager.cpp b/src/scene-manager.cpp index 3c080d5..cb7f80c 100644 --- a/src/scene-manager.cpp +++ b/src/scene-manager.cpp @@ -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), diff --git a/src/scene-manager.h b/src/scene-manager.h index aa5d442..f65548e 100644 --- a/src/scene-manager.h +++ b/src/scene-manager.h @@ -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, diff --git a/src/scene-node.cpp b/src/scene-node.cpp index 16ddbf6..859fbc8 100644 --- a/src/scene-node.cpp +++ b/src/scene-node.cpp @@ -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", diff --git a/src/video-driver.cpp b/src/video-driver.cpp index dc9cce6..57231a6 100644 --- a/src/video-driver.cpp +++ b/src/video-driver.cpp @@ -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* sourceRectAddress = 0; if (!scm_is_false (source_rect)) diff --git a/src/video-driver.h b/src/video-driver.h index 65df39a..64bf068 100644 --- a/src/video-driver.h +++ b/src/video-driver.h @@ -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, -- 2.39.2