]> git.jsancho.org Git - c-irrlicht.git/commitdiff
setWindowCaption
authorJavier Sancho <jsf@jsancho.org>
Fri, 4 Oct 2019 15:05:02 +0000 (17:05 +0200)
committerJavier Sancho <jsf@jsancho.org>
Fri, 4 Oct 2019 15:05:02 +0000 (17:05 +0200)
include/IrrlichtDevice.h
src/IrrlichtDevice.cpp

index c5a2ed69bd2e5403155eae0ec1cdf83aedf07da3..566862801ae6d37c55e11f9c5493193ab3ce71d4 100644 (file)
@@ -28,6 +28,7 @@ extern "C" {
 
   void* irr_IrrlichtDevice_getSceneManager(void* device);
   void* irr_IrrlichtDevice_getVideoDriver(void* device);
+  void irr_IrrlichtDevice_setWindowCaption(void* device, const char* text);
 
 #ifdef __cplusplus
 }
index fc7665a9e97231c033d8e8d3789dbd7c388ae332..37c578b294d59766d6933b0e7dea0961db8415dd 100644 (file)
@@ -20,6 +20,7 @@
 */
 
 #include <irrlicht/irrlicht.h>
+#include <wchar.h>
 #include "IrrlichtDevice.h"
 
 extern "C" {
@@ -32,4 +33,11 @@ extern "C" {
   {
     return ((irr::IrrlichtDevice*)device)->getVideoDriver();
   }
+
+  void irr_IrrlichtDevice_setWindowCaption(void* device, const char* text)
+  {
+    wchar_t *wtext = (wchar_t*)malloc(strlen(text) + 1);
+    mbsrtowcs(wtext, &text, strlen(text) + 1, NULL);
+    ((irr::IrrlichtDevice*)device)->setWindowCaption(wtext);
+  }
 }