From c375472bbe96f2c49efae11b38ce8befd9d1a613 Mon Sep 17 00:00:00 2001 From: IlushaShurupov Date: Sun, 23 Jul 2023 15:31:06 +0300 Subject: [PATCH] Adding nanovg --- Graphics/examples/Example.cpp | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/Graphics/examples/Example.cpp b/Graphics/examples/Example.cpp index 6b0802d..c151f86 100644 --- a/Graphics/examples/Example.cpp +++ b/Graphics/examples/Example.cpp @@ -13,8 +13,8 @@ // -------- Canvas -------- // #define NANOVG_GL3_IMPLEMENTATION -//#include -//#include +#include +#include #include @@ -99,7 +99,7 @@ class Showoff { } }; - /* + class Canvas { NVGcontext* vg; @@ -146,7 +146,7 @@ class Showoff { nvgEndFrame(vg); } }; - */ + public: Showoff() = default; @@ -154,28 +154,28 @@ public: void init(GLFWwindow* window, int aWidth, int aHeight) { gui.init(window); gl.init(); - // canvas.init(aWidth, aHeight); + canvas.init(aWidth, aHeight); } void deinit() { gui.deinit(); gl.deinit(); - // canvas.deinit(); + canvas.deinit(); } void draw() { gl.beginDraw(); - // canvas.beginDraw(); + canvas.beginDraw(); gui.beginDraw(); gui.endDraw(); - // canvas.endDraw(); + canvas.endDraw(); gl.endDraw(); } private: GUI gui{}; GL gl{}; - // Canvas canvas{}; + Canvas canvas{}; }; class Window { @@ -259,9 +259,9 @@ int main() { } { - //tp::HeapAllocGlobal::startIgnore(); + tp::HeapAllocGlobal::startIgnore(); auto window = Window::createWindow(800, 600, "Window 1"); - //tp::HeapAllocGlobal::stopIgnore(); + tp::HeapAllocGlobal::stopIgnore(); if (window) { window->renderLoop();