The Canvas writing in C++11 based on nanovg
https://github.com/Geequlim/NanoCanvas.git
NanoCanvas {#mainpage}
c++
canvas.clearColor(Colors::DarkOliveGreen); //Clear canvas with color
// Draw a rounded rectangle
canvas.beginPath()
.roundedRect(50,50,100,100,10)
.fillStyle(Colors::Salmon)
.fill();
// Draw styled text
TextStyle textStyle;
textStyle.size = 36.0f;
textStyle.color = Colors::White;
textStyle.face = font.face;
canvas.fillStyle(textStyle)
.beginPath()
.fillText("Hello Canvas",30,190);
%%CODEBLOCK0%%c++
NVGcontext * nvgCtx = nvgCreateGL3(NVG_ANTIALIAS | NVG_DEBUG |NVG_STENCIL_STROKES);
Canvas canvas(nvgCtx,wndWidth ,wndHeight);
if(canvas.valid()) {
// Everything is OK
}
%%CODEBLOCK1%%c++
// main render loop
while ( appRunning )
{
canvas.begineFrame(wndWidth,wndHeight);
// Draw awesome graphics here
canvas.endFrame();
}
``
You can use the backend renderer as your like. You have to do that by yourself. :)