X-Git-Url: https://git.jsancho.org/?a=blobdiff_plain;f=src%2Fcursor-control.cpp;h=1147eab54191ab35ad655b9ef0c6ce103c5ac8c9;hb=f800b6da773b92fad5ebf3db07b8efa2e4e1b46f;hp=4a870e81029f47ee7974e0d711ce5fd5b325229f;hpb=2cdd08f70b0a58b2f00b341df5b73704d3febd47;p=guile-irrlicht.git diff --git a/src/cursor-control.cpp b/src/cursor-control.cpp index 4a870e8..1147eab 100644 --- a/src/cursor-control.cpp +++ b/src/cursor-control.cpp @@ -21,7 +21,10 @@ #include #include + #include "cursor-control.h" +#include "device.h" +#include "gsubr.h" #include "position2d.h" #include "wrapped.h" @@ -31,12 +34,28 @@ extern "C" { init_cursor_control (void) { init_cursor_control_type (); + DEFINE_GSUBR ("get-cursor-control", 1, 0, 0, irr_getCursorControl); } 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_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)