How to write text into console Edit

Urho implements its own functions for writing text (logging) into console. If you want to use them, first you need to include Log.h

#include "Urho3D/IO/Log.h"

Writing info messages:


Writing debug messages:


Writing error messages:


Creating and using your own subsystems Edit

If you have a class inherited from Urho's Object class, you can create a subsystem out of it. The subsystems are helpful, for example, when you want to make a class instance available to every other class inheriting from Object. In this HowTo I will create a subsystem of a class called Settings.

First things to note in subsystem creation (this text is copied from the Urho documentation):

Any Object can be registered to the Context as a subsystem, by using the function RegisterSubsystem(). They can then be accessed by any other Object inside the same context by calling GetSubsystem(). Only one instance of each object type can exist as a subsystem.

So, we can create our own subsystem in just a few steps:

1. Create an instance of your desired class inheriting from Object. I'm using a class called Settings:

Settings* gs = new Settings(context_);

2. Register it to the Context:


So now we have created our own subsystem. We can now use it from any Object class we want by using GetSubsystem<NameOfSubsystem>()

Settings* settings = context_->GetSubsystem<Settings>();

How To Enable Post Process Effects Edit

Urho comes with several post process effects (screen effects). Some are listed here:

You can enable them like this:

RenderPath* effectRenderPath=viewport->GetRenderPath();

The linked forum post uses the Clone() function, that crashed when I use it and just appending the effect to the current RenderPath works too.

The difference between the three effects being appended and not: (I configured the effects to be stronger as per default in their .xml so they may be different if you try it.)

Postprocess effects on
Postprocess effects off