GLUT window opends without the title bar

I just started to learn opengl and tried to open a simple window using glut.

problem is that the window is opened without the title bar. just a blank square with no border of a standard window.

How can I make the borders appear (I have no need in a menu bar, only the title bar)

The code :

#include <stdlib.h>
#include <GL/glut.h>

void renderScene(void);

int main(int argc, char **argv) {

glutInit(&argc, argv);
glutInitWindowPosition(-1, -1);
glutInitWindowSize(500, 500);	
glutInitDisplayMode(GLUT_RGB | GLUT_SINGLE | GLUT_DEPTH);

glutCreateWindow("A Simple Window");
glutDisplayFunc(renderScene);
glutMainLoop();

return 0;

}

void renderScene(void) {
glClear(GL_COLOR_BUFFER_BIT);
glFlush();
}

thx.

Can you inform us on what environment you are working on, I don’t think this is due to GLUT, as far as I know, there is not even a function that could make appear/disappear the window title bar.

Do you use compiz?

I work with linux ubuntu. Could it be a problem with the glut libs ?

Other tried and it worked on their side.

I don’t think the problem is with glut. I already had a similar bug when running a glut application with compiz enabled and an ATI card.

Try to disable compiz if you have an ATI card.

Guess what, I have an ATI card :slight_smile:
What is compiz and how can I disable it ?

thx alot.

Compiz is a window manager that uses hardware acceleration via opengl. It enables many effects like 3d desktop. You will find more information googling.

To disable/enable it graphically, install the compiz-swith package with synatic. Or try this in command line:

killall compiz.real && killall compiz && metacity --replace --display :0 &

This topic was automatically closed 183 days after the last reply. New replies are no longer allowed.