Просмотр исходного кода

Merge pull request #864 from olliwang/nanovg

Moves additional bgfx nanovg functions to a separate header file.
Branimir Karadžić 9 лет назад
Родитель
Сommit
d876f88a89

+ 2 - 6
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);

+ 4 - 0
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);

+ 18 - 0
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