From 25545149da1315152ac3971ef74a190965ddcf01 Mon Sep 17 00:00:00 2001 From: rkrolib Date: Thu, 9 Oct 2003 03:05:40 +0000 Subject: [PATCH] Fixed: * 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 --- .../demos/Fractals_random/fractals_random.c | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/freeglut/freeglut/progs/demos/Fractals_random/fractals_random.c b/freeglut/freeglut/progs/demos/Fractals_random/fractals_random.c index 8992d1e..324f00b 100644 --- a/freeglut/freeglut/progs/demos/Fractals_random/fractals_random.c +++ b/freeglut/freeglut/progs/demos/Fractals_random/fractals_random.c @@ -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);