x11 window bug

You discovered a bug in the engine, and you are sure that it is not a problem of your code? Just post it in here. Please read the bug posting guidelines first.
Post Reply
stefany
Posts: 58
Joined: Wed Dec 07, 2011 10:50 am

x11 window bug

Post by stefany »

In TRUNK rev.:5227

Code: Select all

 
bool CGLXManager::generateSurface()
{
    if (glxFBConfig)
    {
        GlxWin=glXCreateWindow((Display*)CurrentContext.OpenGLLinux.X11Display,(GLXFBConfig)glxFBConfig,CurrentContext.OpenGLLinux.X11Window,NULL);
        if (!GlxWin)
        {
            os::Printer::log("Could not create GLX window.", ELL_WARNING);
            return false;
        }
 
        CurrentContext.OpenGLLinux.X11Window=GlxWin;
    }
    return true;
}
 
CurrentContext.OpenGLLinux.X11Window=GlxWin;
What? Changing the X11 window for the GlxWindow?? That breaks the semantic of that variable. And furthermore, the code that rely on the videoExposedData can't manipulate the X11Window via Xlib.

I didn't had any problem with irr+x11 on the shader pipeline... i will investigate.
stefany
Posts: 58
Joined: Wed Dec 07, 2011 10:50 am

Re: x11 window bug

Post by stefany »

I came with a very simple solution... the opengl device stores the correct windowid in the creationParams member variable... so:

Code: Select all

Index: include/IrrlichtDevice.h
===================================================================
--- include/IrrlichtDevice.h    (revision 5227)
+++ include/IrrlichtDevice.h    (working copy)
@@ -15,6 +15,7 @@
 #include "IVideoModeList.h"
 #include "ITimer.h"
 #include "IOSOperator.h"
+#include "SIrrCreationParameters.h"
 
 namespace irr
 {
@@ -296,7 +297,9 @@
        /** This allows the user to check which windowing system is currently being
        used. */
        virtual E_DEVICE_TYPE getType() const = 0;
-
+       
+       virtual const SIrrlichtCreationParameters& getCreationParams() const = 0;//
+       
        //! Check if a driver type is supported by the engine.
        /** Even if true is returned the driver may not be available
        for a configuration requested when creating the device. */
Index: source/Irrlicht/CIrrDeviceStub.h
===================================================================
--- source/Irrlicht/CIrrDeviceStub.h    (revision 5227)
+++ source/Irrlicht/CIrrDeviceStub.h    (working copy)
@@ -141,6 +141,8 @@
 
        //! Resize the render window.
        virtual void setWindowSize(const irr::core::dimension2d<u32>& size) _IRR_OVERRIDE_ {}
+       
+       virtual const SIrrlichtCreationParameters& getCreationParams() const _IRR_OVERRIDE_ {return CreationParams;}
 
    protected:
 
CuteAlien
Admin
Posts: 9628
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Re: x11 window bug

Post by CuteAlien »

Yeah, that doesn't look correct. I guess it's not used internally, so it wasn't noticed. It was set to SIrrlichtCreationParameters.WindowId before, don't know why that was changed - probably accidental.
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
Post Reply