OGRE
1.10.12
Object-Oriented Graphics Rendering Engine
|
Ogre uses CMake as its build system. It is recommended that you use it in your project as well. Then all you need is to add the following three lines to your project
These settings include all available components and third party libraries OGRE depends on (e.g. boost) - nothing more to do.
If you installed OGRE in a non-standard path, you will have to set OGRE_DIR
to the location of OGREConfig.cmake
so find_package
can figure out the rest.
For inspecting the detected OGRE installation, the following CMake variables are available
OGRE_STATIC
- whether ogre was build as static libOGRE_${COMPONENT}_FOUND
- ${COMPONENT} is availableOGRE_PLUGIN_DIR
- The directory where the OGRE plugins are locatedOGRE_MEDIA_DIR
- The directory where the OGRE sample media is locatedOGRE_CONFIG_DIR
- The directory where the OGRE config files are locatedThe easiest way to get started is the OgreBites Component. It handles Ogre startup/ tear down (including Ogre::Overlay, RTSS), input using SDL2 and even includes a Simple GUI System.
This is useful if all you want is to get a Scene with a FPS counter up and running (rapid prototyping). If available it also uses SDL2 for input - you now just have to implement the callbacks.
To use it, simply derive from OgreBites::ApplicationContext and if you want to get input events from OgreBites::InputListener
in the constructor we set our application name. The ogre configuration files will be stored in a system dependant location specific to our app.
to handle input events, we then override the according method
the interesting part however is the setup method
finally we start everything as
Samples/Tutorials/Bootstrap.cpp
for C++Samples/Python/bites_sample.py
for PythonSamples/AndroidJNI/MainActivity.java
for Java (Android)OgreBites itself is also a good starting point if you need more control over the Camera or the Window creation. For instance to render into an existing Qt Window.