#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;
+ }
+
}