CanvasLib
|
The main class representing the canvas. To use it you only need to: More...
#include <CanvasLib.hpp>
Public Types | |
enum class | DrawMode { Fill , Outline } |
Public Member Functions | |
Canvas (const Canvas &)=delete | |
Canvas (Canvas &&)=delete | |
auto | operator= (const Canvas &) -> Canvas &=delete |
auto | operator= (Canvas &&) -> Canvas &=delete |
Canvas (uint32_t width, uint32_t height) | |
Initializes the name field to the name of the project. | |
void | start () |
starts the main window cycle IN MAIN THREAD | |
void | setUpdateFunction (std::function< void(double)> upd) |
sets update function that will be called every frame | |
void | drawRectangle (float x, float y, float w, float h) |
draws a rectangle with specified coordinates and size | |
void | drawEllipse (float cx, float cy, float rx, float ry, int segments=40) |
draws an ellipse, if u want circle just pass same x and y radius for triangle use segments = 3 | |
void | setFillColor (const Color &color) |
sets the fill color | |
void | setDrawMode (const DrawMode &drawMode) |
sets draw mode from Canvas::DrawMode enum | |
Static Public Member Functions | |
static void | enableWatches () |
Enables rendering watches in terminal. | |
static void | disableWatches () |
Disables rendering watches in terminal. | |
static void | setWatch (const std::string &key, const std::string &value) |
Adds or updates entry in watches table. | |
static void | removeWatch (const std::string &key) |
Removes entry from watches table, does nothing if it doesn't exist. | |
The main class representing the canvas. To use it you only need to:
Removes entry from watches table, does nothing if it doesn't exist.
sets update function that will be called every frame
upd | function (or lambda) with void(double) signature. Double parameter is fps scale factor |
Adds or updates entry in watches table.
Watches allow you to add rows to the table in terminal interface (one that contains rendering statistics by default)