summaryrefslogtreecommitdiffstatshomepage
path: root/3rdparty/bgfx/examples/common/nanovg/nanovg.cpp
diff options
context:
space:
mode:
author Branimir Karadžić <branimirkaradzic@gmail.com>2016-10-29 09:11:50 +0200
committer Miodrag Milanovic <mmicko@gmail.com>2016-10-29 09:11:50 +0200
commita3b4058bf7266f1291cf38c30425d9948250fcd9 (patch)
tree46116c48b60368ac9c782c1d5e6e8ae16e558987 /3rdparty/bgfx/examples/common/nanovg/nanovg.cpp
parentb99be73f2db5d3f81edc96a92ac4839e7f1cc3ab (diff)
Updated BGFX and BX and recompiled shaders (nw)
Diffstat (limited to '3rdparty/bgfx/examples/common/nanovg/nanovg.cpp')
-rw-r--r--3rdparty/bgfx/examples/common/nanovg/nanovg.cpp20
1 files changed, 19 insertions, 1 deletions
diff --git a/3rdparty/bgfx/examples/common/nanovg/nanovg.cpp b/3rdparty/bgfx/examples/common/nanovg/nanovg.cpp
index 9904141c103..ae696b3b428 100644
--- a/3rdparty/bgfx/examples/common/nanovg/nanovg.cpp
+++ b/3rdparty/bgfx/examples/common/nanovg/nanovg.cpp
@@ -16,8 +16,11 @@
// 3. This notice may not be removed or altered from any source distribution.
//
+#include <stdlib.h>
#include <stdio.h>
#include <math.h>
+#include <memory.h>
+
#include "nanovg.h"
#include <bx/macros.h>
@@ -64,6 +67,10 @@ BX_PRAGMA_DIAGNOSTIC_PUSH();
BX_PRAGMA_DIAGNOSTIC_IGNORED_CLANG_GCC("-Wmissing-field-initializers");
BX_PRAGMA_DIAGNOSTIC_IGNORED_CLANG_GCC("-Wshadow");
BX_PRAGMA_DIAGNOSTIC_IGNORED_CLANG_GCC("-Wint-to-pointer-cast")
+#if BX_COMPILER_GCC >= 60000
+BX_PRAGMA_DIAGNOSTIC_IGNORED_GCC("-Wmisleading-indentation");
+BX_PRAGMA_DIAGNOSTIC_IGNORED_GCC("-Wshift-negative-value");
+#endif // BX_COMPILER_GCC >= 60000_
#define STBI_MALLOC(_size) lodepng_malloc(_size)
#define STBI_REALLOC(_ptr, _size) lodepng_realloc(_ptr, _size)
#define STBI_FREE(_ptr) lodepng_free(_ptr)
@@ -250,7 +257,6 @@ static void nvg__setDevicePixelRatio(NVGcontext* ctx, float ratio)
static NVGcompositeOperationState nvg__compositeOperationState(int op)
{
- // NVG_SOURCE_OVER
int sfactor = NVG_ONE;
int dfactor = NVG_ONE_MINUS_SRC_ALPHA;
@@ -2308,6 +2314,18 @@ int nvgFindFont(NVGcontext* ctx, const char* name)
return fonsGetFontByName(ctx->fs, name);
}
+
+int nvgAddFallbackFontId(NVGcontext* ctx, int baseFont, int fallbackFont)
+{
+ if(baseFont == -1 || fallbackFont == -1) return 0;
+ return fonsAddFallbackFont(ctx->fs, baseFont, fallbackFont);
+}
+
+int nvgAddFallbackFont(NVGcontext* ctx, const char* baseFont, const char* fallbackFont)
+{
+ return nvgAddFallbackFontId(ctx, nvgFindFont(ctx, baseFont), nvgFindFont(ctx, fallbackFont));
+}
+
// State setting
void nvgFontSize(NVGcontext* ctx, float size)
{