Jump to content
  • Advertisement
Sign in to follow this  
Zen721

Problem Flashing object

This topic is 4444 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

When i run this code my texture and quad is still flushing it is not render smooth i'm using glut library to display objects... void display() { GLuint MenuList; MenuList = glGenLists(1); glNewList(MenuList, GL_COMPILE); glClear (GL_COLOR_BUFFER_BIT); gluLookAt (0.0, 0.0, -20.0, 0.0, 0.0, 0.0, 0.0, 3.0, 0.0); glEnable(GL_TEXTURE_2D); zdjecie.inicjalizuj_zdjecia(); zdjecie.wczytaj_zdjecia(); /* glBegin(GL_QUADS); glTexCoord2i(0,0);glVertex2i(0, 0); glTexCoord2i(0,1);glVertex2i(0, 10); glTexCoord2i(1,1);glVertex2i(10, 10); glTexCoord2i(1,0);glVertex2i(10, 0); glEnd(); */ GLint TexArray[] = {0,0,0,1,1,1,1,0}; GLint QuadArray[] = {0,0,0,10,10,10,10,0}; glEnableClientState(GL_VERTEX_ARRAY); glEnableClientState(GL_TEXTURE_COORD_ARRAY); glVertexPointer(2,GL_INT, NULL, &QuadArray); glTexCoordPointer(2, GL_INT, NULL, &TexArray); glDrawArrays(GL_QUADS, 0, 8); glFlush(); glEndList(); glCallList(MenuList); glutPostRedisplay(); }

Share this post


Link to post
Share on other sites
Advertisement
Foobar of Integers is right. You cannot put glFlush(), glFinish() or any client related commands inside a display list.

Please compile a display list outside of your display() callback function.(build a DL only once) Then call the display list inside display() by using glCallList().

The flushing may happen because of single frame buffer. Did you enable double buffer? Then use glutSwapBuffers() instead of glFlush()

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!