Setting up a GUI for tweaking parameters
Graphical User Interface (GUI) is often required for controlling and tuning your Cinder application. In many cases, you spend more time tweaking the application parameters to achieve the desired result than writing the code. It is true especially when you are working on some generative graphics.
Cinder provides a convenient and easy-to-use GUI via the InterfaceGl
class.
Getting ready
To make the InterfaceGl
class available in your Cinder application, all you have to do is include one header file.
#include "cinder/params/Params.h"
How to do it…
Follow the steps given here to add a GUI to your Cinder application.
Let's start with preparing different types of variables within our main class, which we will be manipulating using the GUI.
float mObjSize; Quatf mObjOrientation; Vec3f mLightDirection; ColorA mColor;
Next, declare the
InterfaceGl
class member like this:params::InterfaceGl mParams;
Now we move to the
setup
method and initialize our GUI window passing...