mirror of
https://github.com/libretro/RetroArch.git
synced 2024-11-30 19:50:24 +00:00
(zahnrad) Add HAVE_OPENGL ifdef
This commit is contained in:
parent
1af81201a0
commit
2e11895ef9
@ -26,6 +26,7 @@ struct zr_image zr_common_image_load(const char *filename)
|
||||
unsigned char *data = stbi_load(filename, &x, &y, &n, 0);
|
||||
if (!data) printf("Failed to load image: %s\n", filename);
|
||||
|
||||
#if defined(HAVE_OPENGL) || defined(HAVE_OPENGLES)
|
||||
glGenTextures(1, &tex);
|
||||
glBindTexture(GL_TEXTURE_2D, tex);
|
||||
glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR_MIPMAP_NEAREST);
|
||||
@ -34,6 +35,8 @@ struct zr_image zr_common_image_load(const char *filename)
|
||||
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);
|
||||
#endif
|
||||
|
||||
stbi_image_free(data);
|
||||
return zr_image_id((int)tex);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user