Adding nanovg
This commit is contained in:
parent
aaa08e4495
commit
c375472bbe
1 changed files with 11 additions and 11 deletions
|
|
@ -13,8 +13,8 @@
|
||||||
|
|
||||||
// -------- Canvas -------- //
|
// -------- Canvas -------- //
|
||||||
#define NANOVG_GL3_IMPLEMENTATION
|
#define NANOVG_GL3_IMPLEMENTATION
|
||||||
//#include <nanovg.h>
|
#include <nanovg.h>
|
||||||
//#include <nanovg_gl.h>
|
#include <nanovg_gl.h>
|
||||||
|
|
||||||
#include <cstdio>
|
#include <cstdio>
|
||||||
|
|
||||||
|
|
@ -99,7 +99,7 @@ class Showoff {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
/*
|
|
||||||
class Canvas {
|
class Canvas {
|
||||||
|
|
||||||
NVGcontext* vg;
|
NVGcontext* vg;
|
||||||
|
|
@ -146,7 +146,7 @@ class Showoff {
|
||||||
nvgEndFrame(vg);
|
nvgEndFrame(vg);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
*/
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
Showoff() = default;
|
Showoff() = default;
|
||||||
|
|
@ -154,28 +154,28 @@ public:
|
||||||
void init(GLFWwindow* window, int aWidth, int aHeight) {
|
void init(GLFWwindow* window, int aWidth, int aHeight) {
|
||||||
gui.init(window);
|
gui.init(window);
|
||||||
gl.init();
|
gl.init();
|
||||||
// canvas.init(aWidth, aHeight);
|
canvas.init(aWidth, aHeight);
|
||||||
}
|
}
|
||||||
|
|
||||||
void deinit() {
|
void deinit() {
|
||||||
gui.deinit();
|
gui.deinit();
|
||||||
gl.deinit();
|
gl.deinit();
|
||||||
// canvas.deinit();
|
canvas.deinit();
|
||||||
}
|
}
|
||||||
|
|
||||||
void draw() {
|
void draw() {
|
||||||
gl.beginDraw();
|
gl.beginDraw();
|
||||||
// canvas.beginDraw();
|
canvas.beginDraw();
|
||||||
gui.beginDraw();
|
gui.beginDraw();
|
||||||
gui.endDraw();
|
gui.endDraw();
|
||||||
// canvas.endDraw();
|
canvas.endDraw();
|
||||||
gl.endDraw();
|
gl.endDraw();
|
||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
GUI gui{};
|
GUI gui{};
|
||||||
GL gl{};
|
GL gl{};
|
||||||
// Canvas canvas{};
|
Canvas canvas{};
|
||||||
};
|
};
|
||||||
|
|
||||||
class Window {
|
class Window {
|
||||||
|
|
@ -259,9 +259,9 @@ int main() {
|
||||||
}
|
}
|
||||||
|
|
||||||
{
|
{
|
||||||
//tp::HeapAllocGlobal::startIgnore();
|
tp::HeapAllocGlobal::startIgnore();
|
||||||
auto window = Window::createWindow(800, 600, "Window 1");
|
auto window = Window::createWindow(800, 600, "Window 1");
|
||||||
//tp::HeapAllocGlobal::stopIgnore();
|
tp::HeapAllocGlobal::stopIgnore();
|
||||||
|
|
||||||
if (window) {
|
if (window) {
|
||||||
window->renderLoop();
|
window->renderLoop();
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue