This appears to be more of an Irrlicht issue than it is Allegro, so this thread more or less functions as a way for me to get comments from Allegro developers about an
issue I've been having quite recently as they may be able to help shed some light on
it as well.
I'm using Irrlicht for a project and I'm trying to delegate Irrlicht to just being a renderer and so I've brought in Allegro to handle mouse/keyboard input which requires an Allegro display to be active, so I'm using the Irrlicht createDeviceEx method to initialize Irrlicht with the XID of the created Allegro window as such:
10 // Init Allegro & create a display
allegroDisplay = al_create_display(640
15 if (!
std::cout << "Failed to create Allegro Display" <<
18 return -1;
allegroDisplay, "Allegro/Irrlicht Test");
23 // Setup the creation parameters
irr::video::EDT_OPENGL; // If this is EDT_BURNINGSVIDEO or EDT_SOFTWARE, it behaves as expected.
creationParameters.WindowId = reinterpret_cast<void*>(
28 // Init Irrlicht
33 // Setup a scene so we can see if it actually renders
40 // Roll out a basic draw loop
41 while (
48 return 0;
I'll note right now that you'll need a source build of Allegro's unstable branch 5.1 because the al_get_x_window_id method was something I very recently implemented: https://github.com/liballeg/allegro5/pull/472
And this is literally all it does when called: https://github.com/liballeg/allegro5/blob/5.1/src/x/xwindow.c#L396 which simply returns the XID of the window.
The problem? The application exits when you try to initialize Irrlicht with an OpenGL video driver using an Allegro window with the following error:
1Linux 4.0.5-gentoo-tye #15 SMP Tue Aug 25 00:34:19 EDT 2015 x86_64
2X Error of failed request: BadMatch (invalid parameter attributes)
3 Major opcode of failed request: 153 (GLX)
4 Minor opcode of failed request: 31 (X_GLXCreateWindow)
5 Serial number of failed request: 22
6 Current serial number in output stream: 23
I've gone through and changed a bunch of Irrlicht initialization parameters as well as Allegro window creation parameters and none of it seems to have yielded any sort of effect on the output at all. The thing that has me especially confused is that it does work the way it should if you tell Irrlicht to use Burning's Video or the regular Software Renderer (as shown in the attached image.)
I'm not entirely sure why it isn't working with OpenGL, so I was hoping someone would be able to speculate on the issue at least.
Here is relevant system information:
ragora@tye ~ $ uname -
ragora@tye ~ $ gcc --
p1.6, pie-0.6.1) 4
Irrlicht Version 1.8.1 on an ~AMD64 Gentoo system using KDE4.