X-Git-Url: https://git.jsancho.org/?a=blobdiff_plain;ds=sidebyside;f=src%2Fdevice.cpp;h=ed551705389337c09e789d110d54ba0ac2f6ac1b;hb=cda8d6e3636e9ad6878b8e6b0c4449f6f9c635f0;hp=10ba8ad6c2e67086e5dc27ddcc76e685c3916b1e;hpb=d78951bd91783c61b312451198beb31f70b0f8b2;p=guile-irrlicht.git diff --git a/src/device.cpp b/src/device.cpp index 10ba8ad..ed55170 100644 --- a/src/device.cpp +++ b/src/device.cpp @@ -31,15 +31,14 @@ using namespace irr; -template SCM -createDevice (SCM device_type, - SCM window_size, - SCM bits, - SCM fullscreen, - SCM stencilbuffer, - SCM vsync, - SCM receiver) +irr_createDevice (SCM device_type, + SCM window_size, + SCM bits, + SCM fullscreen, + SCM stencilbuffer, + SCM vsync, + SCM receiver) { IrrlichtDevice* device = createDevice (scm_to_driver_type (device_type), @@ -48,7 +47,7 @@ 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); } @@ -62,6 +61,15 @@ IrrlichtDevice_getCursorControl (SCM device) } +SCM +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) { @@ -158,31 +166,20 @@ extern "C" { void init_device (void) { - init_device_type (); - DEFINE_GSUBR ("createDevice_IEventReceiver", 7, 0, 0, - createDevice); - DEFINE_GSUBR ("IrrlichtDevice_getCursorControl", 1, 0, 0, - IrrlichtDevice_getCursorControl); - 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 ("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); + 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); } }