Sign in to follow this  
ViolentAJ

Redrawing After Init()

Recommended Posts

Does anyone know how to redraw stuff after init()? My init() function calls this: void init(void){ glViewport(0, 0, ww, wh); // set projection / clipping box glMatrixMode(GL_PROJECTION); glLoadIdentity(); gluOrtho2D(0.0, (GLdouble) ww, 0.0, (GLdouble) wh); // set clear color to black and clear window glClearColor (0.0, 0.0, 0.0, 1.0); glClear(GL_COLOR_BUFFER_BIT); glMatrixMode(GL_MODELVIEW); glFlush(); } My resize function calls init(). void reshape(GLsizei w, GLsizei h){ // set global size for use by drawing routine ww = w; wh = h; init(); } I'd like to keep the stuff in my screen after resizing. I think that I need the resize function so that I can properly do mouse movement of a player character. The player character is in a display list, but it doesn't seem to redraw, even chen I add a call to glCallList(1) in my reshape function.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this