Update README.md

Highlighted the need for render target stencil buffer.
This commit is contained in:
Mikko Mononen 2017-06-29 13:18:20 +03:00 committed by GitHub
parent c75fc0bfcf
commit 72bac5d98b

View File

@ -1,6 +1,3 @@
/work in progress.../
NanoVG
==========
@ -30,7 +27,9 @@ The first parameter defines flags for creating the renderer.
- `NVG_ANTIALIAS` means that the renderer adjusts the geometry to include anti-aliasing. If you're using MSAA, you can omit this flags.
- `NVG_STENCIL_STROKES` means that the render uses better quality rendering for (overlapping) strokes. The quality is mostly visible on wider strokes. If you want speed, you can omit this flag.
Currently there is an OpenGL back-end for NanoVG: [nanovg_gl.h](/src/nanovg_gl.h) for OpenGL 2.0, OpenGL ES 2.0, OpenGL 3.2 core profile and OpenGL ES 3. The implementation can be chosen using a define as in above example. See the header file and examples for further info.
Currently there is an OpenGL back-end for NanoVG: [nanovg_gl.h](/src/nanovg_gl.h) for OpenGL 2.0, OpenGL ES 2.0, OpenGL 3.2 core profile and OpenGL ES 3. The implementation can be chosen using a define as in above example. See the header file and examples for further info.
*NOTE:* The render target you're rendering to must have stencil buffer.
## Drawing shapes with NanoVG
@ -61,7 +60,7 @@ 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 initialised OpenGL with *stencil buffer*
- make sure you have cleared stencil buffer
- make sure all rendering calls happen between `nvgBeginFrame()` and `nvgEndFrame()`
- to enable more checks for OpenGL errors, add `NVG_DEBUG` flag to `nvgCreatexxx()`