Source Code
Building and Running the Viewer From Source Code
- Visual Studio 2005 or 2008 must be installed. Other versions of Visual Studio, such as Visual C++ Express, are untested.
- The Ogre 3D header files and static libraries (along with Ogre 3D's static dependencies) must be available. Ogre 1.6.2 and 1.7.0 are the latest tested versions. Static library support can be disabled by defining removing OGRE_STATIC_LIB from the project preprocessor definitions. Also, the zlib.lib, zziplib.lib, freetype235.lib, FreeImage.lib, LibJPEG.lib, LibMNG.lib, LibPNG.lib, LibTIFF.lib, Plugin_CgProgramManagerStatic.lib, RenderSystem_Direct3D9Static.lib, RenderSystem_GLStatic.lib, Plugin_ParticleFXStatic.lib, Plugin_OctreeSceneManagerStatic.lib and OgreMainStatic.lib references in the linker settings must be removed, and OgreMain.lib added.
- The header files and library for this modified Object-Oriented Input System (OIS) must be used. The latest official public release, will also work, though the gamepad mappings will not be correct if a 360 gamepad is used.
- The wxWidgets header files and libraries must be available. The most recent tested version is wxWidgets 2.8.7.
- The OgreMaxSampleViewer.sln project file may be loaded in Visual Studio and built.
- Run the output OgreMaxSampleViewer.exe file, passing the path of a scene file to load and display. Many sample scenes are included with the viewer for this purpose.
Using OgreMax Scene Files in Your Own Project
- If you haven't already done so, you will need to have TinyXML library somewhere, either on your system or directly in your project's source code directory. In either case, be sure you have compiled with the TIXML_USE_STL preprocessor definition, both when building TinyXML (if you use it as a separate library) and when using it in your project. Failing to do this will likely result in your program crashing. For Visual Studio, you can find the preprocessor definitions in the project properties dialog under C/C++->Preprocessor->Preprocessor Definitions.
- Copy the OgreMaxPlatform, OgreMaxScene, OgreMaxModel, OgreMaxRenderWindowIterator, OgreMaxTypes, OgreMaxUtilites, ProgressCalculator, and Version .cpp/.hpp files from the Common/Code directory and paste them into your own project's code directory.
- In your application, create an instance of the OgreMaxScene class and call Load(). This instance should exist for as long as you wish to view the loaded scene. When you are destroying your scene, before deleting the scene manager, be sure to call OgreMaxScene::Destroy() (if you have a static instance) or delete the OgreMaxScene object (if you have a dynamic instance) so that the internal objects are deleted in the correct order.
- To obtain the "extra" data stored in objects call the OgreMaxScene::GetObjectExtraData() method, passing in the object. A pointer to the extra data is returned. The pointer does not need to be deleted. It will, however, be deleted if the OgreMaxScene that loaded it is deleted.
- When there is a terrain in a scene, there must be a camera and viewport present in order for it to be loaded without errors. This can be achieved with implementing the CreatedSceneManager() callback, as is done in the viewer, and creating the necessary objects before the remainder of the scene is loaded.