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.
My 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.
Since I prefix all my framework file and class names with "mg", I decided to call the package "Milligram".
In addition to the games, there are set of demos, intended to either show algorithms or use of the framework. This download contains the executables of all the demos. For source, see Source Code 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 83 demos - Windows.
For Linux, download Part 83 demos - Linux.
For Mac, download Part 83 demos - Mac.
A simple rotating cube. The smallest example of using the 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.
Download the complete project source at Part 83 Source.
or find it on GitHub at: https://github.com/mgoodfel/SeaOfMemes
The source directory will look like:
Source Games BuildLinux BuildOSX BuildWin SeaOfMemes BuildLinux BuildOSX BuildWin ... plus source Crafty ... build directories ... plus source McrView ... build directories ... plus source Demos ... build directories TestCube BuildLinux BuildOSX BuildWin ... plus source ... other demos Milligram BuildLinux BuildOSX BuildWin mgUtil mgPlatform mg2D mg3D mgGUI JpegLib FreeType Ogg Vorbis ZLib
In Milligram/BuildLinux, etc., there are makefiles which will build the entire set of libraries. Similarly, in Demos/BuildLinux, etc., there are make files to build all the framework demos. In Games/BuildLinux, etc. there are makefiles to build all the games.
These top level build directories contain makefiles which call the project make files. (ex: Games/SeaOfMemes)
In each project, the BuildLinux directory contains a makefile, tested under Ubuntu Linux 10.10. The BuildOSX directory contains XCode project files, tested under MacOS 10.7 (Lion). The BuildWin directory contains Microsoft Visual C++ 2010 Express project files (.sln), tested under Windows 7.
First, build all the libraries in Milligram. Under Linux, do:
cd Milligram/BuildLinux make
On the mac, do:
cd Milligram/BuildOSX make
On Windows, open a Vistual Studio Command shell, then do:
cd Milligram/BuildWin nmake makefile.mk
Assuming this all compiles, do the same in Demos/BuildLinux, etc. And finally, make Games/BuildLinux, etc.
The simplest program in the release is Demos/TestCube. If this runs, your graphics card is supported and the other programs will hopefully run. Contact me if you have any trouble.
There are also top level Source/BuildWin, etc. directories. These build the whole
tree in release mode, plus the release zip files you find on this site.