diff options
Diffstat (limited to '3rdparty/bgfx/examples/common/nanovg/nanovg_bgfx.cpp')
-rw-r--r-- | 3rdparty/bgfx/examples/common/nanovg/nanovg_bgfx.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/3rdparty/bgfx/examples/common/nanovg/nanovg_bgfx.cpp b/3rdparty/bgfx/examples/common/nanovg/nanovg_bgfx.cpp index e5795ad2131..41095d853bb 100644 --- a/3rdparty/bgfx/examples/common/nanovg/nanovg_bgfx.cpp +++ b/3rdparty/bgfx/examples/common/nanovg/nanovg_bgfx.cpp @@ -545,12 +545,12 @@ namespace gl->th = handle; } - static void nvgRenderViewport(void* _userPtr, int width, int height) + static void nvgRenderViewport(void* _userPtr, int width, int height, float devicePixelRatio) { struct GLNVGcontext* gl = (struct GLNVGcontext*)_userPtr; gl->view[0] = (float)width; gl->view[1] = (float)height; - bgfx::setViewRect(gl->m_viewId, 0, 0, width, height); + bgfx::setViewRect(gl->m_viewId, 0, 0, width * devicePixelRatio, height * devicePixelRatio); } static void fan(uint32_t _start, uint32_t _count) @@ -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); |