* glutInit() ordering w.r.t. glutInit*() and {argv} processing.
 * Aspect ratio.
 * Removed depth-buffer usage.  (Also done for Fractals in previous
   commit...)


git-svn-id: https://svn.code.sf.net/p/freeglut/code/trunk@219 7f0cb862-5218-0410-a997-914c9d46530a
This commit is contained in:
rkrolib 2003-10-09 03:05:40 +00:00
parent 8bde679512
commit 25545149da

View File

@ -74,7 +74,7 @@ static void
Display(void)
{
if (needClear) {
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
glClear(GL_COLOR_BUFFER_BIT);
needClear = GL_FALSE;
}
@ -101,7 +101,10 @@ Reshape(int width, int height)
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
ar = (float) width / (float) height;
glFrustum(-ar, ar, -1.0, 1.0, 2.0, 100.0);
if( ar > 1 )
glFrustum(-ar, ar, -1.0, 1.0, 2.0, 100.0);
else
glFrustum(-1.0, 1.0, -1/ar, 1/ar, 2.0, 100.0);
glMatrixMode(GL_MODELVIEW);
glLoadIdentity();
xwin = -1.0 ;
@ -250,17 +253,17 @@ main(int argc, char *argv[])
{
int fractal_window ;
glutInitDisplayMode( GLUT_RGB | GLUT_SINGLE );
glutInitWindowSize(500, 250);
glutInitWindowPosition ( 140, 140 ) ;
glutInit(&argc, argv);
if ( argc > 1 )
readConfigFile ( argv[1] ) ;
else
readConfigFile ( "fractals.dat" ) ;
glutInit(&argc, argv);
glutInitWindowSize(500, 250);
glutInitWindowPosition ( 140, 140 ) ;
glutInitDisplayMode(GLUT_RGB | GLUT_SINGLE | GLUT_DEPTH);
fractal_window = glutCreateWindow( window_title );
glClearColor(1.0, 1.0, 1.0, 1.0);