I could use a little bit of help. I am new to the principles of OpenGL. I have no trouble with the mathematical aspects of 3D geometry. My difficulty is in actually rendering the image. When I try to execute my program, the window that should be showing the graphic instead simply takes a picture of whatever is on the screen at the time. Below are some parts of the source code, some of which was auto-generated by Code::Blocks. My geometric algorithm shall not be revealed for the time being. If this is a stupid question, then I apologize for wasting your time.

/*** (1) open a connection to the X server ***/
std::cout<<"Enter the length of vertex of the cube to be doubled:";
std::cin>>first;
start = (GLfloat)first;
dpy = XOpenDisplay(NULL);
if (dpy == NULL)
{
fatalError("could not open display");
}

You are probably not swapping buffers - so the screen is never updated.

BTW, please use code tags!

Dark Photon

06-26-2012, 05:46 AM

In particular, add:

glXSwapBuffers( dpy, win );

when needRedraw is true.

Darth_Malloc

07-10-2012, 10:45 PM

Thank you for that tip. The problem of the window taking a picture of the screen is fixed. Unfortunately, when I run the program, the window simply goes dark, and does not show any images. What must I do to keep the display progressing?

A well-placed shot nonetheless, even though Han shot Greedo first. Thank you for your help. For those interested, I may post a video showing the final result of my work in action. It is a Pythagorean mathematical concept, but I shall say no more for now.