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
(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")
+++ /dev/null
-;;; 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))
+++ /dev/null
-;;; 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))
+++ /dev/null
-;;; 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")
+++ /dev/null
-;;; 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))
+++ /dev/null
-;;; 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))
{
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",
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",
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),
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);
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",
}
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);
}
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);
}
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
init_reference_counted (void)
{
scm_c_define_gsubr ("drop!", 1, 0, 0, (scm_t_subr)irr_drop);
+ scm_c_export ("drop!", NULL);
}
SCM
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",
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),
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),
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,
{
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",
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",
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))
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,