Skip to content

Commit

Permalink
icon_load() function not used
Browse files Browse the repository at this point in the history
This function was not used in this file, so... removed.
  • Loading branch information
crazyBaboon authored Sep 30, 2019
1 parent 3e13d36 commit c52193b
Showing 1 changed file with 0 additions and 20 deletions.
20 changes: 0 additions & 20 deletions example/canvas.c
Original file line number Diff line number Diff line change
Expand Up @@ -77,26 +77,6 @@ die(const char *fmt, ...)
exit(EXIT_FAILURE);
}

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)
{
Expand Down

0 comments on commit c52193b

Please sign in to comment.