aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHanspeter Portner <dev@open-music-kontrollers.ch>2020-04-26 22:48:20 +0200
committerHanspeter Portner <dev@open-music-kontrollers.ch>2020-04-26 22:48:20 +0200
commit226fd3477ce572ad3dcebb18db2e5e1a9f9abbeb (patch)
treec4377b8bcb9d60c8a38383c060df0791b215575c
parent9fe4908e568ed48ff6f924d7bf4da1f61369fbd6 (diff)
downloadmoony.lv2-226fd3477ce572ad3dcebb18db2e5e1a9f9abbeb.tar.xz
Squashed 'subprojects/d2tk/' changes from 43879bfd..b4c7e867
b4c7e867 nanovg: silence compile warning. 1b7337c4 pugl/nanovg: implement double buffering. 597191c5 readme: use relative img links. git-subtree-dir: subprojects/d2tk git-subtree-split: b4c7e8670f01f49065cb94258256d6f8d4554956
-rw-r--r--README.md16
-rw-r--r--VERSION2
-rw-r--r--src/backend_nanovg.c40
-rw-r--r--src/frontend_pugl.c2
4 files changed, 29 insertions, 31 deletions
diff --git a/README.md b/README.md
index 63e12bc..51c9529 100644
--- a/README.md
+++ b/README.md
@@ -28,21 +28,21 @@ and on-demand rendered sprites.
### Screenshots
-![Screenshot 1](https://git.open-music-kontrollers.ch/lad/d2tk/plain/screenshots/screenshot_1.png)
+![Screenshot 1](/screenshots/screenshot_1.png)
-![Screenshot 2](https://git.open-music-kontrollers.ch/lad/d2tk/plain/screenshots/screenshot_2.png)
+![Screenshot 2](/screenshots/screenshot_2.png)
-![Screenshot 3](https://git.open-music-kontrollers.ch/lad/d2tk/plain/screenshots/screenshot_3.png)
+![Screenshot 3](/screenshots/screenshot_3.png)
-![Screenshot 4](https://git.open-music-kontrollers.ch/lad/d2tk/plain/screenshots/screenshot_4.png)
+![Screenshot 4](/screenshots/screenshot_4.png)
-![Screenshot 5](https://git.open-music-kontrollers.ch/lad/d2tk/plain/screenshots/screenshot_5.png)
+![Screenshot 5](/screenshots/screenshot_5.png)
-![Screenshot 6](https://git.open-music-kontrollers.ch/lad/d2tk/plain/screenshots/screenshot_6.png)
+![Screenshot 6](/screenshots/screenshot_6.png)
-![Screenshot 7](https://git.open-music-kontrollers.ch/lad/d2tk/plain/screenshots/screenshot_7.png)
+![Screenshot 7](/screenshots/screenshot_7.png)
-![Screenshot 8](https://git.open-music-kontrollers.ch/lad/d2tk/plain/screenshots/screenshot_8.png)
+![Screenshot 8](/screenshots/screenshot_8.png)
### License
diff --git a/VERSION b/VERSION
index ae9bae8..810aa9d 100644
--- a/VERSION
+++ b/VERSION
@@ -1 +1 @@
-0.1.1063
+0.1.1069
diff --git a/src/backend_nanovg.c b/src/backend_nanovg.c
index b063984..e74b33d 100644
--- a/src/backend_nanovg.c
+++ b/src/backend_nanovg.c
@@ -243,13 +243,9 @@ d2tk_nanovg_pre(void *data, d2tk_core_t *core, d2tk_coord_t w, d2tk_coord_t h,
}
static inline bool
-#ifdef D2TK_DEBUG
-d2tk_nanovg_post(void *data, d2tk_core_t *core,
- d2tk_coord_t w, d2tk_coord_t h, unsigned pass)
-#else
d2tk_nanovg_post(void *data, d2tk_core_t *core __attribute__((unused)),
- d2tk_coord_t w, d2tk_coord_t h, unsigned pass)
-#endif
+ d2tk_coord_t w __attribute__((unused)), d2tk_coord_t h __attribute__((unused)),
+ unsigned pass)
{
if(pass == 0) // is this 1st pass?
{
@@ -264,6 +260,19 @@ d2tk_nanovg_post(void *data, d2tk_core_t *core __attribute__((unused)),
nvgluBindFramebuffer(NULL);
+ // switch foreground and background framebuffer objects
+ backend->fbop = !backend->fbop;
+
+ return false; // do NOT enter 3rd pass
+}
+
+static inline void
+d2tk_nanovg_end(void *data __attribute__((unused)),
+ d2tk_core_t *core, d2tk_coord_t w, d2tk_coord_t h)
+{
+ d2tk_backend_nanovg_t *backend = data;
+ NVGcontext *ctx = backend->ctx;;
+
glViewport(0, 0, w, h);
glClearColor(0.3f, 0.3f, 0.3f, 1.0f);
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT | GL_STENCIL_BUFFER_BIT);
@@ -271,8 +280,8 @@ d2tk_nanovg_post(void *data, d2tk_core_t *core __attribute__((unused)),
nvgBeginFrame(ctx, w, h, 1.f);
nvgSave(ctx);
- // draw foreground framebuffer object to main framebuffer
- NVGLUframebuffer *fbo_fg = backend->fbo[backend->fbop];
+ // draw former foreground framebuffer object to main framebuffer
+ NVGLUframebuffer *fbo_fg = backend->fbo[!backend->fbop];
const NVGpaint fg = nvgImagePattern(ctx, 0, 0, w, h, 0, fbo_fg->image, 1.0f);
nvgBeginPath(ctx);
nvgRect(ctx, 0, 0, w, h);
@@ -314,23 +323,12 @@ d2tk_nanovg_post(void *data, d2tk_core_t *core __attribute__((unused)),
nvgFillPaint(ctx, bg);
nvgFill(ctx);
}
+#else
+ (void)core;
#endif
nvgRestore(ctx);
nvgEndFrame(ctx);
-
- // switch foreground and background framebuffer objects
- backend->fbop = !backend->fbop;
-
- return false; // do NOT enter 3rd pass
-}
-
-static inline void
-d2tk_nanovg_end(void *data __attribute__((unused)),
- d2tk_core_t *core __attribute__((unused)),
- d2tk_coord_t w __attribute__((unused)), d2tk_coord_t h __attribute__((unused)))
-{
- // nothing to do
}
static inline void
diff --git a/src/frontend_pugl.c b/src/frontend_pugl.c
index ba94f8a..b607a6e 100644
--- a/src/frontend_pugl.c
+++ b/src/frontend_pugl.c
@@ -624,7 +624,7 @@ d2tk_pugl_new(const d2tk_pugl_config_t *config, uintptr_t *widget)
config->w, config->h);
}
puglSetViewHint(dpugl->view, PUGL_RESIZABLE, !config->fixed_size);
- puglSetViewHint(dpugl->view, PUGL_DOUBLE_BUFFER, false);
+ puglSetViewHint(dpugl->view, PUGL_DOUBLE_BUFFER, true);
puglSetViewHint(dpugl->view, PUGL_SWAP_INTERVAL, 1);
puglSetHandle(dpugl->view, dpugl);
puglSetEventFunc(dpugl->view, _d2tk_frontend_event_func);