src/reference-counted.cpp \
src/scene-manager.cpp \
src/scene-node.cpp \
+ src/texture.cpp \
src/vector3d.cpp \
src/video-driver.cpp \
src/wchar.cpp
irrlicht/device.scm \
irrlicht/gui.scm \
irrlicht/irr.scm \
- irrlicht/scene.scm
+ irrlicht/scene.scm \
+ irrlicht/video.scm
'((irrlicht device)
(irrlicht gui)
(irrlicht irr)
- (irrlicht scene)))
+ (irrlicht scene)
+ (irrlicht video)))
(current-interface
(module-public-interface (current-module))))
(for-each
#:export (add-animated-mesh-scene-node
get-mesh
set-material-flag!
+ set-material-texture!
set-md2-animation!))
(load-extension "libguile-irrlicht" "init_guile_irrlicht")
--- /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 (get-texture))
+
+(load-extension "libguile-irrlicht" "init_guile_irrlicht")
#include "reference-counted.h"
#include "scene-manager.h"
#include "scene-node.h"
+#include "texture.h"
#include "video-driver.h"
extern "C" {
init_reference_counted ();
init_scene_manager ();
init_scene_node ();
+ init_texture ();
init_video_driver ();
}
#include <irrlicht/irrlicht.h>
#include <libguile.h>
+#include "animated-mesh-scene-node.h"
#include "scene-node.h"
+#include "texture.h"
#include "wrapped.h"
extern "C" {
init_scene_node (void)
{
init_scene_node_type ();
+ scm_c_define_gsubr ("set-material-texture!", 3, 0, 0, (scm_t_subr)irr_scene_setMaterialTexture);
}
DEFINE_WRAPPED_TYPE (irr::scene::ISceneNode*, "scene-node",
init_scene_node_type, scene_node_p,
wrap_scene_node, unwrap_scene_node);
+ SCM
+ irr_scene_setMaterialTexture (SCM wrapped_scene_node,
+ SCM texture_layer,
+ SCM texture)
+ {
+ if (animated_mesh_scene_node_p (wrapped_scene_node))
+ {
+ unwrap_animated_mesh_scene_node (wrapped_scene_node)->
+ setMaterialTexture (scm_to_uint32 (texture_layer),
+ unwrap_texture (texture));
+ }
+ else if (scene_node_p (wrapped_scene_node))
+ {
+ unwrap_scene_node (wrapped_scene_node)->
+ setMaterialTexture (scm_to_uint32 (texture_layer),
+ unwrap_texture (texture));
+ }
+ else
+ {
+ scm_error (scm_arg_type_key, NULL, "Cannot set material texture to object: ~S",
+ scm_list_1 (wrapped_scene_node), scm_list_1 (wrapped_scene_node));
+ }
+ return SCM_UNSPECIFIED;
+ }
+
}
DECLARE_WRAPPED_TYPE (irr::scene::ISceneNode*, init_scene_node_type,
scene_node_p, wrap_scene_node, unwrap_scene_node);
+
+ SCM
+ irr_scene_setMaterialTexture (SCM wrapped_scene_node,
+ SCM texture_layer,
+ SCM texture);
+
}
#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 "texture.h"
+
+extern "C" {
+
+ void
+ init_texture (void)
+ {
+ init_texture_type ();
+ }
+
+ DEFINE_WRAPPED_TYPE (irr::video::ITexture*, "texture",
+ init_texture_type, texture_p,
+ wrap_texture, unwrap_texture);
+
+}
--- /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_TEXTURE_H_INCLUDED__
+#define __GUILE_IRRLICHT_TEXTURE_H_INCLUDED__
+
+#include <irrlicht/irrlicht.h>
+#include <libguile.h>
+#include "wrapped.h"
+
+extern "C" {
+
+ void
+ init_texture (void);
+
+ DECLARE_WRAPPED_TYPE (irr::video::ITexture*, init_texture_type,
+ texture_p, wrap_texture, unwrap_texture);
+
+}
+
+#endif
#include <libguile.h>
#include "device.h"
+#include "texture.h"
#include "video-driver.h"
#include "wrapped.h"
init_video_driver (void)
{
init_video_driver_type ();
+ 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);
}
init_video_driver_type, video_driver_p,
wrap_video_driver, unwrap_video_driver);
+ SCM
+ irr_video_getTexture (SCM wrapped_video_driver,
+ SCM filename)
+ {
+ irr::video::IVideoDriver* driver = unwrap_video_driver (wrapped_video_driver);
+ irr::video::ITexture* texture = driver->getTexture (scm_to_utf8_stringn (filename, NULL));
+ return wrap_texture (texture);
+ }
+
SCM
irr_getVideoDriver (SCM wrapped_obj)
{
DECLARE_WRAPPED_TYPE (irr::video::IVideoDriver*, init_video_driver_type,
video_driver_p, wrap_video_driver, unwrap_video_driver);
+ SCM
+ irr_video_getTexture (SCM wrapped_video_driver,
+ SCM filename);
+
SCM
irr_getVideoDriver (SCM wrapped_obj);