Render into multiple windows with only one IrrlichtDevice

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
sgqfpu
Posts: 11
Joined: Mon Apr 28, 2014 1:50 pm
Location: Taiwan

Render into multiple windows with only one IrrlichtDevice

Post by sgqfpu »

Hi all,

http://www.irrlicht3d.org/pivot/entry.php?id=347
introduces how to render into multiple window controls with only one IrrlichtDevice. The blog seems to not allow leaving comments any more, so...

There was a typo in the article, by the way. It shall be beginScene not endScene.

The beginScene seems to evolve greatly in these years. For example, it also works on Linux with either of EDT_OPENGL and EDT_SOFTWARE. However it seems still not to work with EDT_OPENGL on Windows, though there is a nested structure OpenGLWin32 inside video::SExposedVideoData. Maybe it does support it now. I just want to make sure of this, because there is no information in the API document and the header files. So, the question is: Does beginScene support EDT_OPENGL on Windows now?

Thanks in advace.
thanhle
Posts: 325
Joined: Wed Jun 12, 2013 8:09 am

Re: Render into multiple windows with only one IrrlichtDevic

Post by thanhle »

Recommend to search this forum.
There are a number of topics cover this related question.
Basically video::SExposedVideoData is call for each window's handle SExposedVideoData((void*)Handle.

Regards,
Thanh
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Re: Render into multiple windows with only one IrrlichtDevic

Post by hybrid »

Yes, Irrlicht works with OpenGL on Windows :-D Also, we have example 14, which shows how to integrate several windows with all renderers under Windows, i.e. with manually created WinAPI windows. It's part of your Irrlicht SDK.
sgqfpu
Posts: 11
Joined: Mon Apr 28, 2014 1:50 pm
Location: Taiwan

Re: Render into multiple windows with only one IrrlichtDevic

Post by sgqfpu »

Thanks for the replies. I was asking this question because my Irrlicht + wxWidgets program ran perfectly in Linux, but not went well in Windows. I have to replace EDT_OPENGL with EDT_SOFTWARE, otherwise all the window controls that are supposed to render the scene will be empty. Now I know it's my fault. I misused Irrlich. I'll read Tutorial 14 to improve my understanding of Irrlich. Thank you hybrid. You help me a lot. I really appreciate it.
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Re: Render into multiple windows with only one IrrlichtDevic

Post by hybrid »

The problem with widget libs is often that they use their own set of flags to create the windows. And to setup OpenGL the way they need it. This can interfere with Irrlicht's requirements. But it should be possible in general. sometimes the tweaks needed are just a little more involved.
sgqfpu
Posts: 11
Joined: Mon Apr 28, 2014 1:50 pm
Location: Taiwan

Re: Render into multiple windows with only one IrrlichtDevic

Post by sgqfpu »

Thanks for the information. I really appreciate it. You do help me a lot. Really really thank you.

Sorry to ask another novice question. I followed the instruction and copied some codes from "Tutorial 14: Win32 Window". It now has something animating in the window control, but it doesn't have color on the 3d models. I have 2 models in the scene. One is completely gray, and another is white.

The (almost) same codes works without any problem on Linux. The texture images were correctly shown. It doesn't need wglCreateContext, wglShareLists, etc. I don't know what those functions are, to be honest. I don't have any 3d programming experience before.

By the way, I didn't link against wxGL, a part of the wxWidgets. I believe it doesn't do anything to trouble Irrlicht.

One more thing. I compiled the example program 14.Win32Window on Windows in my VirtualBox, and the program doesn't show anything, not even a empty window. It ran like an empty console program like "int main() {}". I don't know if it's the virtual environment to be blamed.

Thanks.
sgqfpu
Posts: 11
Joined: Mon Apr 28, 2014 1:50 pm
Location: Taiwan

Re: Render into multiple windows with only one IrrlichtDevic

Post by sgqfpu »

Below is my buggy program running. The textures of the 3d models were not shown. Any help and hint will be highly appreciated. Thanks in advance.
Image
sgqfpu
Posts: 11
Joined: Mon Apr 28, 2014 1:50 pm
Location: Taiwan

Re: Render into multiple windows with only one IrrlichtDevic

Post by sgqfpu »

I've been stuck in this problem for almost a month now. T_T
My conclusion is that on Windows the Irrlicht engine doesn't really support rendering the same scene to different windows, when the driver type is EDT_OPENGL.
It does work on Linux, but not Windows. The users of Irrlicht shall have OpenGL background to write some OpenGL-specific codes to workaround it. The best I've got is this
Image
where the left side window is created before the right side.

I followed "Tutorial 14: Win32 Window" offered by "Irrlicht Engine 1.8 API documentation" and also thoroughly read Creating an OpenGL Context (WGL) - OpenGL.org, but still can't have any texture shown on the 3d models. After many "trial and error", inserting a wglMakeCurrent after wglCreateContext luckily got one of the window show the texture. However, it incurs another problem. When the program exits, SIGSEGV happens due to some weird OpenGL functions, of which the callstack can be seen on debugger. Without debugger, the SIGSEGV won't be noticed.

By the way, other than Irrlicht, the above application only depends on Win32 API. It doesn't use wxMSW or anything.
Post Reply