src/dimension2d.cpp \
src/EDriverTypes.cpp \
src/GuileIrrlicht.cpp \
+ src/IAnimatedMesh.cpp \
+ src/IAnimatedMeshSceneNode.cpp \
src/IGUIElement.cpp \
src/IGUIEnvironment.cpp \
src/IGUIStaticText.cpp \
src/IrrlichtDevice.cpp \
src/ISceneManager.cpp \
+ src/ISceneNode.cpp \
src/IVideoDriver.cpp \
src/rect.cpp \
- src/util.cpp
+ src/util.cpp \
+ src/vector3d.cpp
libguile_irrlicht_la_CPPFLAGS = @GUILE_CFLAGS@
libguile_irrlicht_la_LDFLAGS = \
-version-info 0:1 \
;; load public symbols into current module
(let ((public-modules
'((irrlicht device)
- (irrlicht gui)))
+ (irrlicht gui)
+ (irrlicht scene)))
(current-interface
(module-public-interface (current-module))))
(for-each
(define-module (irrlicht device)
#:export (create-device
+ device-drop!
get-gui-environment
get-scene-manager
get-video-driver
--- /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-animated-mesh-scene-node
+ get-mesh))
+
+(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))
*/
#include <libguile.h>
+#include "IAnimatedMesh.h"
+#include "IAnimatedMeshSceneNode.h"
#include "IGUIElement.h"
#include "IGUIEnvironment.h"
#include "IGUIStaticText.h"
#include "IrrlichtDevice.h"
#include "ISceneManager.h"
+#include "ISceneNode.h"
#include "IVideoDriver.h"
extern "C" {
void
init_guile_irrlicht (void)
{
+ init_animated_mesh ();
+ init_animated_mesh_scene_node ();
init_device ();
init_gui_element ();
init_gui_environment ();
init_gui_static_text ();
init_scene_manager ();
+ init_scene_node ();
init_video_driver ();
}
--- /dev/null
+/* guile-irrlicht --- GNU Guile 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/>.
+*/
+
+#include <irrlicht/irrlicht.h>
+#include <libguile.h>
+#include "IAnimatedMesh.h"
+#include "util.h"
+
+extern "C" {
+
+ void
+ init_animated_mesh (void)
+ {
+ init_animated_mesh_type ();
+ }
+
+ DEFINE_WRAPPED_TYPE (irr::scene::IAnimatedMesh*, "animated-mesh",
+ init_animated_mesh_type,
+ wrap_animated_mesh, unwrap_animated_mesh);
+
+}
--- /dev/null
+/* guile-irrlicht --- GNU Guile 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/>.
+*/
+
+#ifndef __GUILE_I_ANIMATED_MESH_INCLUDED__
+#define __GUILE_I_ANIMATED_MESH_INCLUDED__
+
+#include <irrlicht/irrlicht.h>
+#include <libguile.h>
+#include "util.h"
+
+extern "C" {
+
+ void
+ init_animated_mesh (void);
+
+ DECLARE_WRAPPED_TYPE (irr::scene::IAnimatedMesh*, init_animated_mesh_type,
+ wrap_animated_mesh, unwrap_animated_mesh);
+}
+
+#endif
--- /dev/null
+/* guile-irrlicht --- GNU Guile 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/>.
+*/
+
+#include <irrlicht/irrlicht.h>
+#include <libguile.h>
+#include "IAnimatedMeshSceneNode.h"
+#include "util.h"
+
+extern "C" {
+
+ void
+ init_animated_mesh_scene_node (void)
+ {
+ init_animated_mesh_scene_node_type ();
+ }
+
+ DEFINE_WRAPPED_TYPE (irr::scene::IAnimatedMeshSceneNode*, "animated-mesh-scene-node",
+ init_animated_mesh_scene_node_type,
+ wrap_animated_mesh_scene_node, unwrap_animated_mesh_scene_node);
+
+}
--- /dev/null
+/* guile-irrlicht --- GNU Guile 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/>.
+*/
+
+#ifndef __GUILE_I_ANIMATED_MESH_SCENE_NODE_INCLUDED__
+#define __GUILE_I_ANIMATED_MESH_SCENE_NODE_INCLUDED__
+
+#include <irrlicht/irrlicht.h>
+#include <libguile.h>
+#include "util.h"
+
+extern "C" {
+
+ void
+ init_animated_mesh_scene_node (void);
+
+ DECLARE_WRAPPED_TYPE (irr::scene::IAnimatedMeshSceneNode*, init_animated_mesh_scene_node_type,
+ wrap_animated_mesh_scene_node, unwrap_animated_mesh_scene_node);
+}
+
+#endif
#include <irrlicht/irrlicht.h>
#include <libguile.h>
+#include "IAnimatedMesh.h"
+#include "IAnimatedMeshSceneNode.h"
#include "ISceneManager.h"
+#include "ISceneNode.h"
#include "util.h"
+#include "vector3d.h"
extern "C" {
init_scene_manager (void)
{
init_scene_manager_type ();
+ scm_c_define_gsubr ("add-animated-mesh-scene-node", 8, 0, 0,
+ (scm_t_subr)irr_scene_addAnimatedMeshSceneNode);
+ scm_c_define_gsubr ("get-mesh", 2, 0, 0, (scm_t_subr)irr_scene_getMesh);
}
DEFINE_WRAPPED_TYPE (irr::scene::ISceneManager*, "scene-manager",
init_scene_manager_type,
wrap_scene_manager, unwrap_scene_manager);
+ SCM
+ irr_scene_addAnimatedMeshSceneNode (SCM wrapped_scene_manager,
+ SCM mesh,
+ SCM parent,
+ SCM id,
+ SCM position,
+ SCM rotation,
+ SCM scale,
+ SCM alsoAddIfMeshPointerZero)
+ {
+ irr::scene::ISceneManager* smgr = unwrap_scene_manager (wrapped_scene_manager);
+ irr::scene::IAnimatedMeshSceneNode* node =
+ smgr->addAnimatedMeshSceneNode (unwrap_animated_mesh (mesh),
+ scm_is_false (parent) ? 0 : unwrap_scene_node (parent),
+ scm_to_int32 (id),
+ scm_to_vector3df (position),
+ scm_to_vector3df (rotation),
+ scm_to_vector3df (scale),
+ scm_to_bool (alsoAddIfMeshPointerZero));
+ return wrap_animated_mesh_scene_node (node);
+ }
+
+ SCM
+ irr_scene_getMesh (SCM wrapped_scene_manager,
+ SCM filename)
+ {
+ irr::scene::ISceneManager* smgr = unwrap_scene_manager (wrapped_scene_manager);
+ irr::scene::IAnimatedMesh* mesh = smgr->getMesh(scm_to_utf8_stringn (filename, NULL));
+ return wrap_animated_mesh (mesh);
+ }
+
}
DECLARE_WRAPPED_TYPE (irr::scene::ISceneManager*, init_scene_manager_type,
wrap_scene_manager, unwrap_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
+ irr_scene_getMesh (SCM wrapped_scene_manager,
+ SCM filename);
+
}
#endif
--- /dev/null
+/* guile-irrlicht --- GNU Guile 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/>.
+*/
+
+#include <irrlicht/irrlicht.h>
+#include <libguile.h>
+#include "ISceneNode.h"
+#include "util.h"
+
+extern "C" {
+
+ void
+ init_scene_node (void)
+ {
+ init_scene_node_type ();
+ }
+
+ DEFINE_WRAPPED_TYPE (irr::scene::ISceneNode*, "scene-node",
+ init_scene_node_type,
+ wrap_scene_node, unwrap_scene_node);
+
+}
--- /dev/null
+/* guile-irrlicht --- GNU Guile 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/>.
+*/
+
+#ifndef __GUILE_I_SCENE_NODE_INCLUDED__
+#define __GUILE_I_SCENE_NODE_INCLUDED__
+
+#include <irrlicht/irrlicht.h>
+#include <libguile.h>
+#include "util.h"
+
+extern "C" {
+
+ void
+ init_scene_node (void);
+
+ DECLARE_WRAPPED_TYPE (irr::scene::ISceneNode*, init_scene_node_type,
+ wrap_scene_node, unwrap_scene_node);
+}
+
+#endif
{
init_device_type ();
scm_c_define_gsubr ("create-device", 7, 0, 0, (scm_t_subr)irr_createDevice);
+ scm_c_define_gsubr ("device-drop!", 1, 0, 0, (scm_t_subr)irr_deviceDrop);
scm_c_define_gsubr ("get-gui-environment", 1, 0, 0, (scm_t_subr)irr_getGUIEnvironment);
scm_c_define_gsubr ("get-scene-manager", 1, 0, 0, (scm_t_subr)irr_getSceneManager);
scm_c_define_gsubr ("get-video-driver", 1, 0, 0, (scm_t_subr)irr_getVideoDriver);
}
SCM
- irr_getGUIEnvironment (SCM device_obj)
+ irr_deviceDrop (SCM wrapped_device)
{
- irr::IrrlichtDevice* device = unwrap_device (device_obj);
- irr::gui::IGUIEnvironment* gui_environment = device->getGUIEnvironment();
+ irr::IrrlichtDevice* device = unwrap_device (wrapped_device);
+ return scm_from_bool (device->drop ());
+ }
+
+ SCM
+ irr_getGUIEnvironment (SCM wrapped_device)
+ {
+ irr::IrrlichtDevice* device = unwrap_device (wrapped_device);
+ irr::gui::IGUIEnvironment* gui_environment = device->getGUIEnvironment ();
return wrap_gui_environment (gui_environment);
}
SCM
- irr_getSceneManager (SCM device_obj)
+ irr_getSceneManager (SCM wrapped_device)
{
- irr::IrrlichtDevice* device = unwrap_device (device_obj);
- irr::scene::ISceneManager* scene_manager = device->getSceneManager();
+ irr::IrrlichtDevice* device = unwrap_device (wrapped_device);
+ irr::scene::ISceneManager* scene_manager = device->getSceneManager ();
return wrap_scene_manager (scene_manager);
}
SCM
- irr_getVideoDriver (SCM device_obj)
+ irr_getVideoDriver (SCM wrapped_device)
{
- irr::IrrlichtDevice* device = unwrap_device (device_obj);
- irr::video::IVideoDriver* driver = device->getVideoDriver();
+ irr::IrrlichtDevice* device = unwrap_device (wrapped_device);
+ irr::video::IVideoDriver* driver = device->getVideoDriver ();
return wrap_video_driver (driver);
}
SCM
- irr_setWindowCaption (SCM device_obj,
+ irr_setWindowCaption (SCM wrapped_device,
SCM text)
{
- irr::IrrlichtDevice* device = unwrap_device (device_obj);
+ irr::IrrlichtDevice* device = unwrap_device (wrapped_device);
device->setWindowCaption (scm_to_wide_char_string (text));
return SCM_UNSPECIFIED;
}
SCM receiver);
SCM
- irr_getGUIEnvironment (SCM device_obj);
+ irr_deviceDrop (SCM wrapped_device);
SCM
- irr_getSceneManager (SCM device_obj);
+ irr_getGUIEnvironment (SCM wrapped_device);
SCM
- irr_getVideoDriver (SCM device_obj);
+ irr_getSceneManager (SCM wrapped_device);
SCM
- irr_setWindowCaption (SCM device,
+ irr_getVideoDriver (SCM wrapped_device);
+
+ SCM
+ irr_setWindowCaption (SCM wrapped_device,
SCM text);
}
--- /dev/null
+/* guile-irrlicht --- GNU Guile 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/>.
+*/
+
+#include <irrlicht/irrlicht.h>
+#include <libguile.h>
+#include "vector3d.h"
+
+extern "C" {
+
+ irr::core::vector3df
+ scm_to_vector3df (SCM vector3d)
+ {
+ return irr::core::vector3df
+ (scm_to_double (scm_car (vector3d)),
+ scm_to_double (scm_cadr (vector3d)),
+ scm_to_double (scm_caddr (vector3d)));
+ }
+
+}
--- /dev/null
+/* guile-irrlicht --- GNU Guile 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/>.
+*/
+
+#ifndef __GUILE_IRRLICHT_VECTOR_3D_INCLUDED__
+#define __GUILE_IRRLICHT_VECTOR_3D_INCLUDED__
+
+#include <irrlicht/irrlicht.h>
+#include <libguile.h>
+
+extern "C" {
+
+ irr::core::vector3df
+ scm_to_vector3df (SCM vector3d);
+
+}
+
+#endif