/* NOTE: This program is to create a window for us. Don't misunderstand that we are going to create a window. We will be taking someone else's help to create a window. We will simply ask that "someone" to create a window with.. --> size --> position --> name(title) of our choice. And that "someone" is glut; glut stands for graphics library utility kit You can download freeglut from the web for VC++: --> from the menu, click on .... Tools -> options -> VC++ directories Make sure that you add the include and library paths appropriately (I'm sure that I've created a tutorial for this; feel free to explore my site www.gamesnmaths.net ) for Unix/Lunix: -->Make sure that you have a shell to type the following commands INSTALLATION: --> "sudo apt-get install freeglut3-dev" COMPILATION: --> "cc 001_Window.c -lglut" EXECUTION: --> "./a.out" IMPORTANT: Once you run this program.... WHAT YOU ARE NOT SUPPOSED TO DO: --> Don't Maximize the window --> Don't resize the window --> Don't move the window --> Don't click inside the window --> Don't drag inside the window --> Don't scroll inside the window --> Don't expect that pressing ESC key will close the window --> Don't blame me if your machine hangs :P WHAT YOU ARE ALLOWED TO DO: --> minimize the window --> close the window */ #include void Draw(void) { // Nothing... // We are drawing nothing } int main(int argc, char** argv) { const int left = 100; const int top = 100; const int width = 256; const int height = 256; const char* windowTitle = "I'll be back"; glutInit(&argc, argv); //Chill out guys... //Don't ask me what these SINGLE and RGB has got to do with //display mode. or what is a display mode. //It is covered in some other tutorial. //For time being... just ignore it glutInitDisplayMode(GLUT_SINGLE | GLUT_RGB); glutInitWindowSize(width, height); glutInitWindowPosition(left, top); glutCreateWindow(windowTitle); glutDisplayFunc(Draw); glutMainLoop(); return 0; } /* Exercise 1: Change the position and dimensions of the window based on the command line arguments eg: ./a.out 0 0 1024 768 Exercise 2: Change the position and dimensions of the window after parsing the command line arguments eg: ./a.out -left 100 -width 256 -height 1024 -top 0 */ // // MORAL of this tutorial: // ~~~~~~~~~~~~~~~~~~~~~~~~ // When you don't know how to do something; at least know who can do it //