Hi - I am using a Radeon 9000 pro with the ATI drivers on my system. I was doing some of the simple examples in Computer Graphics Using Open GL. I have never had this happen before, but whenever I compile and run the program, id does what it is supposed to except that it keeps the underlying background as though a window trancparency were enables (I use enlightenment if that helps). Could somebody point me in a direction? I have no idea what could be causing this. If anyone needs to see my small progrma, here it is:
#include X11/Xlib.h
#include GL/gl.h
#include GL/glu.h
#include GL/glut.h
#include cstdlib
//carrots removed because message board thinks it is HTML
class GLintPoint{
public:
GLint x,y;
};
int random(int m)
{
return rand()%m;
}
void drawDot(GLint x, GLint y)
{
//draw dot at integer point (x,y)
glBegin(GL_POINTS);
glVertex2i(x,y);
glEnd();
}
void myInit(void)
{
glClearColor(0.0,0.0,0.0,0.0); //black background color
glColor3f(1.0f,1.0f,1.0f); //set drawing color
glPointSize(2.0); //dot is 4x4 pixels
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
gluOrtho2D(0.0,640.0,0.0,480.0);
}
void Sierpinsky(void)
{
GLintPoint T[3]={{10,10},{300,30},{200,300}};
int index = random(3); //0,1,2 equally likely
GLintPoint point = T[index]; //initial point
drawDot(point.x,point.y); //draw initial point
for(int i = 0;i < 1000;i++) //draw 100 dots
{
index = random(3);
point.x = (point.x + T[index].x) / 2;
point.y = (point.y + T[index].y) / 2;
drawDot(point.x,point.y);
}
glFlush();
}
int main(int argc, char** argv)
{
glutInit(&argc, argv); //initalize toolkit
glutInitDisplayMode(GLUT_SINGLE | GLUT_RGB); //set display mode
glutInitWindowSize(640,480); //set window size
glutInitWindowPosition(100,150); //set wondow position
glutCreateWindow("Sierpinski Triangle"); //open the window
glutDisplayFunc(Sierpinsky); //register redraw function
myInit();
glutMainLoop(); //Loop forever and ever
return(0);
}
Any help or ideas would be appriciated. I have no idea where to begin. Thanks!