[Solved] Modify createDevice() source code

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Post Reply
BillyCallahan
Posts: 26
Joined: Fri Jun 19, 2015 6:51 am

[Solved] Modify createDevice() source code

Post by BillyCallahan »

Hello,

Here's my problem: I've an Irrlicht DLL that is implemented into a delphi application, but instead of being launched as a new window I'd like that the dll is launched into the delphi's window and not as a new process.
I already succeed to melt the screen between them but I still have a window into a window.

So I thought, what if I ask createDevice to draw directly into my delphi's window ?
I tried to find the createDevice's declaration, without any success...

Any kind of idea ?

Billy :)

P.S: I apologize for my poor english.
Last edited by BillyCallahan on Fri Jun 19, 2015 2:18 pm, edited 1 time in total.
CuteAlien
Admin
Posts: 9734
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Re: Modify createDevice() source code

Post by CuteAlien »

I don't know the Delphi wrapper, but Irrlicht has usually createDeviceEx. That can take a window-handle for an existing Window. Example 14.Win32Window shows how to use that.
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
BillyCallahan
Posts: 26
Joined: Fri Jun 19, 2015 6:51 am

Re: Modify createDevice() source code

Post by BillyCallahan »

Oh thanks man, this helped me a lot :)

I'm now stuck here:

Code: Select all

smgr->drawAll();
When the dll executes it, the dll crashes and I get an error from Delphi (comes from Irrlicht.dll) : "Floating point division by zero".

Here's my Irrlicht code:

Code: Select all

int main(HWND delphiHwnd){
.
.
.
irr::SIrrlichtCreationParameters param;
    param.WindowId = reinterpret_cast<void*>(delphiHwnd);
    param.DriverMultithreaded = driverType;
    param.WindowSize = core::dimension2d<u32>(640, 400);
    param.Bits = 16;
    param.Fullscreen = false;
 
    IrrlichtDevice *device =
        createDeviceEx(param);
 
Any idea :D ?
BillyCallahan
Posts: 26
Joined: Fri Jun 19, 2015 6:51 am

Re: Modify createDevice() source code

Post by BillyCallahan »

Oops, got my answer: I put param.DriverMultiThreaded...
Well :roll:
Post Reply