Time for action — creating a blank sheet

  1. First we need to include ExampleApplication:
    #include "OgreExampleApplication.h"
    
  2. Create a new application class that inherits from ExampleApplication and has an empty createScene() function:
    class Example41 : public ExampleApplication
    {
    public:
    void createScene()
    {
    }
    };
    
  3. 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;
    }
    
  4. 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.

What just happened?

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.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.191.150.231