View Full Version : Opengl trouble

January 12th, 2010, 04:06 AM
I am trying to learn opengl; my problem is that after I compile and run an opengl program *sometimes* the image is not displayed properly, other times it displays fine. I have included pictures to better explain what I mean.

It is very frustrating, and I am not sure what the problem is.

The first attached image show what the program *should* display; the second two show what often happens when I compile the program -- the image just displays whatever is behind it.

I use geany and compile with:
g++ -Wall -lGL -lGLU -lglut -O "%f"

and use ./a.out to run the program...

CODE I am trying to run:
http://http://pastebin.com/m3b0fc2ba (http://http//pastebin.com/m3b0fc2ba)

see attached photos for output...

January 12th, 2010, 03:42 PM
I am having problem too with opengl. try turning off your desktop effects. it will get rid of some of the problems.
aaron tanenbaum

January 13th, 2010, 04:00 AM
Your pastebin link is invalid.

I'm pretty sure it should be http://pastebin.com/m3b0fc2ba.

I can't say what the problem is exactly, but I am wondering: How did you get the image where everything is shown correctly (the first one). What did you do different in that example?