src/vector3d.cpp \
src/vertex3d.cpp \
src/video-driver.cpp \
- src/wchar.cpp
+ src/wchar.cpp \
+ src/wrapped.cpp
libguile_irrlicht_la_CPPFLAGS = @GUILE_CFLAGS@
libguile_irrlicht_la_LDFLAGS = \
-version-info 0:1 \
fullscreen
stencilbuffer
vsync
- (irr-pointer receiver))))
+ receiver)))
(define-method (get-gui-environment (device <irrlicht-device>))
- (make <gui-environment>
- #:irr-pointer ((get-irrlicht-proc "getGUIEnvironment" device) (irr-pointer device))))
+ (let ((getGUIEnvironment (get-irrlicht-proc "getGUIEnvironment" device)))
+ (make <gui-environment>
+ #:irr-pointer (getGUIEnvironment device))))
(define-method (get-scene-manager (device <irrlicht-device>))
(make <scene-manager>
- #:irr-pointer ((get-irrlicht-proc "getSceneManager" device) (irr-pointer device))))
+ #:irr-pointer ((get-irrlicht-proc "getSceneManager" device) device)))
(define-method (get-video-driver (device <irrlicht-device>))
(make <video-driver>
- #:irr-pointer ((get-irrlicht-proc "getVideoDriver" device) (irr-pointer device))))
+ #:irr-pointer ((get-irrlicht-proc "getVideoDriver" device) device)))
(define-method (run (device <irrlicht-device>))
- ((get-irrlicht-proc "run" device) (irr-pointer device)))
+ ((get-irrlicht-proc "run" device) device))
(define-method (set-window-caption! (device <irrlicht-device>) text)
((get-irrlicht-proc "setWindowCaption" device)
- (irr-pointer device) text))
+ device text))
(export create-device get-gui-environment get-scene-manager get-video-driver run
set-window-caption!)
(make <gui-static-text>
#:irr-pointer
((get-irrlicht-proc "addStaticText" gui-environment parent)
- (irr-pointer gui-environment)
+ gui-environment
text
rectangle
border
word-wrap
- (irr-pointer parent)
+ parent
id
fill-background))))
(define-method (draw-all (gui-environment <gui-environment>))
((get-irrlicht-proc "drawAll" gui-environment)
- (irr-pointer gui-environment)))
+ gui-environment))
(export <gui-environment> add-static-text! draw-all)
(irr-class #:init-value "IReferenceCounted" #:getter irr-class))
(define-method (drop! (obj <reference-counted>))
- ((get-irrlicht-proc "drop" obj)
- (irr-pointer obj)))
+ (let ((drop (get-irrlicht-proc "drop" obj)))
+ (drop obj)))
(export <reference-counted> drop!)
(make <animated-mesh-scene-node>
#:irr-pointer
((get-irrlicht-proc "addAnimatedMeshSceneNode" scene-manager parent)
- (irr-pointer scene-manager)
- (irr-pointer mesh)
- (irr-pointer parent)
+ scene-manager
+ mesh
+ parent
id
position
rotation
(make <camera-scene-node>
#:irr-pointer
((get-irrlicht-proc "addCameraSceneNode" scene-manager parent)
- (irr-pointer scene-manager)
- (irr-pointer parent)
+ scene-manager
+ parent
position
lookat
id
(define-method (draw-all (scene-manager <scene-manager>))
((get-irrlicht-proc "drawAll" scene-manager)
- (irr-pointer scene-manager)))
+ scene-manager))
(define-method (get-mesh (scene-manager <scene-manager>) filename)
(make <animated-mesh>
#:irr-pointer
((get-irrlicht-proc "getMesh" scene-manager)
- (irr-pointer scene-manager)
+ scene-manager
filename)))
(export <scene-manager> add-animated-mesh-scene-node! add-camera-scene-node! draw-all get-mesh)
(define-method (set-material-flag! (node <scene-node>) flag new-value)
((get-irrlicht-proc "setMaterialFlag" node)
- (irr-pointer node)
+ node
flag
new-value))
(define-method (set-material-texture! (node <scene-node>) texture-layer (texture <texture>))
((get-irrlicht-proc "setMaterialTexture" node)
- (irr-pointer node)
+ node
texture-layer
- (irr-pointer texture)))
+ texture))
(export <scene-node> set-material-flag! set-material-texture!)
(define-method (set-md2-animation! (node <animated-mesh-scene-node>) anim)
((get-irrlicht-proc "setMD2Animation" node)
- (irr-pointer node)
+ node
anim))
(export <animated-mesh-scene-node> set-md2-animation!)
video-data
source-rect)
((get-irrlicht-proc "beginScene" video-driver)
- (irr-pointer video-driver)
+ video-driver
back-buffer
z-buffer
color
(define-method (end-scene (video-driver <video-driver>))
((get-irrlicht-proc "endScene" video-driver)
- (irr-pointer video-driver)))
+ video-driver))
(define-method (get-texture (video-driver <video-driver>) filename)
(make <texture>
#:irr-pointer
((get-irrlicht-proc "getTexture" video-driver)
- (irr-pointer video-driver)
+ video-driver
filename)))
(export <video-driver> begin-scene end-scene get-texture)
#include "animated-mesh-md2.h"
#include "animated-mesh-scene-node.h"
#include "gsubr.h"
+#include "wrapped.h"
using namespace irr;
SCM end)
{
return scm_from_bool
- (((scene::IAnimatedMeshSceneNode*)scm_to_pointer (animated_mesh_scene_node))->
+ (((scene::IAnimatedMeshSceneNode*)scm_to_irr_pointer (animated_mesh_scene_node))->
setFrameLoop (scm_to_int32 (begin),
scm_to_int32 (end)));
}
SCM anim)
{
return scm_from_bool
- (((scene::IAnimatedMeshSceneNode*)scm_to_pointer (animated_mesh_scene_node))->
+ (((scene::IAnimatedMeshSceneNode*)scm_to_irr_pointer (animated_mesh_scene_node))->
setMD2Animation (scm_to_md2_animation_type (anim)));
}
#include <libguile.h>
#include "animated-mesh.h"
#include "gsubr.h"
+#include "wrapped.h"
using namespace irr;
IAnimatedMesh_setAnimationSpeed (SCM animated_mesh,
SCM frames_per_second)
{
- ((scene::IAnimatedMesh*)scm_to_pointer (animated_mesh))->
+ ((scene::IAnimatedMesh*)scm_to_irr_pointer (animated_mesh))->
setAnimationSpeed (scm_to_double (frames_per_second));
return SCM_UNSPECIFIED;
}
#include "box3d.h"
#include "gsubr.h"
#include "vector3d.h"
+#include "wrapped.h"
using namespace irr;
aabbox3d_addInternalPoint (SCM box3d,
SCM point)
{
- ((core::aabbox3df*)scm_to_pointer (box3d))->addInternalPoint (scm_to_vector3df (point));
+ ((core::aabbox3df*)scm_to_irr_pointer (box3d))->addInternalPoint (scm_to_vector3df (point));
return SCM_UNSPECIFIED;
}
aabbox3d_reset (SCM box3d,
SCM init_value)
{
- ((core::aabbox3df*)scm_to_pointer (box3d))->reset (scm_to_vector3df (init_value));
+ ((core::aabbox3df*)scm_to_irr_pointer (box3d))->reset (scm_to_vector3df (init_value));
return SCM_UNSPECIFIED;
}
#include "cursor-control.h"
#include "gsubr.h"
#include "position2d.h"
+#include "wrapped.h"
using namespace irr;
ICursorControl_getPosition (SCM cursor_control)
{
return scm_from_position2d_s32
- (((gui::ICursorControl*)scm_to_pointer (cursor_control))->getPosition ());
+ (((gui::ICursorControl*)scm_to_irr_pointer (cursor_control))->getPosition ());
}
SCM
ICursorControl_setPosition (SCM cursor_control,
SCM position)
{
- ((gui::ICursorControl*)scm_to_pointer (cursor_control))->
+ ((gui::ICursorControl*)scm_to_irr_pointer (cursor_control))->
setPosition (scm_to_position2d_s32 (position));
return SCM_UNSPECIFIED;
}
#include "driver-types.h"
#include "gsubr.h"
#include "wchar.h"
+#include "wrapped.h"
using namespace irr;
scm_to_bool (fullscreen),
scm_to_bool (stencilbuffer),
scm_to_bool (vsync),
- (IEventReceiver*)scm_to_pointer (receiver));
+ (IEventReceiver*)scm_to_irr_pointer (receiver));
return scm_from_pointer ((void*)device, NULL);
}
IrrlichtDevice_getCursorControl (SCM device)
{
gui::ICursorControl* cursor_control =
- ((IrrlichtDevice*)scm_to_pointer (device))->getCursorControl ();
+ ((IrrlichtDevice*)scm_to_irr_pointer (device))->getCursorControl ();
return scm_from_pointer ((void*)cursor_control, NULL);
}
IrrlichtDevice_getFileSystem (SCM device)
{
io::IFileSystem* file_system =
- ((IrrlichtDevice*)scm_to_pointer (device))->getFileSystem ();
+ ((IrrlichtDevice*)scm_to_irr_pointer (device))->getFileSystem ();
return scm_from_pointer ((void*)file_system, NULL);
}
IrrlichtDevice_getGUIEnvironment (SCM device)
{
gui::IGUIEnvironment* gui_env =
- ((IrrlichtDevice*)scm_to_pointer (device))->getGUIEnvironment ();
+ ((IrrlichtDevice*)scm_to_irr_pointer (device))->getGUIEnvironment ();
return scm_from_pointer ((void*)gui_env, NULL);
}
IrrlichtDevice_getSceneManager (SCM device)
{
scene::ISceneManager* manager =
- ((IrrlichtDevice*)scm_to_pointer (device))->getSceneManager ();
+ ((IrrlichtDevice*)scm_to_irr_pointer (device))->getSceneManager ();
return scm_from_pointer ((void*)manager, NULL);
}
IrrlichtDevice_getTimer (SCM device)
{
ITimer* timer =
- ((IrrlichtDevice*)scm_to_pointer (device))->getTimer ();
+ ((IrrlichtDevice*)scm_to_irr_pointer (device))->getTimer ();
return scm_from_pointer ((void*)timer, NULL);
}
IrrlichtDevice_getVideoDriver (SCM device)
{
video::IVideoDriver* driver =
- ((IrrlichtDevice*)scm_to_pointer (device))->getVideoDriver ();
+ ((IrrlichtDevice*)scm_to_irr_pointer (device))->getVideoDriver ();
return scm_from_pointer ((void*)driver, NULL);
}
IrrlichtDevice_isWindowActive (SCM device)
{
return scm_from_bool
- (((IrrlichtDevice*)scm_to_pointer (device))->isWindowActive ());
+ (((IrrlichtDevice*)scm_to_irr_pointer (device))->isWindowActive ());
}
SCM
IrrlichtDevice_run (SCM device)
{
return scm_from_bool
- (((IrrlichtDevice*)scm_to_pointer (device))->run ());
+ (((IrrlichtDevice*)scm_to_irr_pointer (device))->run ());
}
template <typename TEventReceiver>
IrrlichtDevice_setEventReceiver (SCM device,
SCM receiver)
{
- ((IrrlichtDevice*)scm_to_pointer (device))->
- setEventReceiver ((TEventReceiver)scm_to_pointer (receiver));
+ ((IrrlichtDevice*)scm_to_irr_pointer (device))->
+ setEventReceiver ((TEventReceiver)scm_to_irr_pointer (receiver));
return SCM_UNSPECIFIED;
}
IrrlichtDevice_setResizable (SCM device,
SCM resize)
{
- ((IrrlichtDevice*)scm_to_pointer (device))->
+ ((IrrlichtDevice*)scm_to_irr_pointer (device))->
setResizable (scm_to_bool (resize));
return SCM_UNSPECIFIED;
}
IrrlichtDevice_setWindowCaption (SCM device,
SCM text)
{
- ((IrrlichtDevice*)scm_to_pointer (device))->
+ ((IrrlichtDevice*)scm_to_irr_pointer (device))->
setWindowCaption (scm_to_wide_char_string (text));
return SCM_UNSPECIFIED;
}
SCM
IrrlichtDevice_yield (SCM device)
{
- ((IrrlichtDevice*)scm_to_pointer (device))->yield ();
+ ((IrrlichtDevice*)scm_to_irr_pointer (device))->yield ();
return SCM_UNSPECIFIED;
}
#include "event-receiver.h"
#include "gsubr.h"
#include "keycodes.h"
+#include "wrapped.h"
using namespace irr;
SEvent_EventType (SCM event)
{
return scm_from_event_type
- (((SEvent*)scm_to_pointer (event))->EventType);
+ (((SEvent*)scm_to_irr_pointer (event))->EventType);
}
SCM
SEvent_SGUIEvent_Caller (SCM event)
{
gui::IGUIElement* caller =
- ((SEvent*)scm_to_pointer (event))->GUIEvent.Caller;
+ ((SEvent*)scm_to_irr_pointer (event))->GUIEvent.Caller;
return scm_from_pointer ((void*)caller, NULL);
}
SEvent_SGUIEvent_EventType (SCM event)
{
return scm_from_gui_event_type
- (((SEvent*)scm_to_pointer (event))->GUIEvent.EventType);
+ (((SEvent*)scm_to_irr_pointer (event))->GUIEvent.EventType);
}
SCM
SEvent_SKeyInput_Key (SCM event)
{
return scm_from_key_code
- (((SEvent*)scm_to_pointer (event))->KeyInput.Key);
+ (((SEvent*)scm_to_irr_pointer (event))->KeyInput.Key);
}
SCM
SEvent_SKeyInput_PressedDown (SCM event)
{
return scm_from_bool
- (((SEvent*)scm_to_pointer (event))->KeyInput.PressedDown);
+ (((SEvent*)scm_to_irr_pointer (event))->KeyInput.PressedDown);
}
void
#include "file-archive.h"
#include "file-system.h"
#include "gsubr.h"
+#include "wrapped.h"
using namespace irr;
SCM password,
SCM ret_archive)
{
- io::IFileArchive* retArchive = (io::IFileArchive*)scm_to_pointer (ret_archive);
+ io::IFileArchive* retArchive = (io::IFileArchive*)scm_to_irr_pointer (ret_archive);
io::IFileArchive** retArchiveReference = 0;
if (retArchive != NULL)
{
}
return scm_from_bool
- (((io::IFileSystem*)scm_to_pointer (file_system))->
+ (((io::IFileSystem*)scm_to_irr_pointer (file_system))->
addFileArchive (scm_to_utf8_stringn (filename, NULL),
scm_to_bool (ignore_case),
scm_to_bool (ignore_paths),
#include "position2d.h"
#include "rect.h"
#include "wchar.h"
+#include "wrapped.h"
using namespace irr;
SCM tooltiptext)
{
gui::IGUIButton* button =
- ((gui::IGUIEnvironment*)scm_to_pointer (gui_environment))->
+ ((gui::IGUIEnvironment*)scm_to_irr_pointer (gui_environment))->
addButton (scm_to_rect_s32 (rectangle),
- (TParent)scm_to_pointer (parent),
+ (TParent)scm_to_irr_pointer (parent),
scm_to_int32 (id),
scm_to_wide_char_string (text),
scm_to_wide_char_string (tooltiptext));
SCM id)
{
gui::IGUIEditBox* editbox =
- ((gui::IGUIEnvironment*)scm_to_pointer (gui_environment))->
+ ((gui::IGUIEnvironment*)scm_to_irr_pointer (gui_environment))->
addEditBox (scm_to_wide_char_string (text),
scm_to_rect_s32 (rectangle),
scm_to_bool (border),
- (TParent)scm_to_pointer (parent),
+ (TParent)scm_to_irr_pointer (parent),
scm_to_int32 (id));
return scm_from_pointer ((void*)editbox, NULL);
}
SCM id,
SCM text)
{
- gui::IGUIEnvironment* guienv = (gui::IGUIEnvironment*)scm_to_pointer (gui_environment);
+ gui::IGUIEnvironment* guienv = (gui::IGUIEnvironment*)scm_to_irr_pointer (gui_environment);
gui::IGUIImage* new_image =
- guienv->addImage ((video::ITexture*)scm_to_pointer (image),
+ guienv->addImage ((video::ITexture*)scm_to_irr_pointer (image),
scm_to_position2d_s32 (position),
scm_to_bool (use_alpha_channel),
- (TParent)scm_to_pointer (parent),
+ (TParent)scm_to_irr_pointer (parent),
scm_to_int32 (id),
scm_to_wide_char_string (text));
return scm_from_pointer ((void*) new_image, NULL);
SCM draw_background)
{
gui::IGUIListBox* listbox =
- ((gui::IGUIEnvironment*)scm_to_pointer (gui_environment))->
+ ((gui::IGUIEnvironment*)scm_to_irr_pointer (gui_environment))->
addListBox (scm_to_rect_s32 (rectangle),
- (TParent)scm_to_pointer (parent),
+ (TParent)scm_to_irr_pointer (parent),
scm_to_int32 (id),
scm_to_bool (draw_background));
return scm_from_pointer ((void*)listbox, NULL);
SCM id)
{
gui::IGUIScrollBar* scrollbar =
- ((gui::IGUIEnvironment*)scm_to_pointer (gui_environment))->
+ ((gui::IGUIEnvironment*)scm_to_irr_pointer (gui_environment))->
addScrollBar (scm_to_bool (horizontal),
scm_to_rect_s32 (rectangle),
- (TParent)scm_to_pointer (parent),
+ (TParent)scm_to_irr_pointer (parent),
scm_to_int32 (id));
return scm_from_pointer ((void*)scrollbar, NULL);
}
SCM fill_background)
{
gui::IGUIStaticText* static_text =
- ((gui::IGUIEnvironment*)scm_to_pointer (gui_environment))->
+ ((gui::IGUIEnvironment*)scm_to_irr_pointer (gui_environment))->
addStaticText (scm_to_wide_char_string (text),
scm_to_rect_s32 (rectangle),
scm_to_bool (border),
scm_to_bool (word_wrap),
- (TParent)scm_to_pointer (parent),
+ (TParent)scm_to_irr_pointer (parent),
scm_to_int32 (id),
scm_to_bool (fill_background));
return scm_from_pointer ((void*)static_text, NULL);
SCM id)
{
gui::IGUIWindow* window =
- ((gui::IGUIEnvironment*)scm_to_pointer (gui_environment))->
+ ((gui::IGUIEnvironment*)scm_to_irr_pointer (gui_environment))->
addWindow (scm_to_rect_s32 (rectangle),
scm_to_bool (modal),
scm_to_wide_char_string (text),
- (TParent)scm_to_pointer (parent),
+ (TParent)scm_to_irr_pointer (parent),
scm_to_int32 (id));
return scm_from_pointer ((void*)window, NULL);
}
SCM
IGUIEnvironment_drawAll (SCM gui_environment)
{
- ((gui::IGUIEnvironment*)scm_to_pointer (gui_environment))->drawAll ();
+ ((gui::IGUIEnvironment*)scm_to_irr_pointer (gui_environment))->drawAll ();
return SCM_UNSPECIFIED;
}
IGUIEnvironment_getBuiltInFont (SCM gui_environment)
{
gui::IGUIFont* font =
- ((gui::IGUIEnvironment*)scm_to_pointer (gui_environment))->getBuiltInFont ();
+ ((gui::IGUIEnvironment*)scm_to_irr_pointer (gui_environment))->getBuiltInFont ();
return scm_from_pointer ((void*)font, NULL);
}
SCM filename)
{
gui::IGUIFont* font =
- ((gui::IGUIEnvironment*)scm_to_pointer (gui_environment))->
+ ((gui::IGUIEnvironment*)scm_to_irr_pointer (gui_environment))->
getFont (scm_to_utf8_stringn (filename, NULL));
return scm_from_pointer ((void*)font, NULL);
}
IGUIEnvironment_getSkin (SCM gui_environment)
{
gui::IGUISkin* skin =
- ((gui::IGUIEnvironment*)scm_to_pointer (gui_environment))->getSkin ();
+ ((gui::IGUIEnvironment*)scm_to_irr_pointer (gui_environment))->getSkin ();
return scm_from_pointer ((void*)skin, NULL);
}
#include "color.h"
#include "gsubr.h"
#include "gui-in-out-fader.h"
+#include "wrapped.h"
using namespace irr;
SCM color,
SCM dest_color)
{
- gui::IGUIInOutFader* fader = (gui::IGUIInOutFader*)scm_to_pointer (in_out_fader);
+ gui::IGUIInOutFader* fader = (gui::IGUIInOutFader*)scm_to_irr_pointer (in_out_fader);
if (dest_color == SCM_UNDEFINED)
{
fader->setColor (scm_to_color (color));
#include "gui-listbox.h"
#include "gsubr.h"
#include "wchar.h"
+#include "wrapped.h"
using namespace irr;
SCM text,
SCM icon)
{
- gui::IGUIListBox* listbox = (gui::IGUIListBox*)scm_to_pointer (gui_listbox);
+ gui::IGUIListBox* listbox = (gui::IGUIListBox*)scm_to_irr_pointer (gui_listbox);
u32 item_id;
if (icon == SCM_UNDEFINED)
{
#include <libguile.h>
#include "gui-scrollbar.h"
#include "gsubr.h"
+#include "wrapped.h"
using namespace irr;
IGUIScrollBar_getPos (SCM gui_scrollbar)
{
return scm_from_int32
- (((gui::IGUIScrollBar*)scm_to_pointer (gui_scrollbar))->getPos ());
+ (((gui::IGUIScrollBar*)scm_to_irr_pointer (gui_scrollbar))->getPos ());
}
SCM
IGUIScrollBar_setMax (SCM gui_scrollbar,
SCM max)
{
- ((gui::IGUIScrollBar*) scm_to_pointer (gui_scrollbar))->setMax (scm_to_int32 (max));
+ ((gui::IGUIScrollBar*) scm_to_irr_pointer (gui_scrollbar))->setMax (scm_to_int32 (max));
return SCM_UNSPECIFIED;
}
IGUIScrollBar_setPos (SCM gui_scrollbar,
SCM pos)
{
- ((gui::IGUIScrollBar*) scm_to_pointer (gui_scrollbar))->setPos (scm_to_int32 (pos));
+ ((gui::IGUIScrollBar*) scm_to_irr_pointer (gui_scrollbar))->setPos (scm_to_int32 (pos));
return SCM_UNSPECIFIED;
}
#include "color.h"
#include "gsubr.h"
#include "gui-skin.h"
+#include "wrapped.h"
using namespace irr;
IGUISkin_getColor (SCM gui_skin,
SCM color)
{
- gui::IGUISkin* skin = (gui::IGUISkin*) scm_to_pointer (gui_skin);
+ gui::IGUISkin* skin = (gui::IGUISkin*) scm_to_irr_pointer (gui_skin);
video::SColor scolor = skin->getColor (scm_to_default_color (color));
return scm_from_color (scolor);
}
IGUISkin_getFont (SCM gui_skin,
SCM which)
{
- gui::IGUISkin* skin = (gui::IGUISkin*) scm_to_pointer (gui_skin);
+ gui::IGUISkin* skin = (gui::IGUISkin*) scm_to_irr_pointer (gui_skin);
gui::IGUIFont* font = skin->getFont (scm_to_default_font (which));
return scm_from_pointer ((void*) font, NULL);
}
SCM which,
SCM new_color)
{
- gui::IGUISkin* skin = (gui::IGUISkin*) scm_to_pointer (gui_skin);
+ gui::IGUISkin* skin = (gui::IGUISkin*) scm_to_irr_pointer (gui_skin);
skin->setColor (scm_to_default_color (which),
scm_to_color (new_color));
return SCM_UNSPECIFIED;
SCM font,
SCM which)
{
- gui::IGUISkin* skin = (gui::IGUISkin*) scm_to_pointer (gui_skin);
- skin->setFont ((gui::IGUIFont*) scm_to_pointer (font),
+ gui::IGUISkin* skin = (gui::IGUISkin*) scm_to_irr_pointer (gui_skin);
+ skin->setFont ((gui::IGUIFont*) scm_to_irr_pointer (font),
scm_to_default_font (which));
return SCM_UNSPECIFIED;
}
#include "gsubr.h"
#include "gui-toolbar.h"
#include "wchar.h"
+#include "wrapped.h"
using namespace irr;
SCM is_push_button,
SCM use_alpha_channel)
{
- gui::IGUIToolBar* toolbar = (gui::IGUIToolBar*) scm_to_pointer (gui_toolbar);
+ gui::IGUIToolBar* toolbar = (gui::IGUIToolBar*) scm_to_irr_pointer (gui_toolbar);
gui::IGUIButton* button =
toolbar->addButton (scm_to_int32 (id),
scm_to_wide_char_string (text),
scm_to_wide_char_string (tooltiptext),
- (video::ITexture*) scm_to_pointer (img),
- (video::ITexture*) scm_to_pointer (pressedimg),
+ (video::ITexture*) scm_to_irr_pointer (img),
+ (video::ITexture*) scm_to_irr_pointer (pressedimg),
scm_to_bool (is_push_button),
scm_to_bool (use_alpha_channel));
return scm_from_pointer ((void*) button, NULL);
#include <libguile.h>
#include "gsubr.h"
#include "reference-counted.h"
+#include "wrapped.h"
using namespace irr;
SCM
IReferenceCounted_drop (SCM obj)
{
- return scm_from_bool (((T) scm_to_pointer (obj))->drop ());
+ return scm_from_bool (((T) scm_to_irr_pointer (obj))->drop ());
}
void
#include "gsubr.h"
#include "scene-manager.h"
#include "vector3d.h"
+#include "wrapped.h"
using namespace irr;
SCM scale,
SCM also_add_if_mesh_pointer_zero)
{
- scene::ISceneManager* smgr = (scene::ISceneManager*) scm_to_pointer (scene_manager);
+ scene::ISceneManager* smgr = (scene::ISceneManager*) scm_to_irr_pointer (scene_manager);
scene::IAnimatedMeshSceneNode* node =
- smgr->addAnimatedMeshSceneNode ((scene::IAnimatedMesh*) scm_to_pointer (mesh),
- (TParent) scm_to_pointer (parent),
+ smgr->addAnimatedMeshSceneNode ((scene::IAnimatedMesh*) scm_to_irr_pointer (mesh),
+ (TParent) scm_to_irr_pointer (parent),
scm_to_int32 (id),
scm_to_vector3df (position),
scm_to_vector3df (rotation),
SCM id,
SCM make_active)
{
- scene::ISceneManager* smgr = (scene::ISceneManager*) scm_to_pointer (scene_manager);
+ scene::ISceneManager* smgr = (scene::ISceneManager*) scm_to_irr_pointer (scene_manager);
scene::ICameraSceneNode* camera =
- smgr->addCameraSceneNode ((TParent) scm_to_pointer (parent),
+ smgr->addCameraSceneNode ((TParent) scm_to_irr_pointer (parent),
scm_to_vector3df (position),
scm_to_vector3df (lookat),
scm_to_int32 (id),
scm_from_utf8_keyword ("make-active"), &make_active,
SCM_UNDEFINED);
- scene::ISceneManager* smgr = (scene::ISceneManager*) scm_to_pointer (scene_manager);
+ scene::ISceneManager* smgr = (scene::ISceneManager*) scm_to_irr_pointer (scene_manager);
scene::ICameraSceneNode* camera =
- smgr->addCameraSceneNodeFPS ((TParent) scm_to_pointer (parent),
+ smgr->addCameraSceneNodeFPS ((TParent) scm_to_irr_pointer (parent),
scm_to_double (rotate_speed),
scm_to_double (move_speed),
scm_to_int32 (id),
- (SKeyMap*) scm_to_pointer (key_map_array),
+ (SKeyMap*) scm_to_irr_pointer (key_map_array),
scm_to_int32 (key_map_size),
scm_to_bool (no_vertical_movement),
scm_to_double (jump_speed),
SCM rotation,
SCM scale)
{
- scene::ISceneManager* smgr = (scene::ISceneManager*) scm_to_pointer (scene_manager);
+ scene::ISceneManager* smgr = (scene::ISceneManager*) scm_to_irr_pointer (scene_manager);
scene::IMeshSceneNode* node =
smgr->addCubeSceneNode (scm_to_double (size),
- (TParent) scm_to_pointer (parent),
+ (TParent) scm_to_irr_pointer (parent),
scm_to_int32 (id),
scm_to_vector3df (position),
scm_to_vector3df (rotation),
virtual const core::aabbox3d<f32>& getBoundingBox () const
{
SCM box = scm_call_0 (scm_get_bounding_box);
- return *((core::aabbox3d<f32>*) scm_to_pointer (box));
+ return *((core::aabbox3d<f32>*) scm_to_irr_pointer (box));
}
virtual u32 getMaterialCount () const
virtual video::SMaterial& getMaterial (u32 i)
{
SCM material = scm_call_1 (scm_get_material, scm_from_uint32 (i));
- return *((video::SMaterial*) scm_to_pointer (material));
+ return *((video::SMaterial*) scm_to_irr_pointer (material));
}
};
CustomSceneNode* node =
- new CustomSceneNode ((TParent) scm_to_pointer (parent),
- (scene::ISceneManager*) scm_to_pointer (scene_manager),
+ new CustomSceneNode ((TParent) scm_to_irr_pointer (parent),
+ (scene::ISceneManager*) scm_to_irr_pointer (scene_manager),
scm_to_int32 (id),
scm_to_vector3df (position),
scm_to_vector3df (rotation),
SCM minimal_polys_per_node,
SCM also_add_if_mesh_pointer_zero)
{
- scene::ISceneManager* smgr = (scene::ISceneManager*) scm_to_pointer (scene_manager);
+ scene::ISceneManager* smgr = (scene::ISceneManager*) scm_to_irr_pointer (scene_manager);
scene::IMeshSceneNode* node =
- smgr->addOctreeSceneNode ((TMesh) scm_to_pointer (mesh),
- (TParent) scm_to_pointer (parent),
+ smgr->addOctreeSceneNode ((TMesh) scm_to_irr_pointer (mesh),
+ (TParent) scm_to_irr_pointer (parent),
scm_to_int32 (id),
scm_to_int32 (minimal_polys_per_node),
scm_to_bool (also_add_if_mesh_pointer_zero));
SCM rotation,
SCM scale)
{
- scene::ISceneManager* smgr = (scene::ISceneManager*) scm_to_pointer (scene_manager);
+ scene::ISceneManager* smgr = (scene::ISceneManager*) scm_to_irr_pointer (scene_manager);
scene::IMeshSceneNode* node =
smgr->addSphereSceneNode (scm_to_double (radius),
scm_to_int32 (poly_count),
- (TParent) scm_to_pointer (parent),
+ (TParent) scm_to_irr_pointer (parent),
scm_to_int32 (id),
scm_to_vector3df (position),
scm_to_vector3df (rotation),
SCM start_position,
SCM radius_ellipsoid)
{
- scene::ISceneManager* smgr = (scene::ISceneManager*) scm_to_pointer (scene_manager);
+ scene::ISceneManager* smgr = (scene::ISceneManager*) scm_to_irr_pointer (scene_manager);
scene::ISceneNodeAnimator* anim =
smgr->createFlyCircleAnimator (scm_to_vector3df (center),
scm_to_double (radius),
SCM loop,
SCM pingpong)
{
- scene::ISceneManager* smgr = (scene::ISceneManager*) scm_to_pointer (scene_manager);
+ scene::ISceneManager* smgr = (scene::ISceneManager*) scm_to_irr_pointer (scene_manager);
scene::ISceneNodeAnimator* anim =
smgr->createFlyStraightAnimator (scm_to_vector3df (start_point),
scm_to_vector3df (end_point),
ISceneManager_createRotationAnimator (SCM scene_manager,
SCM rotation_speed)
{
- scene::ISceneManager* smgr = (scene::ISceneManager*) scm_to_pointer (scene_manager);
+ scene::ISceneManager* smgr = (scene::ISceneManager*) scm_to_irr_pointer (scene_manager);
scene::ISceneNodeAnimator* anim =
smgr->createRotationAnimator (scm_to_vector3df (rotation_speed));
return scm_from_pointer ((void*) anim, NULL);
SCM
ISceneManager_drawAll (SCM scene_manager)
{
- ((scene::ISceneManager*) scm_to_pointer (scene_manager))->drawAll ();
+ ((scene::ISceneManager*) scm_to_irr_pointer (scene_manager))->drawAll ();
return SCM_UNSPECIFIED;
}
ISceneManager_getMesh (SCM scene_manager,
SCM filename)
{
- scene::ISceneManager* smgr = (scene::ISceneManager*) scm_to_pointer (scene_manager);
+ scene::ISceneManager* smgr = (scene::ISceneManager*) scm_to_irr_pointer (scene_manager);
scene::IAnimatedMesh* mesh = smgr->getMesh(scm_to_utf8_stringn (filename, NULL));
return scm_from_pointer ((void*) mesh, NULL);
}
SCM
ISceneManager_getRootSceneNode (SCM scene_manager)
{
- scene::ISceneManager* smgr = (scene::ISceneManager*) scm_to_pointer (scene_manager);
+ scene::ISceneManager* smgr = (scene::ISceneManager*) scm_to_irr_pointer (scene_manager);
return scm_from_pointer ((void*) smgr->getRootSceneNode (), NULL);
}
#include "matrix4.h"
#include "scene-node.h"
#include "vector3d.h"
+#include "wrapped.h"
using namespace irr;
ISceneNode_addAnimator (SCM scene_node,
SCM animator)
{
- TSceneNode node = (TSceneNode) scm_to_pointer (scene_node);
- node->addAnimator ((scene::ISceneNodeAnimator*) scm_to_pointer (animator));
+ TSceneNode node = (TSceneNode) scm_to_irr_pointer (scene_node);
+ node->addAnimator ((scene::ISceneNodeAnimator*) scm_to_irr_pointer (animator));
return SCM_UNSPECIFIED;
}
SCM
ISceneNode_getAbsoluteTransformation (SCM scene_node)
{
- TSceneNode node = (TSceneNode) scm_to_pointer (scene_node);
+ TSceneNode node = (TSceneNode) scm_to_irr_pointer (scene_node);
return scm_from_matrix4 (node->getAbsoluteTransformation ());
}
SCM
ISceneNode_getPosition (SCM scene_node)
{
- TSceneNode node = (TSceneNode) scm_to_pointer (scene_node);
+ TSceneNode node = (TSceneNode) scm_to_irr_pointer (scene_node);
return scm_from_vector3df (node->getPosition ());
}
SCM flag,
SCM newvalue)
{
- TSceneNode node = (TSceneNode) scm_to_pointer (scene_node);
+ TSceneNode node = (TSceneNode) scm_to_irr_pointer (scene_node);
node->setMaterialFlag (scm_to_material_flag (flag), scm_to_bool (newvalue));
return SCM_UNSPECIFIED;
}
SCM texture_layer,
SCM texture)
{
- TSceneNode node = (TSceneNode) scm_to_pointer (scene_node);
+ TSceneNode node = (TSceneNode) scm_to_irr_pointer (scene_node);
node->setMaterialTexture (scm_to_uint32 (texture_layer),
- (video::ITexture*) scm_to_pointer (texture));
+ (video::ITexture*) scm_to_irr_pointer (texture));
return SCM_UNSPECIFIED;
}
ISceneNode_setPosition (SCM scene_node,
SCM position)
{
- TSceneNode node = (TSceneNode) scm_to_pointer (scene_node);
+ TSceneNode node = (TSceneNode) scm_to_irr_pointer (scene_node);
node->setPosition (scm_to_vector3df (position));
return SCM_UNSPECIFIED;
}
ISceneNode_setRotation (SCM scene_node,
SCM rotation)
{
- TSceneNode node = (TSceneNode) scm_to_pointer (scene_node);
+ TSceneNode node = (TSceneNode) scm_to_irr_pointer (scene_node);
node->setRotation (scm_to_vector3df (rotation));
return SCM_UNSPECIFIED;
}
ISceneNode_setScale (SCM scene_node,
SCM scale)
{
- TSceneNode node = (TSceneNode) scm_to_pointer (scene_node);
+ TSceneNode node = (TSceneNode) scm_to_irr_pointer (scene_node);
node->setScale (scm_to_vector3df (scale));
return SCM_UNSPECIFIED;
}
#include <libguile.h>
#include "gsubr.h"
#include "timer.h"
+#include "wrapped.h"
using namespace irr;
SCM
ITimer_getTime (SCM timer)
{
- return scm_from_uint32 (((ITimer*) scm_to_pointer (timer))->getTime());
+ return scm_from_uint32 (((ITimer*) scm_to_irr_pointer (timer))->getTime());
}
void
#include "vector2d.h"
#include "vector3d.h"
#include "vertex3d.h"
+#include "wrapped.h"
using namespace irr;
SCM
video_S3DVertex_Pos (SCM vertex) {
- video::S3DVertex* s3dvertex = (video::S3DVertex*) scm_to_pointer (vertex);
+ video::S3DVertex* s3dvertex = (video::S3DVertex*) scm_to_irr_pointer (vertex);
return scm_from_vector3df (s3dvertex->Pos);
}
#include "rect.h"
#include "vertex3d.h"
#include "video-driver.h"
+#include "wrapped.h"
using namespace irr;
SCM video_data,
SCM source_rect)
{
- video::IVideoDriver* driver = (video::IVideoDriver*) scm_to_pointer (video_driver);
+ video::IVideoDriver* driver = (video::IVideoDriver*) scm_to_irr_pointer (video_driver);
// Source rect
core::rect<s32>* sourceRectAddress = 0;
for (int i = 0; i < vertex_count; i++)
{
video::S3DVertex* vertex =
- (video::S3DVertex*) scm_to_pointer (scm_list_ref (vertices, scm_from_int (i)));
+ (video::S3DVertex*) scm_to_irr_pointer (scm_list_ref (vertices, scm_from_int (i)));
s3d_vertices[i] = video::S3DVertex (vertex->Pos,
vertex->Normal,
vertex->Color,
}
// Draw vertices
- video::IVideoDriver* driver = (video::IVideoDriver*) scm_to_pointer (video_driver);
+ video::IVideoDriver* driver = (video::IVideoDriver*) scm_to_irr_pointer (video_driver);
driver->drawVertexPrimitiveList (&s3d_vertices[0],
vertex_count,
&c_indices[0],
SCM
IVideoDriver_endScene (SCM video_driver)
{
- video::IVideoDriver* driver = (video::IVideoDriver*) scm_to_pointer (video_driver);
+ video::IVideoDriver* driver = (video::IVideoDriver*) scm_to_irr_pointer (video_driver);
return scm_from_bool (driver->endScene ());
}
SCM
IVideoDriver_getFPS (SCM video_driver)
{
- video::IVideoDriver* driver = (video::IVideoDriver*) scm_to_pointer (video_driver);
+ video::IVideoDriver* driver = (video::IVideoDriver*) scm_to_irr_pointer (video_driver);
return scm_from_int32 (driver->getFPS ());
}
IVideoDriver_getTexture (SCM video_driver,
SCM filename)
{
- video::IVideoDriver* driver = (video::IVideoDriver*) scm_to_pointer (video_driver);
+ video::IVideoDriver* driver = (video::IVideoDriver*) scm_to_irr_pointer (video_driver);
video::ITexture* texture = driver->getTexture (scm_to_utf8_stringn (filename, NULL));
return scm_from_pointer ((void*) texture, NULL);
}
IVideoDriver_setMaterial (SCM video_driver,
SCM material)
{
- video::IVideoDriver* driver = (video::IVideoDriver*) scm_to_pointer (video_driver);
- driver->setMaterial (*((video::SMaterial*) scm_to_pointer (material)));
+ video::IVideoDriver* driver = (video::IVideoDriver*) scm_to_irr_pointer (video_driver);
+ driver->setMaterial (*((video::SMaterial*) scm_to_irr_pointer (material)));
return SCM_UNSPECIFIED;
}
SCM state,
SCM mat)
{
- video::IVideoDriver* driver = (video::IVideoDriver*) scm_to_pointer (video_driver);
+ video::IVideoDriver* driver = (video::IVideoDriver*) scm_to_irr_pointer (video_driver);
driver->setTransform (scm_to_transformation_state (state),
scm_to_matrix4 (mat));
return SCM_UNSPECIFIED;
--- /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 <libguile.h>
+#include "wrapped.h"
+
+/* Extract C++ irrlicht object pointer from Guile object */
+void*
+scm_to_irr_pointer (SCM obj)
+{
+ SCM slot = scm_slot_ref (obj, scm_from_utf8_symbol ("irr-pointer"));
+ return scm_to_pointer (slot);
+}
--- /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_WRAPPED_H_INCLUDED__
+#define __GUILE_IRRLICHT_WRAPPED_H_INCLUDED__
+
+#include <libguile.h>
+
+void*
+scm_to_irr_pointer (SCM obj);
+
+#endif