--- a/Texture.cpp Wed Dec 27 01:50:38 2023 +0100
+++ b/Texture.cpp Wed Dec 27 10:34:12 2023 +0100
@@ -77,19 +77,19 @@
impl->width = width;
impl->height = height;
- if (img.getSize() != impl->width * impl->height * 4)
+ if (img.getSize() != impl->width * impl->height * 3)
throw std::invalid_argument("invalid image size");
glBindTexture(GL_TEXTURE_2D, impl->id);
auto GLT2D = GL_TEXTURE_2D;
- glTexImage2D(GLT2D, 0, GL_RGBA,
+ glTexImage2D(GLT2D, 0, GL_RGB,
impl->width, impl->height,
- 0, GL_RGBA, GL_UNSIGNED_BYTE,
+ 0, GL_RGB, GL_UNSIGNED_BYTE,
img.getData());
glTexParameteri(GLT2D, GL_TEXTURE_WRAP_S, GL_REPEAT);
glTexParameteri(GLT2D, GL_TEXTURE_WRAP_T, GL_REPEAT);
glTexParameteri(GLT2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); // blurry upscale
- glTexParameteri(GLT2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST); // sharp upscale
+ // glTexParameteri(GLT2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST); sharp upscale
glTexParameteri(GLT2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR_MIPMAP_LINEAR);
glGenerateMipmap(GLT2D);
checkError(&std::cerr);