#include <stdlib.h>
#ifdef __APPLE__
#include <GLUT/glut.h>
#else
#include <GL/glut.h>
#endif

void init(void);
void display(void);
void reshape (int w, int h);
void keyboard(unsigned char key, int x, int y);


int main(int argc, char** argv)
{
   glutInit(&argc, argv);

   //Select Pixel Format/Device Context Attributes
   glutInitDisplayMode (GLUT_DOUBLE | GLUT_RGB | GLUT_DEPTH);

   //Configure Window
   glutInitWindowSize (512, 512);
   glutInitWindowPosition (100, 100);

   //Create the Window and Set Up Rendering Context
   glutCreateWindow ("Window Title Goes Here");

   //Configure Rendering Context
   init();

   //Connect Callback Functions That Will Respond to Events
   glutDisplayFunc(display); 
   glutReshapeFunc(reshape);
   glutKeyboardFunc(keyboard);

   //Start listening for events
   glutMainLoop();
   return 0;
}

void init(void) 
{
   //Put OpenGL Initializing Code here

}

void display(void)
{
   // Put Drawing Code Here

   // Required to see drawing if you included GLUT_DOUBLE 
   // in your Device Context
   glutSwapBuffers();
}

void reshape (int w, int h)
{
   //Put Resizing Code Here

}

void keyboard(unsigned char key, int x, int y)
{
   switch (key) {
      case 27:
      case 'q':
      case 'Q':
         exit(0);
         break;
   }
}

