View Full Version : Using GLUT, windows are transparent. Configuration problem?
09-18-2005, 10:41 AM
Hiya. I've just started on the red book, and when trying the first GLUT example I don't get any rendering. The new window is not blank, it displays whatever was behind the window when it was created.
I'm running FreeBSD 6.0, Xorg, and WindowMaker. OpenGL is enabled in xorg.conf (the OpenGL screensavers in xscreensaver work fine).
The source (a modified version of hello.c) compiles and links without errors, and liberal calls to glGetError() haven't showed any errors. A few printf() lines were added to the display() function to test that it's really being executed (it is).
Any help would be greatly appreciated.
Just yell if any other info is needed to diagnose. (source? output of glxinfo? screen capture?)
ETA: I found older, similar topics suggesting that it's a driver issue, but is that possible since other OpenGL applications still work?
09-18-2005, 09:44 PM
The source code might be useful to have a look at.
09-18-2005, 10:20 PM
Thanks for the quick response, Mikael.
Here's the source:
#define CHKERR if (glGetError() != GL_NO_ERROR) printf("oops\n");
glColor3f(1.0, 1.0, 1.0);
glVertex3f(0.25, 0.25, 0.0);
glVertex3f(0.5, 0.75, 0.0);
glVertex3f(0.75, 0.25, 0.0);
printf(" display(): FLAG\n");
glClearColor(0.0, 0.0, 1.0, 0.0);
glOrtho(0.0, 1.0, 0.0, 1.0, -1.0, 1.0);
int main(int argc, char** argv)
glutInitDisplayMode(GLUT_SINGLE | GLUT_RGB);
}This was compiled with:
cc -I/usr/X11R6/include -L/usr/X11R6/lib -lX11 -lGL -lGLU -lXext -lglut -ohello hello.c
I also tried leaving out various libs, once with only glut. All with the same result.
Works fine for me on XP with msvc 6.
09-21-2005, 08:49 PM
Thanks for the heads up Zenix. It's good to get confirmation that it isn't the code.
So has anyone else seen this transparent window thing? While configuration advice would be more directly applicable from Linux/BSD users, I could certainly use some pointers from the Windows/Mac people that have seen something similar.
09-21-2005, 10:44 PM
i suppose that your window is not really transparent. if you move it around,
its contents stays the same, right? it seems that the window buffer is not updated when you call
glFlush(). what happens when you create a double-buffered window (don't forget to call
09-21-2005, 11:31 PM
Yes, that's exactly right. Also, whenever a window is dragged in WindowMaker the coordinates of the window are displayed. These display boxes, like the background, "stick" in the opengl window instead of disappearing after dragging is complete. Here's a jpg of the single buffer, "transparent" window (http://www.jumbledpile.com/images/misc/opengl_error.jpg) .
There are a bunch of "display(): FLAG" lines of output while dragging, so it looks like the display() function is being called for each new coordinate box.
I tried a double buffered window with the following changes:
< glutInitDisplayMode(GLUT_SINGLE | GLUT_RGB);
> glutInitDisplayMode(GLUT_DOUBLE | GLUT_RGB);I don't get a blank window anymore, which is good, but instead I get a solid magenta window (http://www.jumbledpile.com/images/misc/opengl_error2.jpg) , which is not good even though I'm happy to see a new side of the problem.
BTW, for the double buffered case, the coordinates displayed by the window manager disappear after dragging is complete, as expected. The opengl window is "correctly" redrawn as completely solid magenta.
09-22-2005, 08:00 AM
i've finally managed to install GLUT, and i'm almost sorry that i have to say: it works!
i compiled the first version that you posted, with a single buffer, and i get a white triangle
on a blue background. the problem does not seem to be in your code.
what does glxinfo say? are there any other programs on your computer, which use opengl and run
correctly, e.g. glxgears?
09-22-2005, 08:59 AM
I'm having the exact same problem with my program for a Graphics assignment, and have been trying everything to get something drawn. The double buffering doesn't seem to have any effect on mine.
09-22-2005, 06:26 PM
All of the OpenGL screensavers in xscreensaver work fine, as does glxgears, so it seems like whatever I'm missing is probably something small and easy to fix.
Here is my output from glxinfo (http://www.jumbledpile.com/glxinfo.txt) and from glxgears -info (http://www.jumbledpile.com/glxgears.txt) . I notice that GLUT isn't mentioned anywhere, even though these are present:
/usr/X11R6/lib/libglut.so -> libglut.so.3
Does that mean something is off with just the GLUT installation? The package libglut-6.0.1 was automatically installed as a requirement for xscreensaver, so I think I've got a handle on what to look for.
I'll update if I can get it working.
10-14-2005, 08:51 PM
Quick update, in case anyone else is having the same problem.
According to a few relevant threads from the FreeBSD lists, the problem is that DRI must be enabled (http://lists.freebsd.org/pipermail/freebsd-stable/2005-October/018645.html) .
Here are a few useful places to check out:
DRI Wiki - Building (http://dri.freedesktop.org/wiki/Building)
DRI on BSD (http://people.freebsd.org/~anholt/dri/)
ATI Mobility Radeon 9600 driver (http://www.thinkwiki.org/wiki/ATI_Mobility_Radeon_9600)
10-16-2005, 01:42 AM
Direct rendering is now enabled, and everything works fine!
Powered by vBulletin® Version 4.2.3 Copyright © 2016 vBulletin Solutions, Inc. All rights reserved.