aboutsummaryrefslogtreecommitdiff
path: root/nk_pugl
diff options
context:
space:
mode:
authorHanspeter Portner <dev@open-music-kontrollers.ch>2016-12-03 14:01:02 +0100
committerHanspeter Portner <dev@open-music-kontrollers.ch>2016-12-03 14:01:02 +0100
commit520e8926d9f8a0419e38d2bfa4664dba4f5cca74 (patch)
tree302882043b688471d900acccd1eac3045b2f93f1 /nk_pugl
parent8cdd596ca58bb0fab3114cb80821827590f406cc (diff)
parent74ec6c5abef07f28e16836b3daf84a8d77ccff23 (diff)
downloadsynthpod-520e8926d9f8a0419e38d2bfa4664dba4f5cca74.tar.xz
Merge commit '74ec6c5abef07f28e16836b3daf84a8d77ccff23' into nk
Diffstat (limited to 'nk_pugl')
-rw-r--r--nk_pugl/nk_pugl.h10
1 files changed, 5 insertions, 5 deletions
diff --git a/nk_pugl/nk_pugl.h b/nk_pugl/nk_pugl.h
index c9f32c59..45358de5 100644
--- a/nk_pugl/nk_pugl.h
+++ b/nk_pugl/nk_pugl.h
@@ -517,9 +517,6 @@ _nk_pugl_other_key(struct nk_context *ctx, const PuglEventKey *ev, int down)
nk_input_key(ctx, NK_KEY_TEXT_LINE_END, down);
} break;
}
-
- if(down)
- nk_input_char(ctx, ev->character + 96);
}
else // !control
{
@@ -917,7 +914,7 @@ nk_pugl_icon_load(nk_pugl_window_t *win, const char *filename)
int w, h, n;
uint8_t *data = stbi_load(filename, &w, &h, &n, 0);
- if(data && win->glGenerateMipmap)
+ if(data)
{
puglEnterContext(win->view);
{
@@ -927,8 +924,11 @@ nk_pugl_icon_load(nk_pugl_window_t *win, const char *filename)
glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR_MIPMAP_NEAREST);
glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
+ if(!win->glGenerateMipmap) // for GL >= 1.4 && < 3.1
+ glTexParameteri(GL_TEXTURE_2D, GL_GENERATE_MIPMAP, GL_TRUE);
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA8, w, h, 0, GL_RGBA, GL_UNSIGNED_BYTE, data);
- win->glGenerateMipmap(GL_TEXTURE_2D);
+ if(win->glGenerateMipmap) // for GL >= 3.1
+ win->glGenerateMipmap(GL_TEXTURE_2D);
}
puglLeaveContext(win->view, false);