diff --git a/example/example_gles2.c b/example/example_gles2.c index f204237..06e4214 100644 --- a/example/example_gles2.c +++ b/example/example_gles2.c @@ -20,8 +20,7 @@ #define GLFW_INCLUDE_ES2 #include #include "nanovg.h" -#define NANOVG_GL2_IMPLEMENTATION -#define NANOVG_GLES2 +#define NANOVG_GLES2_IMPLEMENTATION #include "nanovg_gl2.h" #include "demo.h" diff --git a/example/example_gles3.c b/example/example_gles3.c index c070dd5..3fa0caf 100644 --- a/example/example_gles3.c +++ b/example/example_gles3.c @@ -20,8 +20,7 @@ #define GLFW_INCLUDE_ES3 #include #include "nanovg.h" -#define NANOVG_GL3_IMPLEMENTATION -#define NANOVG_GLES3 +#define NANOVG_GLES3_IMPLEMENTATION #include "nanovg_gl3.h" #include "demo.h" diff --git a/src/nanovg_gl2.h b/src/nanovg_gl2.h index a0e5397..0db4e21 100644 --- a/src/nanovg_gl2.h +++ b/src/nanovg_gl2.h @@ -24,6 +24,15 @@ extern "C" { #define NVG_ANTIALIAS 1 +#ifdef NANOVG_GLES2_IMPLEMENTATION +# ifndef NANOVG_GLES2 +# define NANOVG_GLES2 +# endif +# ifndef NANOVG_GL2_IMPLEMENTATION +# define NANOVG_GL2_IMPLEMENTATION +# endif +#endif + #ifdef NANOVG_GLES2 struct NVGcontext* nvgCreateGLES2(int atlasw, int atlash, int edgeaa); diff --git a/src/nanovg_gl3.h b/src/nanovg_gl3.h index 57f0d63..4a83d55 100644 --- a/src/nanovg_gl3.h +++ b/src/nanovg_gl3.h @@ -24,6 +24,15 @@ extern "C" { #define NVG_ANTIALIAS 1 +#ifdef NANOVG_GLES3_IMPLEMENTATION +# ifndef NANOVG_GLES3 +# define NANOVG_GLES3 +# endif +# ifndef NANOVG_GL3_IMPLEMENTATION +# define NANOVG_GL3_IMPLEMENTATION +# endif +#endif + #ifdef NANOVG_GLES3 struct NVGcontext* nvgCreateGLES3(int atlasw, int atlash, int edgeaa);