summaryrefslogtreecommitdiffstatshomepage
path: root/3rdparty/bgfx/examples/common/nanovg/nanovg_bgfx.cpp
diff options
context:
space:
mode:
author Miodrag Milanovic <mmicko@gmail.com>2016-08-06 14:20:16 +0200
committer Miodrag Milanovic <mmicko@gmail.com>2016-08-06 14:20:16 +0200
commit3917850b6197950e5671f4d3b9cb0b9c921b798d (patch)
tree503b9690868a7c238ba10d73b5c6bece7ca8c338 /3rdparty/bgfx/examples/common/nanovg/nanovg_bgfx.cpp
parent057474989c1a92e9e935dbc8cb9d233ba3a4ea3a (diff)
Update BX and BGFX (nw)
Diffstat (limited to '3rdparty/bgfx/examples/common/nanovg/nanovg_bgfx.cpp')
-rw-r--r--3rdparty/bgfx/examples/common/nanovg/nanovg_bgfx.cpp8
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);