OpenGL Programming

Click here for more detailed inforation.

    All of the programs on this site were compiled using the Borland C++ 5.02 compiler on a custom built AMD Athlon 650-Mhz computer with 128 megs of SD-RAM, and a 16 Meg Creative Voodoo Banshee video card. However, all of the programs should be compatible with any system configuration that supports OpenGL.

All of the OpenGL programs on this web site were created using two main components. 

  • The first of these components is the OpenGL library. This package contains the compiled C++ library (.lib) files which can be incorporated directly into a project file. The package also contains the .DLL files that are needed for the end user to run the OpenGL based program. The .DLL files must be placed either in the current directory as the executable for the program, or in the windows root directory.

  • The second component used to create OpenGL based programs is the GLUT graphics library. This library is not necessary to create OpenGL based programs, but it makes the coding much easier. The reason for this is the GLUT library is designed to bypass the messy Windows based graphics programming. The GLUT Library makes it so that the user does not have to create and manipulate DC handles, initialize graphics modes, or work with a dedicated windows message loop. For these reasons, GLUT facilitates programming in OpenGL and allows the user to focus programming efforts on the graphics, not Windows.

        Once these two libraries are downloaded, one is ready to create a C++ program implementing OpenGL. Specifically, in Borland C++, the next thing to do is create a new project file. For the programs on this site projects were created using a Win32 Console based project file. One must change the platform option from GUI to Console or a linker error similar to the image below will appear.

        Next, the OpenGL and GLUT libraries must be included in the project file. To do this, unzip the OpenGL and Glut Package from above into a directory similar to d:\opengl. Next, In Borland C++, select Options...Project from the menu at the top of the window. Then add the path of the unzipped OpenGL libraries, in this case d:\opengl.

     

        Obviously, the paths of the Borland C++ include and library files must also be listed as show above. Once the OpenGL and GLUT libraries have been added, function calls may be made to any of the functions contained in these libraries.

    At this point, please refer to the code in the OpenGL Examples section for exciting code intended to demonstrate OpenGL's functionality.


Questions? Comments? email: nick@ohiofirst.com