diff --git a/examples/common/nanovg/nanovg.h b/examples/common/nanovg/nanovg.h index 692d1bd2b..7bf504149 100644 --- a/examples/common/nanovg/nanovg.h +++ b/examples/common/nanovg/nanovg.h @@ -19,6 +19,8 @@ #ifndef NANOVG_H #define NANOVG_H +#include "nanovg_bgfx.h" + #ifdef __cplusplus extern "C" { #endif @@ -598,12 +600,6 @@ struct NVGparams { }; typedef struct NVGparams NVGparams; -namespace bx { struct AllocatorI; } - -NVGcontext* nvgCreate(int edgeaa, unsigned char _viewId, bx::AllocatorI* _allocator = NULL); -void nvgViewId(struct NVGcontext* ctx, unsigned char _viewId); -void nvgDelete(struct NVGcontext* ctx); - // Constructor and destructor, called by the render back-end. NVGcontext* nvgCreateInternal(NVGparams* params); void nvgDeleteInternal(NVGcontext* ctx); diff --git a/examples/common/nanovg/nanovg_bgfx.cpp b/examples/common/nanovg/nanovg_bgfx.cpp index e5795ad21..9c426f8e2 100644 --- a/examples/common/nanovg/nanovg_bgfx.cpp +++ b/examples/common/nanovg/nanovg_bgfx.cpp @@ -1088,6 +1088,10 @@ error: return NULL; } +NVGcontext* nvgCreate(int edgeaa, unsigned char _viewId) { + return nvgCreate(edgeaa, _viewId, NULL); +} + void nvgViewId(struct NVGcontext* ctx, unsigned char _viewId) { struct NVGparams* params = nvgInternalParams(ctx); diff --git a/examples/common/nanovg/nanovg_bgfx.h b/examples/common/nanovg/nanovg_bgfx.h new file mode 100644 index 000000000..d24ee4fa7 --- /dev/null +++ b/examples/common/nanovg/nanovg_bgfx.h @@ -0,0 +1,18 @@ +/* + * Copyright 2011-2016 Branimir Karadzic. All rights reserved. + * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause + */ + +#ifndef NANOVG_BGFX_H_HEADER_GUARD +#define NANOVG_BGFX_H_HEADER_GUARD + +namespace bx { struct AllocatorI; } + +struct NVGcontext; + +NVGcontext* nvgCreate(int edgeaa, unsigned char _viewId, bx::AllocatorI* _allocator); +NVGcontext* nvgCreate(int edgeaa, unsigned char _viewId); +void nvgViewId(struct NVGcontext* ctx, unsigned char _viewId); +void nvgDelete(struct NVGcontext* ctx); + +#endif // NANOVG_BGFX_H_HEADER_GUARD