How does Irrlicht present the images to the window? (WINAPI)

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
Mel
Competition winner
Posts: 2292
Joined: Wed May 07, 2008 11:40 am
Location: Granada, Spain

How does Irrlicht present the images to the window? (WINAPI)

Post by Mel »

I try to figure out what Irr does to present the images to the window client (this is a WINAPI question), but i don't ever get to step on a "RedrawWindow" or an "InvalidateRect" And I am wondering which approach would be faster. The idea is to cause a window redraw in an application, but for now, i can't find which would be the fastest way.
"There is nothing truly useless, it always serves as a bad example". Arthur A. Schmitt
CuteAlien
Admin
Posts: 9734
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Re: How does Irrlicht present the images to the window? (WIN

Post by CuteAlien »

No idea if it's the fastest/best way, but it seems Irrlicht uses the code in CIrrDeviceWin32::present
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
Mel
Competition winner
Posts: 2292
Joined: Wed May 07, 2008 11:40 am
Location: Granada, Spain

Re: How does Irrlicht present the images to the window? (WIN

Post by Mel »

But when is it called? It just copies an image generated within the engine independently of where, and pops it into the client area. The point is that it doesn't happen constantly, only when needed, and i'm curious as to how it happens. Perhaps the redrawing happens when some other event is managed? or... ? dunno, Windows programming isn't my strong point. I just don't feel very comfortable with RedrawWindow... seems like a forced solution
"There is nothing truly useless, it always serves as a bad example". Arthur A. Schmitt
CuteAlien
Admin
Posts: 9734
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Re: How does Irrlicht present the images to the window? (WIN

Post by CuteAlien »

CIrrDeviceWin32 is derived from video::IImagePresenter (which only has this present function). The only drivers needing this are the software drivers (as other drivers use opengl/directx to write and back-buffer and then flip it with front-buffer). The software drivers use it inside endScene.

Btw, I'm quite glad you asked that stuff, because I also didn't know about this before :-)
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
Mel
Competition winner
Posts: 2292
Joined: Wed May 07, 2008 11:40 am
Location: Granada, Spain

Re: How does Irrlicht present the images to the window? (WIN

Post by Mel »

It is what messing with Vulkan has XD They have their own swapchain engine, but it won't update the window for some reason (yet the swapchain works as expected...), thus, you need to refresh it manually. But i think it is very naively programmed, because slows down the whole thing a lot, so, i ask for the fastest way to tell a window to update. After seeing some things, i think it is more worth to try and create my own presenting routine than relying on Vulkan one. Or perhaps i am doing something completely wrong, who knows. Or to take a peek at the VK swapchain extension myself for some "enlightenment".
"There is nothing truly useless, it always serves as a bad example". Arthur A. Schmitt
Post Reply