From 42a76e00d431638a87f5d55c43003d36a508173f Mon Sep 17 00:00:00 2001 From: Javier Sancho Date: Fri, 4 Oct 2019 17:05:02 +0200 Subject: [PATCH] setWindowCaption --- include/IrrlichtDevice.h | 1 + src/IrrlichtDevice.cpp | 8 ++++++++ 2 files changed, 9 insertions(+) diff --git a/include/IrrlichtDevice.h b/include/IrrlichtDevice.h index c5a2ed6..5668628 100644 --- a/include/IrrlichtDevice.h +++ b/include/IrrlichtDevice.h @@ -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 } diff --git a/src/IrrlichtDevice.cpp b/src/IrrlichtDevice.cpp index fc7665a..37c578b 100644 --- a/src/IrrlichtDevice.cpp +++ b/src/IrrlichtDevice.cpp @@ -20,6 +20,7 @@ */ #include +#include #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); + } } -- 2.39.5