From 0c7552e0423eaefafa57e2138fed9664225a81d8 Mon Sep 17 00:00:00 2001 From: Javier Sancho Date: Thu, 3 Oct 2019 12:00:45 +0200 Subject: [PATCH] Return pointer to device --- include/cirrlicht.h | 12 ++++++------ src/CIrrlicht.cpp | 21 +++++++++++---------- 2 files changed, 17 insertions(+), 16 deletions(-) diff --git a/include/cirrlicht.h b/include/cirrlicht.h index dd5029c..ca7434c 100644 --- a/include/cirrlicht.h +++ b/include/cirrlicht.h @@ -29,12 +29,12 @@ extern "C" { #endif - int irr_createDevice(irr_video_E_DRIVER_TYPE deviceType, - const irr_core_dimension2d_u32* windowSize, - u_int32_t bits, - bool fullscreen, - bool stencilbuffer, - bool vsync); + void* irr_createDevice(irr_video_E_DRIVER_TYPE deviceType, + const irr_core_dimension2d_u32* windowSize, + u_int32_t bits, + bool fullscreen, + bool stencilbuffer, + bool vsync); #ifdef __cplusplus } diff --git a/src/CIrrlicht.cpp b/src/CIrrlicht.cpp index d079cf9..e87663d 100644 --- a/src/CIrrlicht.cpp +++ b/src/CIrrlicht.cpp @@ -23,19 +23,20 @@ #include "cirrlicht.h" extern "C" { - int irr_createDevice(irr_video_E_DRIVER_TYPE deviceType, - const irr_core_dimension2d_u32* windowSize, - u_int32_t bits, - bool fullscreen, - bool stencilbuffer, - bool vsync) + void* irr_createDevice(irr_video_E_DRIVER_TYPE deviceType, + const irr_core_dimension2d_u32* windowSize, + u_int32_t bits, + bool fullscreen, + bool stencilbuffer, + bool vsync) { irr::core::dimension2d wsize = \ irr::core::dimension2d(windowSize->width, windowSize->height); - irr::createDevice((irr::video::E_DRIVER_TYPE)deviceType, - wsize, bits, fullscreen, stencilbuffer, - vsync); - return 0; + irr::IrrlichtDevice *device = \ + irr::createDevice((irr::video::E_DRIVER_TYPE)deviceType, + wsize, bits, fullscreen, stencilbuffer, + vsync); + return device; } } -- 2.39.5