| 374 | |
| 375 | |
| 376 | Window::~Window() { |
| 377 | if (APP->scene) { |
| 378 | widget::Widget::ContextDestroyEvent e; |
| 379 | e.vg = vg; |
| 380 | APP->scene->onContextDestroy(e); |
| 381 | } |
| 382 | |
| 383 | // Fonts and Images in the cache must be deleted before the NanoVG context is deleted |
| 384 | internal->fontCache.clear(); |
| 385 | internal->imageCache.clear(); |
| 386 | |
| 387 | // nvgDeleteClone(fbVg); |
| 388 | |
| 389 | #if defined NANOVG_GL2 |
| 390 | nvgDeleteGL2(vg); |
| 391 | nvgDeleteGL2(fbVg); |
| 392 | #elif defined NANOVG_GL3 |
| 393 | nvgDeleteGL3(vg); |
| 394 | #elif defined NANOVG_GLES2 |
| 395 | nvgDeleteGLES2(vg); |
| 396 | #endif |
| 397 | |
| 398 | glfwDestroyWindow(win); |
| 399 | delete internal; |
| 400 | } |
| 401 | |
| 402 | |
| 403 | math::Vec Window::getSize() { |
nothing calls this directly
no test coverage detected