Skip to content

Commit f7e7947

Browse files
authored
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.
1 parent c52193b commit f7e7947

1 file changed

Lines changed: 23 additions & 0 deletions

File tree

example/canvas.c

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,29 @@ die(const char *fmt, ...)
7777
exit(EXIT_FAILURE);
7878
}
7979

80+
/* function icon_load () is not used in this file but might be useful :) */
81+
/*
82+
static struct nk_image
83+
icon_load(const char *filename)
84+
{
85+
int x,y,n;
86+
GLuint tex;
87+
unsigned char *data = stbi_load(filename, &x, &y, &n, 0);
88+
if (!data) die("[SDL]: failed to load image: %s", filename);
89+
90+
glGenTextures(1, &tex);
91+
glBindTexture(GL_TEXTURE_2D, tex);
92+
glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR_MIPMAP_NEAREST);
93+
glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR_MIPMAP_NEAREST);
94+
glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
95+
glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
96+
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA8, x, y, 0, GL_RGBA, GL_UNSIGNED_BYTE, data);
97+
glGenerateMipmap(GL_TEXTURE_2D);
98+
stbi_image_free(data);
99+
return nk_image_id((int)tex);
100+
}
101+
*/
102+
80103
static void
81104
device_init(struct device *dev)
82105
{

0 commit comments

Comments
 (0)