I have a window size {0,0},{1e6,1e6}. I have created grids of 1000*1000 within this area.
I am trying to create random points in this area.
glEnable( GL_POINT_SMOOTH );
glEnable( GL_BLEND );
glPointSize( 200 );
for( int i = 0; i < 1e6; i++ )
{
glColor3ub(0,255,0);
// width and height are 1e6.
int x = rand() % WIDTH;
int y = rand() % HEIGHT;
glBegin( GL_POINTS );
glVertex2i( x, y );
glEnd();
}
glFlush();
glDisable( GL_BLEND );
x and y are random numbers. However, all points are drawn only in left bottom of the window.