X-Git-Url: https://git.jsancho.org/?a=blobdiff_plain;f=src%2Fdevice.cpp;h=ed551705389337c09e789d110d54ba0ac2f6ac1b;hb=87e6d9b96167c5db7ef3c824b47c0d575b0fc4d2;hp=4ff21a56aa38a32e671f751a0535a1c52e459f72;hpb=21c2a906c994af63024cbf38c7849f8976300bbb;p=guile-irrlicht.git diff --git a/src/device.cpp b/src/device.cpp index 4ff21a5..ed55170 100644 --- a/src/device.cpp +++ b/src/device.cpp @@ -31,7 +31,6 @@ using namespace irr; -template SCM irr_createDevice (SCM device_type, SCM window_size, @@ -48,13 +47,13 @@ irr_createDevice (SCM device_type, scm_to_bool (fullscreen), scm_to_bool (stencilbuffer), scm_to_bool (vsync), - (TEventReceiver)scm_to_pointer (receiver)); + (IEventReceiver*)scm_to_pointer (receiver)); return scm_from_pointer ((void*)device, NULL); } SCM -irr_IrrlichtDevice_getCursorControl (SCM device) +IrrlichtDevice_getCursorControl (SCM device) { gui::ICursorControl* cursor_control = ((IrrlichtDevice*)scm_to_pointer (device))->getCursorControl (); @@ -63,7 +62,16 @@ irr_IrrlichtDevice_getCursorControl (SCM device) SCM -irr_IrrlichtDevice_getGUIEnvironment (SCM device) +IrrlichtDevice_getFileSystem (SCM device) +{ + io::IFileSystem* file_system = + ((IrrlichtDevice*)scm_to_pointer (device))->getFileSystem (); + return scm_from_pointer ((void*)file_system, NULL); +} + + +SCM +IrrlichtDevice_getGUIEnvironment (SCM device) { gui::IGUIEnvironment* gui_env = ((IrrlichtDevice*)scm_to_pointer (device))->getGUIEnvironment (); @@ -72,7 +80,7 @@ irr_IrrlichtDevice_getGUIEnvironment (SCM device) SCM -irr_IrrlichtDevice_getSceneManager (SCM device) +IrrlichtDevice_getSceneManager (SCM device) { scene::ISceneManager* manager = ((IrrlichtDevice*)scm_to_pointer (device))->getSceneManager (); @@ -81,7 +89,7 @@ irr_IrrlichtDevice_getSceneManager (SCM device) SCM -irr_IrrlichtDevice_getTimer (SCM device) +IrrlichtDevice_getTimer (SCM device) { ITimer* timer = ((IrrlichtDevice*)scm_to_pointer (device))->getTimer (); @@ -90,7 +98,7 @@ irr_IrrlichtDevice_getTimer (SCM device) SCM -irr_IrrlichtDevice_getVideoDriver (SCM device) +IrrlichtDevice_getVideoDriver (SCM device) { video::IVideoDriver* driver = ((IrrlichtDevice*)scm_to_pointer (device))->getVideoDriver (); @@ -99,7 +107,7 @@ irr_IrrlichtDevice_getVideoDriver (SCM device) SCM -irr_IrrlichtDevice_isWindowActive (SCM device) +IrrlichtDevice_isWindowActive (SCM device) { return scm_from_bool (((IrrlichtDevice*)scm_to_pointer (device))->isWindowActive ()); @@ -107,7 +115,7 @@ irr_IrrlichtDevice_isWindowActive (SCM device) SCM -irr_IrrlichtDevice_run (SCM device) +IrrlichtDevice_run (SCM device) { return scm_from_bool (((IrrlichtDevice*)scm_to_pointer (device))->run ()); @@ -116,8 +124,8 @@ irr_IrrlichtDevice_run (SCM device) template SCM -irr_IrrlichtDevice_setEventReceiver (SCM device, - SCM receiver) +IrrlichtDevice_setEventReceiver (SCM device, + SCM receiver) { ((IrrlichtDevice*)scm_to_pointer (device))-> setEventReceiver ((TEventReceiver)scm_to_pointer (receiver)); @@ -126,8 +134,8 @@ irr_IrrlichtDevice_setEventReceiver (SCM device, SCM -irr_IrrlichtDevice_setResizable (SCM device, - SCM resize) +IrrlichtDevice_setResizable (SCM device, + SCM resize) { ((IrrlichtDevice*)scm_to_pointer (device))-> setResizable (scm_to_bool (resize)); @@ -136,8 +144,8 @@ irr_IrrlichtDevice_setResizable (SCM device, SCM -irr_IrrlichtDevice_setWindowCaption (SCM device, - SCM text) +IrrlichtDevice_setWindowCaption (SCM device, + SCM text) { ((IrrlichtDevice*)scm_to_pointer (device))-> setWindowCaption (scm_to_wide_char_string (text)); @@ -146,7 +154,7 @@ irr_IrrlichtDevice_setWindowCaption (SCM device, SCM -irr_IrrlichtDevice_yield (SCM device) +IrrlichtDevice_yield (SCM device) { ((IrrlichtDevice*)scm_to_pointer (device))->yield (); return SCM_UNSPECIFIED; @@ -158,31 +166,20 @@ extern "C" { void init_device (void) { - init_device_type (); - DEFINE_GSUBR ("irr_createDevice_IEventReceiver", 7, 0, 0, - irr_createDevice); - DEFINE_GSUBR ("irr_IrrlichtDevice_getCursorControl", 1, 0, 0, - irr_IrrlichtDevice_getCursorControl); - DEFINE_GSUBR ("irr_IrrlichtDevice_getGUIEnvironment", 1, 0, 0, - irr_IrrlichtDevice_getGUIEnvironment); - DEFINE_GSUBR ("irr_IrrlichtDevice_getSceneManager", 1, 0, 0, - irr_IrrlichtDevice_getSceneManager); - DEFINE_GSUBR ("irr_IrrlichtDevice_getTimer", 1, 0, 0, - irr_IrrlichtDevice_getTimer); - DEFINE_GSUBR ("irr_IrrlichtDevice_getVideoDriver", 1, 0, 0, - irr_IrrlichtDevice_getVideoDriver); - DEFINE_GSUBR ("irr_IrrlichtDevice_isWindowActive", 1, 0, 0, - irr_IrrlichtDevice_isWindowActive); - DEFINE_GSUBR ("irr_IrrlichtDevice_run", 1, 0, 0, - irr_IrrlichtDevice_run); - DEFINE_GSUBR ("irr_IrrlichtDevice_setEventReceiver_IEventReceiver", 2, 0, 0, - irr_IrrlichtDevice_setEventReceiver); - DEFINE_GSUBR ("irr_IrrlichtDevice_setResizable", 2, 0, 0, - irr_IrrlichtDevice_setResizable); - DEFINE_GSUBR ("irr_IrrlichtDevice_setWindowCaption", 2, 0, 0, - irr_IrrlichtDevice_setWindowCaption); - DEFINE_GSUBR ("irr_IrrlichtDevice_yield", 1, 0, 0, - irr_IrrlichtDevice_yield); + DEFINE_GSUBR ("createDevice", 7, 0, 0, irr_createDevice); + DEFINE_GSUBR ("IrrlichtDevice_getCursorControl", 1, 0, 0, IrrlichtDevice_getCursorControl); + DEFINE_GSUBR ("IrrlichtDevice_getFileSystem", 1, 0, 0, IrrlichtDevice_getFileSystem); + DEFINE_GSUBR ("IrrlichtDevice_getGUIEnvironment", 1, 0, 0, IrrlichtDevice_getGUIEnvironment); + DEFINE_GSUBR ("IrrlichtDevice_getSceneManager", 1, 0, 0, IrrlichtDevice_getSceneManager); + DEFINE_GSUBR ("IrrlichtDevice_getTimer", 1, 0, 0, IrrlichtDevice_getTimer); + DEFINE_GSUBR ("IrrlichtDevice_getVideoDriver", 1, 0, 0, IrrlichtDevice_getVideoDriver); + DEFINE_GSUBR ("IrrlichtDevice_isWindowActive", 1, 0, 0, IrrlichtDevice_isWindowActive); + DEFINE_GSUBR ("IrrlichtDevice_run", 1, 0, 0, IrrlichtDevice_run); + DEFINE_GSUBR ("IrrlichtDevice_setEventReceiver_IEventReceiver", 2, 0, 0, + IrrlichtDevice_setEventReceiver); + DEFINE_GSUBR ("IrrlichtDevice_setResizable", 2, 0, 0, IrrlichtDevice_setResizable); + DEFINE_GSUBR ("IrrlichtDevice_setWindowCaption", 2, 0, 0, IrrlichtDevice_setWindowCaption); + DEFINE_GSUBR ("IrrlichtDevice_yield", 1, 0, 0, IrrlichtDevice_yield); } }