Sign in to follow this  
Zen721

Problem Flashing object

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
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

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