From f7e79476ee9c82891b7631f337124a2aa98c7fb9 Mon Sep 17 00:00:00 2001 From: crazyBaboon Date: Tue, 1 Oct 2019 10:29:34 +0100 Subject: [PATCH] comment out icon_load() As suggested, altought icon_load() is not used to build this example/canvas.c, it might still be useful. So instead of deleting, the function is now commented. --- example/canvas.c | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/example/canvas.c b/example/canvas.c index 399963e..5738d5d 100644 --- a/example/canvas.c +++ b/example/canvas.c @@ -77,6 +77,29 @@ die(const char *fmt, ...) exit(EXIT_FAILURE); } +/* function icon_load () is not used in this file but might be useful :) */ +/* +static struct nk_image +icon_load(const char *filename) +{ + int x,y,n; + GLuint tex; + unsigned char *data = stbi_load(filename, &x, &y, &n, 0); + if (!data) die("[SDL]: failed to load image: %s", filename); + + glGenTextures(1, &tex); + glBindTexture(GL_TEXTURE_2D, tex); + glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR_MIPMAP_NEAREST); + 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); + glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA8, x, y, 0, GL_RGBA, GL_UNSIGNED_BYTE, data); + glGenerateMipmap(GL_TEXTURE_2D); + stbi_image_free(data); + return nk_image_id((int)tex); +} +*/ + static void device_init(struct device *dev) {