i figure this is about as simple as it gets...
Code:
#include <windows.h>
#include <gl/glut.h>
GLvoid Render(GLvoid)
{
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
// do your drawing here
}
GLvoid Initialize(GLvoid)
{
glClearColor(0.0f,0.0f,0.0f,1.0f);
glClearDepth(1.0f);
// do your initializing here
}
GLvoid Resize(GLint Width,GLint Height)
{
if (Height == 0)
{
Height = 1;
}
glViewport(0,0,Width,Height);
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
gluPerspective(45,(float)Width/(float)Height,1.0f,100.0f);
glMatrixMode(GL_MODELVIEW);
glLoadIdentity();
}
main()
{
glutInitDisplayMode(GLUT_DOUBLE | GLUT_RGBA);
glutCreateWindow("OpenGL");
glutDisplayFunc(Render);
glutReshapeFunc(Resize);
Initialize();
glutMainLoop();
return 0;
}