#include <irrlicht/irrlicht.h>
#include <libguile.h>
-
#include "cursor-control.h"
-#include "device.h"
#include "gsubr.h"
#include "position2d.h"
-#include "wrapped.h"
-extern "C" {
- void
- init_cursor_control (void)
- {
- init_cursor_control_type ();
- DEFINE_GSUBR ("get-cursor-control", 1, 0, 0, irr_getCursorControl);
- }
+using namespace irr;
- DEFINE_WRAPPED_TYPE (irr::gui::ICursorControl*, "cursor-control",
- init_cursor_control_type, cursor_control_p,
- wrap_cursor_control, unwrap_cursor_control);
- SCM
- irr_getCursorControl (SCM wrapped_device)
- {
- irr::gui::ICursorControl* cursor_control =
- unwrap_device (wrapped_device)->getCursorControl ();
- return wrap_cursor_control (cursor_control);
- }
+SCM
+irr_gui_ICursorControl_getPosition (SCM cursor_control)
+{
+ return scm_from_position2d_s32
+ (((gui::ICursorControl*)scm_to_pointer (cursor_control))->getPosition ());
+}
+
+
+SCM
+irr_gui_ICursorControl_setPosition (SCM cursor_control,
+ SCM position)
+{
+ ((gui::ICursorControl*)scm_to_pointer (cursor_control))->
+ setPosition (scm_to_position2d_s32 (position));
+ return SCM_UNSPECIFIED;
+}
- SCM
- irr_gui_getPosition (SCM wrapped_cursor_control)
- {
- irr::gui::ICursorControl* control = unwrap_cursor_control (wrapped_cursor_control);
- return scm_from_position2d_s32 (control->getPosition ());
- }
- SCM
- irr_gui_setPosition (SCM wrapped_cursor_control,
- SCM position)
+extern "C" {
+
+ void
+ init_cursor_control (void)
{
- irr::gui::ICursorControl* control = unwrap_cursor_control (wrapped_cursor_control);
- if (scm_is_integer (scm_car (position)) && scm_is_integer (scm_cadr (position)))
- {
- control->setPosition (scm_to_position2d_s32 (position));
- }
- else
- {
- control->setPosition (scm_to_position2d_f32 (position));
- }
- return SCM_UNSPECIFIED;
+ DEFINE_GSUBR ("irr_gui_ICursorControl_getPosition", 1, 0, 0,
+ irr_gui_ICursorControl_getPosition);
+ DEFINE_GSUBR ("irr_gui_ICursorControl_setPosition", 2, 0, 0,
+ irr_gui_ICursorControl_setPosition);
}
}
#include <irrlicht/irrlicht.h>
#include <libguile.h>
-#include "wrapped.h"
-extern "C" {
+SCM
+irr_gui_ICursorControl_getPosition (SCM cursor_control);
+
+SCM
+irr_gui_ICursorControl_setPosition (SCM cursor_control,
+ SCM position);
+extern "C" {
void
init_cursor_control (void);
-
- DECLARE_WRAPPED_TYPE (irr::gui::ICursorControl*, init_cursor_control_type,
- cursor_control_p, wrap_cursor_control, unwrap_cursor_control);
-
- SCM
- irr_getCursorControl (SCM wrapped_device);
-
- SCM
- irr_gui_getPosition (SCM wrapped_cursor_control);
-
- SCM
- irr_gui_setPosition (SCM wrapped_cursor_control,
- SCM position);
-
}
#endif