Rendering integration with libRocket via Magnum.
Usage is quite simple and straight-foward, you simply:
- Create an object of
mlr::RenderInterface
- Set the shader for the render interface (via ctor or
mlr::RenderInterface::setShader
)- Note this shader must have texturing.
- Set the size (typically the size of your window), via
mlr::RenderInterface::setSize
. - Register it to libRocket, via
Rocket::Core::SetRenderInteface
.
This requires my image loader library, alternatively instead of getting my library, you can write your own code to load images for libRocket. See LoadTexture
within the RenderInterface
.
Configuration is can be done manually (obviously), or through a some macros:
A flag to determine if we should be using a custom shader, if this flag is not defined, it is assumed we will use a Magnum::Shaders::Flat2D shader. You should declare the following macros (if you enable this macro):
The path for the definition of the shader. Note, this
can't just be a class forward declaration, unless you
include the appropriate file within RenderInterface.cpp
.
The name of your custom shader class, e.g. CustomShader
without the `'s.
See LICENSE.