newpaint2.c
/* rehaping routine called whenever window is resized
or moved */
rehaping routine called whenever window is resized
or moved
rehaping routine called whenever window is resized or moved
void myReshape(GLsizei w, GLsizei h)
{
        glMatrixMode(GL_PROJECTION);
        glLoadIdentity(); 
        glOrtho(0.0, (GLdouble)w, 0.0, (GLdouble)h, -1.0, 1.0);
        glMatrixMode(GL_MODELVIEW);
        glLoadIdentity(); 
        glViewport(0,0,w,h);
    glClearColor (0.8, 0.8, 0.8, 1.0);
        glClear(GL_COLOR_BUFFER_BIT);
        display();
        glFlush();
        ww = w;
        wh = h; 
}
void myReshape ( GLsizei w , GLsizei h ) { glMatrixMode ( GL_PROJECTION ) ; glLoadIdentity ( ) ; glOrtho ( 0.0 , ( GLdouble ) w , 0.0 , ( GLdouble ) h , -1.0 , 1.0 ) ; glMatrixMode ( GL_MODELVIEW ) ; glLoadIdentity ( ) ; glViewport ( 0 , 0 , w , h ) ; glClearColor ( 0.8 , 0.8 , 0.8 , 1.0 ) ; glClear ( GL_COLOR_BUFFER_BIT ) ; display ( ) ; glFlush ( ) ; ww = w ; wh = h ; }
rehaping routine called whenever window is resized
or moved
rehaping routine called whenever window is resized or moved
/* adjust clipping box */ /* adjust viewport and  clear */ /* set global size for use by drawing routine */