From 885844a845c1cf836f3ac4e695d708692cdf8d1a Mon Sep 17 00:00:00 2001 From: Mikko Mononen Date: Tue, 1 Apr 2014 16:33:49 +0300 Subject: [PATCH] Added quick hints on how to debug rendering issues --- README.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/README.md b/README.md index 349fada..590d1e6 100644 --- a/README.md +++ b/README.md @@ -51,6 +51,18 @@ nvgFillColor(vg, nvgRGBA(255,192,0,255)); nvgFill(vg); ``` +## Rendering is wrong, what to do? + +- make sure you have created NanoVG context using one of the `nvgCreatexxx()` calls +- make sure you have initialised OpenGL with stencil buffer +- make sure you have cleared stencil buffer +- make sure you have following OpenGL state between calls to `nvgBeginFrame()` and `nvgEndFrame()`: + - `glEnable(GL_CULL_FACE)` + - `glCullFace(GL_BACK)` + - `glEnable(GL_BLEND)` + - `glDisable(GL_DEPTH_TEST)` +- if the problem still persists, please report an issue! + ## API Reference See the header file [nanovg.h](/src/nanovg.h) for API reference.