glutTimerFunc isnt making a delay it just loops forever. Like fxp. while(1).
Did I something wrong? Or is it a compatibility issue?
I am using arch linux x64 with gcc. And I've been kinda mixing 32 bit programs with 64 bit ones.
I am trying to make a program that checks for input whilst updating frames constantly under a delay
My includes are:
#include <GL/glut.h>
#include <GL/glu.h>
#include <stdio.h>
#include <string.h>
And my main functions are:
void timer(void)
{
glutPostRedisplay();
glutTimerFunc ( 30 , mainloop , 0 );
}
int main() {
loadconfiguration();
char *myargv [1];
int myargc=1;
myargv [0]=strdup ("./file");
glutInit(&myargc, myargv);
glutInitDisplayMode(GLUT_DOUBLE | GLUT_RGBA | GLUT_DEPTH);
glutInitWindowPosition(100, 100);
glutInitWindowSize(displayx, displayy);
printf("Making a window\n");
winIDMain = glutCreateWindow("GL Game");
mainloop();
}
void mainloop(void){
Initilize();
glutSetWindow (winIDMain);
glutDisplayFunc (render);
glutReshapeFunc (reshape);
glutKeyboardFunc (keyboard);
glutMouseFunc (mouse);
glutIdleFunc (timer);
glutMainLoop();
}
Don't worry other functions are clean :)
The code worked earlier I don't know why it doesn't work now.