Browse Source

Added NVG_ANTIALIAS into read me, commented line cap/join

shared-context
Mikko Mononen 11 years ago
parent
commit
0c6d5d3702
2 changed files with 6 additions and 1 deletions
  1. +1
    -1
      README.md
  2. +5
    -0
      src/nanovg.h

+ 1
- 1
README.md View File

@@ -19,7 +19,7 @@ The NanoVG API is modeled loosely on HTML5 canvas API. If you know canvas, you'r


The drawing context is created using platform specific constructor function. If you're using the default OpenGL 2.0 back-end the context is created as follows: The drawing context is created using platform specific constructor function. If you're using the default OpenGL 2.0 back-end the context is created as follows:
```C ```C
struct NVGcontext* vg = nvgCreateGL2(512, 512);
struct NVGcontext* vg = nvgCreateGL2(512, 512, NVG_ANTIALIAS);
``` ```
The two values passed to the constructor define the size of the texture atlas used for text rendering, 512x512 is a good starting point. If you're rendering retina sized text or plan to use a lot of different fonts, 1024x1024 is better choice. The two values passed to the constructor define the size of the texture atlas used for text rendering, 512x512 is a good starting point. If you're rendering retina sized text or plan to use a lot of different fonts, 1024x1024 is better choice.




+ 5
- 0
src/nanovg.h View File

@@ -158,7 +158,12 @@ void nvgMiterLimit(struct NVGcontext* ctx, float limit);
// Sets the stroke witdth of the stroke style. // Sets the stroke witdth of the stroke style.
void nvgStrokeWidth(struct NVGcontext* ctx, float size); void nvgStrokeWidth(struct NVGcontext* ctx, float size);


// Sets how the end of the line (cap) is drawn,
// Can be one of: NVG_BUTT (default), NVG_ROUND, NVG_SQUARE.
void nvgLineCap(struct NVGcontext* ctx, int cap); void nvgLineCap(struct NVGcontext* ctx, int cap);

// Sets how sharp path corners are drawn.
// Can be one of NVG_MITER (default), NVG_ROUND, NVG_BEVEL.
void nvgLineJoin(struct NVGcontext* ctx, int join); void nvgLineJoin(struct NVGcontext* ctx, int join);


// //


Loading…
Cancel
Save