My work originally started on DirectX 9 under Windows 7. This was the version of DirectX supported by Windows XP as well, so I thought that would give me the maximum portability. I was later convinced that OpenGL was a better choice. It runs on all the Windows platforms, as well as Linux and the Mac. A version of OpenGL runs on the iPad.
The framework is intended to cover the differences between the various operating systems and graphics standards. Since the start of the project, I've added libraries and covering classes for text (using the FreeType library), images (JpegLib) and audio (DirectSound and OpenAL) on the various platforms. There are also a set of utility classes I use in my projects.
In addition to the framework, this download contains several demos, listed below.
The demos have either a desktop cursor (arrow) or a shooter-style cursor (cross.) In desktop mode, you can move the cursor out of the window or close the window. In shooter mode, moving the mouse turns the eye. Hit ESC to switch between modes.
In both modes, the W, S, A and D keys have the standard definitions (forward, back, left, right.) The cursor keys are also defined: up arrow (forward), down arrow (back), right arrow (turn right), left arrow (turn left.)
Additional keys are defined in the demos as described below.
The demos can be downloaded here:
For Windows, download Part 51 Framework - Windows.
For Linux, download Part 51 Framework - Linux.
For Mac, download Part 51 Framework - Mac.
The framework has been divided into two libraries of mine -- mgUtil (utilities), and mg3D (graphics), plus several open source libraries (in the Libs directory.)
The source is organized as follows:
Source Libs FreeType BuildLinux BuildOSX BuildWin JpegLib BuildLinux BuildOSX BuildWin ... other libraries mgUtil BuildLinux BuildOSX BuildWin mg3D BuildLinux BuildOSX BuildWin TestCube BuildLinux BuildOSX BuildWin Landscape BuildLinux BuildOSX BuildWin ... other demos
In each project, the BuildLinux directory contains a makefile, tested under Ubuntu Linux 10.10. The BuildOSX directory contain XCode project files, tested under MacOS 10.7 (Lion). The BuildWin directories contain Microsoft Visual C++ 2010 Express project files (.sln), tested under Windows 7.
First, build all the libraries in Libs. Then build mgUtil and mg3D. Finally, build the demo or other project like SeaOfMemes.
All of the build files (makefile or project files) refer to the other libraries with relative names (ex: ../../mgUtil/Include). If you download the source to the other projects (SeaOfMemes, etc.) they will also fit into this directory structure and expect to see the libraries at these relative names.
Download the framework source at Part 51 Framework - Source.
or find it on GitHub at: https://github.com/mgoodfel/mgFramework
A simple rotating cube. The smallest example of using the 3D framework, and a good test program if you were porting to a new platform.
The test demonstrates growing a tree using "space colonization". See Part 26 for more details.
Hit F4 to grow the tree one step. Hit F5 to start an animation sequence that grows the entire tree.
The test demonstrates generating procedural landscape chunks at various resolutions as the user moves. See Part 28 for details.
Hit "M" to toggle the map (overhead) mode. Hit "G" to cycle through the three grid coloring styles.
A demonstration of audio and simple animation. Hit "M" to start the movie. You can also fly using the mouse and WASD keys as described above, although the movie sequence will control the eye angle during the movie.