#include "animated-mesh-md2.h"
#include "animated-mesh-scene-node.h"
+#include "gsubr.h"
#include "wrapped.h"
extern "C" {
init_animated_mesh_scene_node (void)
{
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_GSUBR ("set-md2-animation!", 2, 0, 0, irr_scene_setMD2Animation);
}
DEFINE_WRAPPED_TYPE (irr::scene::IAnimatedMeshSceneNode*, "animated-mesh-scene-node",
#include <irrlicht/irrlicht.h>
#include <libguile.h>
#include "box3d.h"
+#include "gsubr.h"
#include "vector3d.h"
#include "wrapped.h"
init_box3d (void)
{
init_box3d_type ();
- scm_c_define_gsubr ("box3d-add-internal-point!", 2, 0, 0, (scm_t_subr)box3d_add_internal_point);
- scm_c_define_gsubr ("box3d-reset!", 2, 0, 0, (scm_t_subr)box3d_reset);
- scm_c_define_gsubr ("make-box3d", 0, 0, 0, (scm_t_subr)make_box3d);
- scm_c_export ("box3d-add-internal-point!", "box3d-reset!", "make-box3d", NULL);
+ DEFINE_GSUBR ("box3d-add-internal-point!", 2, 0, 0, box3d_add_internal_point);
+ DEFINE_GSUBR ("box3d-reset!", 2, 0, 0, box3d_reset);
+ DEFINE_GSUBR ("make-box3d", 0, 0, 0, make_box3d);
}
DEFINE_WRAPPED_TYPE (irr::core::aabbox3df*, "box3d",
#include "cursor-control.h"
#include "device.h"
+#include "gsubr.h"
#include "position2d.h"
#include "wrapped.h"
init_cursor_control (void)
{
init_cursor_control_type ();
- scm_c_define_gsubr ("get-cursor-control", 1, 0, 0, (scm_t_subr)irr_getCursorControl);
- scm_c_export ("get-cursor-control", NULL);
+ DEFINE_GSUBR ("get-cursor-control", 1, 0, 0, irr_getCursorControl);
}
DEFINE_WRAPPED_TYPE (irr::gui::ICursorControl*, "cursor-control",
#include "dimension2d.h"
#include "driver-types.h"
#include "event-receiver.h"
+#include "gsubr.h"
#include "wchar.h"
#include "wrapped.h"
init_device (void)
{
init_device_type ();
- scm_c_define_gsubr ("create-device", 0, 0, 1, (scm_t_subr)irr_createDevice);
- scm_c_define_gsubr ("is-window-active?", 1, 0, 0, (scm_t_subr)irr_isWindowActive);
- 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_define_gsubr ("yield", 1, 0, 0, (scm_t_subr)irr_yield);
- scm_c_export ("create-device", "is-window-active?", "run",
- "set-window-caption!", "yield", NULL);
+ DEFINE_GSUBR ("create-device", 0, 0, 1, irr_createDevice);
+ DEFINE_GSUBR ("is-window-active?", 1, 0, 0, irr_isWindowActive);
+ DEFINE_GSUBR ("run", 1, 0, 0, irr_run);
+ DEFINE_GSUBR ("set-window-caption!", 2, 0, 0, irr_setWindowCaption);
+ DEFINE_GSUBR ("yield", 1, 0, 0, irr_yield);
}
DEFINE_WRAPPED_TYPE (irr::IrrlichtDevice*, "device",
#include <irrlicht/irrlicht.h>
#include <libguile.h>
#include "event-receiver.h"
+#include "gsubr.h"
#include "wrapped.h"
extern "C" {
{
init_event_receiver_type ();
init_event_type ();
- scm_c_define_gsubr ("event-type", 1, 0, 0, (scm_t_subr)event_type);
- scm_c_define_gsubr ("make-event-receiver", 1, 0, 0, (scm_t_subr)make_event_receiver);
- scm_c_export ("event-type", "make-event-receiver", NULL);
+ DEFINE_GSUBR ("event-type", 1, 0, 0, event_type);
+ DEFINE_GSUBR ("make-event-receiver", 1, 0, 0, make_event_receiver);
}
DEFINE_WRAPPED_TYPE (irr::IEventReceiver*, "event-receiver",
#include "device.h"
#include "file-archive.h"
#include "file-system.h"
+#include "gsubr.h"
#include "gui-environment.h"
#include "scene-manager.h"
init_file_system (void)
{
init_file_system_type ();
- scm_c_define_gsubr ("add-file-archive!", 2, 0, 1, (scm_t_subr)irr_io_addFileArchive);
- scm_c_define_gsubr ("get-file-system", 1, 0, 0, (scm_t_subr)irr_getFileSystem);
- scm_c_export ("add-file-archive!", "get-file-system", NULL);
+ DEFINE_GSUBR ("add-file-archive!", 2, 0, 1, irr_io_addFileArchive);
+ DEFINE_GSUBR ("get-file-system", 1, 0, 0, irr_getFileSystem);
}
DEFINE_WRAPPED_TYPE (irr::io::IFileSystem*, "file-system",
--- /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_GSUBR_H_INCLUDED__
+#define __GUILE_IRRLICHT_GSUBR_H_INCLUDED__
+
+#include <libguile.h>
+
+#define DEFINE_GSUBR(NAME, REQ, OPT, REST, FUNC) \
+ scm_c_define_gsubr (NAME, REQ, OPT, REST, (scm_t_subr)FUNC); \
+ scm_c_export (NAME, NULL);
+
+#endif
#include <libguile.h>
#include "device.h"
+#include "gsubr.h"
#include "gui-element.h"
#include "gui-environment.h"
#include "gui-static-text.h"
init_gui_environment (void)
{
init_gui_environment_type ();
- 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_GSUBR ("add-static-text!", 3, 0, 1, irr_gui_addStaticText);
+ DEFINE_GSUBR ("get-gui-environment", 1, 0, 0, irr_getGUIEnvironment);
}
DEFINE_WRAPPED_TYPE (irr::gui::IGUIEnvironment*, "gui-environment",
#include "event-receiver.h"
#include "file-archive.h"
#include "file-system.h"
+#include "gsubr.h"
#include "gui-element.h"
#include "gui-environment.h"
#include "gui-static-text.h"
init_video_driver ();
// Shared procedures (used by two or more objects)
- scm_c_define_gsubr ("draw-all", 1, 0, 0, (scm_t_subr)irr_drawAll);
- scm_c_define_gsubr ("get-name", 1, 0, 0, (scm_t_subr)irr_getName);
- scm_c_define_gsubr ("set-material!", 2, 0, 0, (scm_t_subr)irr_setMaterial);
- scm_c_define_gsubr ("set-material-flag!", 3, 0, 0, (scm_t_subr)irr_setMaterialFlag);
- scm_c_define_gsubr ("set-position!", 2, 0, 0, (scm_t_subr)irr_setPosition);
- scm_c_define_gsubr ("set-visible!", 2, 0, 0, (scm_t_subr)irr_setVisible);
- scm_c_export ("draw-all", "get-name", "set-material!", "set-material-flag!",
- "set-position!", "set-visible!", NULL);
+ DEFINE_GSUBR ("draw-all", 1, 0, 0, irr_drawAll);
+ DEFINE_GSUBR ("get-name", 1, 0, 0, irr_getName);
+ DEFINE_GSUBR ("set-material!", 2, 0, 0, irr_setMaterial);
+ DEFINE_GSUBR ("set-material-flag!", 3, 0, 0, irr_setMaterialFlag);
+ DEFINE_GSUBR ("set-position!", 2, 0, 0, irr_setPosition);
+ DEFINE_GSUBR ("set-visible!", 2, 0, 0, irr_setVisible);
}
SCM
#include <libguile.h>
#include "color.h"
+#include "gsubr.h"
#include "material.h"
#include "material-types.h"
#include "wrapped.h"
init_material (void)
{
init_material_type ();
- scm_c_define_gsubr ("make-material", 0, 0, 1, (scm_t_subr)make_material);
- scm_c_export ("make-material", NULL);
+ DEFINE_GSUBR ("make-material", 0, 0, 1, make_material);
}
DEFINE_WRAPPED_TYPE (irr::video::SMaterial*, "material",
#include <libguile.h>
#include "device.h"
+#include "gsubr.h"
#include "reference-counted.h"
#include "scene-node-animator.h"
void
init_reference_counted (void)
{
- scm_c_define_gsubr ("drop!", 1, 0, 0, (scm_t_subr)irr_drop);
- scm_c_export ("drop!", NULL);
+ DEFINE_GSUBR ("drop!", 1, 0, 0, irr_drop);
}
SCM
#include "box3d.h"
#include "camera-scene-node.h"
#include "device.h"
+#include "gsubr.h"
#include "keymap.h"
#include "material.h"
#include "mesh.h"
init_scene_manager (void)
{
init_scene_manager_type ();
- 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!", 1, 0, 1,
- (scm_t_subr)irr_scene_addCameraSceneNode);
- scm_c_define_gsubr ("add-camera-scene-node-fps!", 1, 0, 1,
- (scm_t_subr)irr_scene_addCameraSceneNodeFPS);
- scm_c_define_gsubr ("add-cube-scene-node!", 1, 0, 1,
- (scm_t_subr)irr_scene_addCubeSceneNode);
- scm_c_define_gsubr ("add-custom-scene-node!", 5, 0, 1,
- (scm_t_subr)irr_scene_addCustomSceneNode);
- scm_c_define_gsubr ("add-octree-scene-node!", 2, 0, 1,
- (scm_t_subr)irr_scene_addOctreeSceneNode);
- scm_c_define_gsubr ("add-sphere-scene-node!", 1, 0, 1,
- (scm_t_subr)irr_scene_addSphereSceneNode);
- scm_c_define_gsubr ("create-fly-circle-animator", 1, 0, 1,
- (scm_t_subr)irr_scene_createFlyCircleAnimator);
- scm_c_define_gsubr ("create-fly-straight-animator", 4, 0, 1,
- (scm_t_subr)irr_scene_createFlyStraightAnimator);
- scm_c_define_gsubr ("create-rotation-animator", 2, 0, 0,
- (scm_t_subr)irr_scene_createRotationAnimator);
- scm_c_define_gsubr ("get-mesh", 2, 0, 0, (scm_t_subr)irr_scene_getMesh);
- scm_c_define_gsubr ("get-root-scene-node", 1, 0, 0, (scm_t_subr)irr_scene_getRootSceneNode);
- 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!",
- "add-camera-scene-node-fps!", "add-custom-scene-node!", "add-cube-scene-node!",
- "add-octree-scene-node!", "add-sphere-scene-node!", "create-fly-circle-animator",
- "create-fly-straight-animator", "create-rotation-animator", "get-mesh",
- "get-root-scene-node", "get-scene-manager", NULL);
+ DEFINE_GSUBR ("add-animated-mesh-scene-node!", 2, 0, 1, irr_scene_addAnimatedMeshSceneNode);
+ DEFINE_GSUBR ("add-camera-scene-node!", 1, 0, 1, irr_scene_addCameraSceneNode);
+ DEFINE_GSUBR ("add-camera-scene-node-fps!", 1, 0, 1, irr_scene_addCameraSceneNodeFPS);
+ DEFINE_GSUBR ("add-cube-scene-node!", 1, 0, 1, irr_scene_addCubeSceneNode);
+ DEFINE_GSUBR ("add-custom-scene-node!", 5, 0, 1, irr_scene_addCustomSceneNode);
+ DEFINE_GSUBR ("add-octree-scene-node!", 2, 0, 1, irr_scene_addOctreeSceneNode);
+ DEFINE_GSUBR ("add-sphere-scene-node!", 1, 0, 1, irr_scene_addSphereSceneNode);
+ DEFINE_GSUBR ("create-fly-circle-animator", 1, 0, 1, irr_scene_createFlyCircleAnimator);
+ DEFINE_GSUBR ("create-fly-straight-animator", 4, 0, 1, irr_scene_createFlyStraightAnimator);
+ DEFINE_GSUBR ("create-rotation-animator", 2, 0, 0, irr_scene_createRotationAnimator);
+ DEFINE_GSUBR ("get-mesh", 2, 0, 0, irr_scene_getMesh);
+ DEFINE_GSUBR ("get-root-scene-node", 1, 0, 0, irr_scene_getRootSceneNode);
+ DEFINE_GSUBR ("get-scene-manager", 1, 0, 0, irr_getSceneManager);
}
DEFINE_WRAPPED_TYPE (irr::scene::ISceneManager*, "scene-manager",
#include <libguile.h>
#include "animated-mesh-scene-node.h"
+#include "gsubr.h"
#include "material-flags.h"
#include "matrix4.h"
#include "mesh-scene-node.h"
init_scene_node (void)
{
init_scene_node_type ();
- scm_c_define_gsubr ("add-animator!", 2, 0, 0, (scm_t_subr)irr_scene_addAnimator);
- scm_c_define_gsubr ("get-absolute-transformation", 1, 0, 0,
- (scm_t_subr)irr_scene_getAbsoluteTransformation);
- scm_c_define_gsubr ("set-material-texture!", 3, 0, 0, (scm_t_subr)irr_scene_setMaterialTexture);
- scm_c_export ("add-animator!", "get-absolute-transformation",
- "set-material-texture!", NULL);
+ DEFINE_GSUBR ("add-animator!", 2, 0, 0, irr_scene_addAnimator);
+ DEFINE_GSUBR ("get-absolute-transformation", 1, 0, 0, irr_scene_getAbsoluteTransformation);
+ DEFINE_GSUBR ("set-material-texture!", 3, 0, 0, irr_scene_setMaterialTexture);
}
DEFINE_WRAPPED_TYPE (irr::scene::ISceneNode*, "scene-node",
#include <irrlicht/irrlicht.h>
#include <libguile.h>
+
#include "color.h"
+#include "gsubr.h"
#include "vector2d.h"
#include "vector3d.h"
#include "vertex3d.h"
init_vertex3d (void)
{
init_vertex3d_type ();
- scm_c_define_gsubr ("make-vertex3d", 4, 0, 0, (scm_t_subr)make_vertex3d);
- scm_c_define_gsubr ("vertex3d-position", 1, 0, 0, (scm_t_subr)vertex3d_position);
- scm_c_export ("make-vertex3d", "vertex3d-position", NULL);
+ DEFINE_GSUBR ("make-vertex3d", 4, 0, 0, make_vertex3d);
+ DEFINE_GSUBR ("vertex3d-position", 1, 0, 0, vertex3d_position);
}
DEFINE_WRAPPED_TYPE (irr::video::S3DVertex*, "vertex3d",
#include "color.h"
#include "device.h"
+#include "gsubr.h"
#include "gui-environment.h"
#include "material.h"
#include "matrix4.h"
init_video_driver (void)
{
init_video_driver_type ();
- scm_c_define_gsubr ("begin-scene", 1, 0, 1, (scm_t_subr)irr_video_beginScene);
- scm_c_define_gsubr ("draw-vertex-primitive-list", 3, 0, 1,
- (scm_t_subr)irr_video_drawVertexPrimitiveList);
- scm_c_define_gsubr ("end-scene", 1, 0, 0, (scm_t_subr)irr_video_endScene);
- scm_c_define_gsubr ("get-fps", 1, 0, 0, (scm_t_subr)irr_video_getFPS);
- 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_define_gsubr ("set-transform!", 3, 0, 0, (scm_t_subr)irr_video_setTransform);
- scm_c_export ("begin-scene", "draw-vertex-primitive-list", "end-scene", "get-fps",
- "get-texture", "get-video-driver", "set-transform!", NULL);
+ DEFINE_GSUBR ("begin-scene", 1, 0, 1, irr_video_beginScene);
+ DEFINE_GSUBR ("draw-vertex-primitive-list", 3, 0, 1, irr_video_drawVertexPrimitiveList);
+ DEFINE_GSUBR ("end-scene", 1, 0, 0, irr_video_endScene);
+ DEFINE_GSUBR ("get-fps", 1, 0, 0, irr_video_getFPS);
+ DEFINE_GSUBR ("get-texture", 2, 0, 0, irr_video_getTexture);
+ DEFINE_GSUBR ("get-video-driver", 1, 0, 0, irr_getVideoDriver);
+ DEFINE_GSUBR ("set-transform!", 3, 0, 0, irr_video_setTransform);
}
DEFINE_WRAPPED_TYPE (irr::video::IVideoDriver*, "video-driver",