I have a task…
1.- I am displaying a matrix array using openGL each value is a intensity and its done.
2.- I need to refresh this windows with a new values, BUT the glutMainLoop() does not help…
the code is:
void graphfunct(void)
{
/*Here print the array just once and I cannot do the second T_T*/
}
I need to do this code with a new values on u[i][j], the main is:
glutInit(&argc, argv);
glutInitDisplayMode(GLUT_RGBA | GLUT_DEPTH | GLUT_DOUBLE);
glutInitWindowSize(500,500);
glutCreateWindow("1D Function");
glutDisplayFunc(graphfunct);
glutKeyboardFunc(exit);
glutMainLoop();
The problem is in the glutMainLoop(); this function in infinity and when start I cannot set new values on u[i][j].
Use GLUT timers to call
glutPostRedisplay()on a schedule or put one at the end ofgraphfunct()to redraw as fast as possible.