First we need to include
ExampleApplication:
#include "Ogre\ExampleApplication.h"
Create a new application class that inherits from
ExampleApplication
and has an emptycreateScene()
function:class Example41 : public ExampleApplication { public: void createScene() { } };
Lastly, we need a main function that creates an instance of the application class and runs it:
int main (void) { Example41 app; app.go(); return 0; }
Compile this project with the same include and libraries directories as we did previously, and link the same libraries. You should get a black window which can be closed by pressing Escape.
We created a new application which inherits from ExampleApplication
and does nothing. It has an empty createScene()
function because this is a pure virtual function in the base class and if we don't override it we can't instantiate our class. The more interesting part of the application will be added now.