Issue with GLX/X11 on Ubuntu not showing correct Window Contents

Started by
4 comments, last by cgrant 10 years ago

I'm in the process of porting my engine across to Linux support.

I can successfully create a window, and set up an OpenGL context however, the contents of the window are whatever was displayed behind it at the time of creation. NOTE: This is not a transparent window, if I drag the window around it still contains an 'image' of whatever was behind it at the time of creation. (See attached image).

Now I'm not sure where the issue could be, however I'm not looking for a solution to a specific issue in my code, mainly just any insight from other Linux/GLX developers who may have seen a similar issue and might know where I should start looking?

Cheers!

Advertisement
Have you tried clearing it with glClear(GL_COLOR_BUFFER_BIT) then swapping the buffers? Sounds like you're just looking at a garbage front buffer

I stripped all the code in my update function right down to just be:

glClear(GL_DEPTH_BUFFER_BIT | GL_COLOR_BUFFER_BIT);

glXSwapBuffers(dpy, win);

With no joy. My first thought was that it was garbage, but with just those calls I'd expect to the see the glClearColor().

Did you make the context current with glXMakeCurrent? Did you check for errors with glGetError?

Derp

glGetError() returns no errors anywhere in my application.

Immediately after glXCreateContext() I then call glXMakeCurrent() and calling glGetIntegerv() with GL_MAJOR_VERSION and GL_MINOR_VERSION returns 4 and 2 (4.2) respectively which indicates the GL context has been created successfully.

I tried having a glXMakeCurrent() call immediately before I try my glClear/glXSwapBuffers() but to effect.

Further info I should have mentioned before, this is a multithreaded application, however all X11/GLX/OpenGL calls are only made by a single thread. I have also tried calling XInitThreads() from the main application thread, and from the Rendering thread with no luck either.

I'm assuming you called XFlush after creating the window and a glXWaitX after sizing.

This topic is closed to new replies.

Advertisement