createDevice vs. createDeviceEx

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
kormoran
Posts: 47
Joined: Mon Dec 28, 2015 4:50 pm
Location: Tolentino

createDevice vs. createDeviceEx

Post by kormoran »

I know that the latter allow more options, and I understand most of them. But there is one thing.

With createDevice I don't create any window, Irrlicht does, and I don't need to know anything about what's under it. With the "Ex" call I can create a window myself and then pass it to irrlicht for its device. Seems a rather clumsy way: is there a reason to do such thing (e.g. options that can only be set natively, circumventing some restriction in windows/linux/macOS, whatever)?

I mean, is there a situation where I must absolutely create a native window and then use createDeviceEx() instead of delegating the task to the regular createDevice()?
CuteAlien
Admin
Posts: 9734
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Re: createDevice vs. createDeviceEx

Post by CuteAlien »

Main reason is probably to use Irrlicht inside another API. For example Irrlicht with Qt, WTL, MFC and so on. There is even an example (14. Win32Window) which shows for example how to run Irrlicht on top of a button.

But also as you guessed - it can be used to set native stuff. Irrlicht uses pretty much typical default values for the window and there are situations where you might want to pass other settings than it uses (sorry, can't think of anything right now, but I know people needed it sometimes).
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
hendu
Posts: 2600
Joined: Sat Dec 18, 2010 12:53 pm

Re: createDevice vs. createDeviceEx

Post by hendu »

The fake fullscreen on Windows is one example.
Mel
Competition winner
Posts: 2292
Joined: Wed May 07, 2008 11:40 am
Location: Granada, Spain

Re: createDevice vs. createDeviceEx

Post by Mel »

I rather the expression "virtual" fullscreen, as it allows to swap between applications without the troubles of exitting and entering a real fullscreen modes :)
"There is nothing truly useless, it always serves as a bad example". Arthur A. Schmitt
kormoran
Posts: 47
Joined: Mon Dec 28, 2015 4:50 pm
Location: Tolentino

Re: createDevice vs. createDeviceEx

Post by kormoran »

This means that many different IrrlichtDevices can be used at the same time, embedded in other frameworks' controls. This is a scenario I never contemplated. Thank you :o
Post Reply