Thanks for the replies. I have modified it so that it uses glutPostRedisplay() instead of calling the render function itself. It still has a memory leak. Also, changing the idle function to be the display function is not something I want to do, since it changes how my program operates.
Here is what I was just testing:
#include <iostream>#include <GL/glut.h>using namespace std;void Display();void LoopFunction();unsigned int i = 0;void Display(){ glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); glutSwapBuffers();}void InitializeGlut(int argc, char** argv){ glutInit(&argc, argv); glutInitDisplayMode(GLUT_DOUBLE | GLUT_RGBA | GLUT_DEPTH); glutInitWindowPosition(100, 100); glutInitWindowSize(400, 400); glutCreateWindow("hatfat"); glutDisplayFunc(Display); glutIdleFunc(LoopFunction);}void LoopFunction(){ //only printing so my computer doesn't lock up as bad printf("%d\n", i); i++; glutPostRedisplay();}int main(int argc, char **argv){ InitializeGlut(argc, argv); const GLubyte *pVersion = glGetString(GL_VERSION); printf("VERSION = %s\n", pVersion); glutMainLoop(); return 0;}