   OpenGL C++ Mandelbrot Set
  I want to create a program to draw the Mandelbrot set on the screen, so far I can fill the screen with white dots. What I need is to draw the Mandelbrot set, but for some reason the program just freezes, if anybody can help me I would really appretiate it. glClear(GL_COLOR_BUFFER_BIT); glColor3f( 1, 1 , 1); glBegin(GL_POINTS); glColor3f( 1, 1, 1); // Fill Window with White dots  for ( x = -300; x <= 300; x++)  {  for ( y = -300; y <= 300; y++)   { RStep = x/300; IStep = y/300;   glVertex2f( RStep, IStep);  }  }  //glColor3f( 0, 1 , 1);  for ( x = -300; x <= 300; x++)  {  for ( y = -300; y <= 300; y++)   {   if( x*x + y*y < (2*2) &&  counter < 50 ) {  y = 2*zx*zy + y;  x = zx;  count = count + 1;  }//end if  if(counter == 50) {  glVertex2f( x/300, y/300); } }//end for  }//end for glEnd(); glFlush();[Edited by - Chrystian on September 9, 2007 11:33:11 AM]
  Silly question, I don't see the glEnd().   ;  Silly answer, I did not put the rest of the code, I just need help with the algorithm. I know that I did not put the code for the variables and the glend and glflush.;Quote:Original post by Chrystian    for ( x = -300; x <= 300; x++)    { for ( y = -300; y <= 300; y++) {    if( x*x + y*y < (2*2) &&  counter < 50 ){ y = 2*zx*zy + y; x = zx;    }//end if }//end for    }//end for What are the values of zx and zy? Won't changing the values of x and y mess up the for-loops?   