]> git.jsancho.org Git - c-irrlicht.git/blobdiff - src/IrrlichtDevice.cpp
Some GUI functions
[c-irrlicht.git] / src / IrrlichtDevice.cpp
index b78b1ecabdb5941cab89809a3dd590e27fa94e3d..57fefdfac7251563b920367cb4674a232d8b7270 100644 (file)
 */
 
 #include <irrlicht/irrlicht.h>
+#include <wchar.h>
 #include "IrrlichtDevice.h"
 
 extern "C" {
+  void* irr_IrrlichtDevice_getGUIEnvironment(void* device)
+  {
+    return ((irr::IrrlichtDevice*)device)->getGUIEnvironment();
+  }
+
+  void* irr_IrrlichtDevice_getSceneManager(void* device)
+  {
+    return ((irr::IrrlichtDevice*)device)->getSceneManager();
+  }
+
   void* irr_IrrlichtDevice_getVideoDriver(void* device)
   {
     return ((irr::IrrlichtDevice*)device)->getVideoDriver();
   }
+
+  void irr_IrrlichtDevice_setWindowCaption(void* device, const char* text)
+  {
+    wchar_t *wtext = (wchar_t*)malloc((strlen(text) + 1) * sizeof(wchar_t));
+    mbsrtowcs(wtext, &text, strlen(text) + 1, NULL);
+    ((irr::IrrlichtDevice*)device)->setWindowCaption(wtext);
+  }
+
+  int irr_IrrlichtDevice_run(void* device)
+  {
+    return ((irr::IrrlichtDevice*)device)->run() ? 1 : 0;
+  }
+
+  int irr_IrrlichtDevice_drop(void* device)
+  {
+    return ((irr::IrrlichtDevice*)device)->drop() ? 1 : 0;
+  }
 }