Irrlicht + Qt: X Error: BadWindow (invalid Window parameter)

You are an experienced programmer and have a problem with the engine, shaders, or advanced effects? Here you'll get answers.
No questions about C++ programming or topics which are answered in the tutorials!
Post Reply
Donner
Posts: 87
Joined: Fri May 18, 2007 11:27 am

Irrlicht + Qt: X Error: BadWindow (invalid Window parameter)

Post by Donner »

Hi,

I'm trying to embedd Irrlicht into a Qt GUI.

For the Irrlicht Widget I created a class that has QGLWidget as base class.

In the constructor I'm doing everything to enable the widget as a widget in which Irrlicht can paint:

Code: Select all

setAttribute(Qt::WA_OpaquePaintEvent);
setAttribute(Qt::WA_NoSystemBackground);
setAttribute( Qt::WA_PaintOnScreen, true );
Nevertheless I get the following error when I take the window handle and let Irrlicht use it as render target:
X Error: BadWindow (invalid Window parameter)
From call : X_ChangeWindowAttributes

I searched the web for a solution, but nothing really helped.

Is there a way for me to get the information, what EXACTLY is going wrong? Can I find out what causes the "X Error: BadWindow..."-Error?

Thanks a lot,
D.

PS: the software renderer works fine with this widget...
Escen
Competition winner
Posts: 167
Joined: Sun Jul 19, 2009 11:27 am
Location: the Netherlands
Contact:

Post by Escen »

Not sure if you already know, but there is a working class in this topic here, QWidget as base class.
Is there an specific reason to use an QGLWidget?
Donner
Posts: 87
Joined: Fri May 18, 2007 11:27 am

Post by Donner »

Hm, I didn't use that widget because it had some problems so i took another one... which worked fine with DirectX and the software renderers...

In the thread you posted someone wrote that OpenGL can only render into one window per thread... is that true? That might explain the problem...
Escen
Competition winner
Posts: 167
Joined: Sun Jul 19, 2009 11:27 am
Location: the Netherlands
Contact:

Post by Escen »

If you create two OpenGL rendering contexts for two different threads, then most drivers will fail if you try to render with both of them in the same window.
Technically, this multithreading should be possible but the extra work you place on the driver with two contexts trying to share the same framebuffer will most likely outweigh any performance benefit.
Personally I only use two different windows, each with its own rendering context and thread, at-least that works for me.
Donner
Posts: 87
Joined: Fri May 18, 2007 11:27 am

Post by Donner »

Well i'm trying to render into multiple widgets within one application (and thread) - that should be possible, shouldn't it?
Post Reply