I am programming in C with GLUT and OPENGL, I want my window to redraw again. I know that I can reerender with glutPostRedisplay() if I put it in an idle Glut my pc lags function.
My code is following atm
void on_idle() { glutPostRedisplay(); } void on_draw() { ... glClearColor(1.f, 1.f, 1.f, 1.f); glClear(GL_COLOR_BUFFER_BIT); ... glFlush(); } int main(int argc, char** argv) { ... glutDisplayFunc(&on_draw); glutIdleFunc(&on_idle); ... }
c draw opengl glut
no_name
source share