Jump to content
  • Advertisement
Sign in to follow this  
ViolentAJ

Redrawing After Init()

This topic is 3201 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

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
Advertisement
Nevermind. It works after commenting out gluOrtho2D(0.0, (GLdouble) ww, 0.0, (GLdouble) wh); and using glCallList(1); and glutPostRedisplay(); in my redisplay function.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!