aboutsummaryrefslogtreecommitdiff
path: root/nk_pugl
diff options
context:
space:
mode:
authorHanspeter Portner <dev@open-music-kontrollers.ch>2016-12-03 14:02:28 +0100
committerHanspeter Portner <dev@open-music-kontrollers.ch>2016-12-03 14:02:28 +0100
commitdfdeabc62c0b9417b2552060ae0297653c07a8e4 (patch)
tree77f36297e3c2e7a5330a3341aea3bbae48c7a1e3 /nk_pugl
parent4f3079ac642924b3f9c3bcf3c774cba95a1914ca (diff)
parent74ec6c5abef07f28e16836b3daf84a8d77ccff23 (diff)
downloadsherlock.lv2-dfdeabc62c0b9417b2552060ae0297653c07a8e4.tar.xz
Merge commit '74ec6c5abef07f28e16836b3daf84a8d77ccff23'
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 d95d0e8..6b06828 100644
--- a/nk_pugl/nk_pugl.h
+++ b/nk_pugl/nk_pugl.h
@@ -509,9 +509,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
{
@@ -909,7 +906,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);
{
@@ -919,8 +916,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);