-void load_texture(const char *filename)
-{
- unsigned w, h;
- unsigned char *pixels = load_image(filename, &w, &h);
-
-#if 1
- // we will convert to sRGB in the shader
- glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA8, w, h, 0, GL_RGB, GL_UNSIGNED_BYTE, pixels);
- check_error();
-#else
- // implicit sRGB conversion in hardware
- glTexImage2D(GL_TEXTURE_2D, 0, GL_SRGB8, w, h, 0, GL_RGB, GL_UNSIGNED_BYTE, pixels);
- check_error();
-#endif
-
- free(pixels);
-}
-