Hi, I am using Image as texture source from .tga file but it does not work correctly. One texture is working great, but the second, that is loaded first, is showing only by going closer. Where can be the problem please?
sf::Image image;
image.loadFromFile(matProp.textureFile);
GLuint generatedTex = 0;
glGenTextures(1, &generatedTex);
glBindTexture(GL_TEXTURE_2D, generatedTex);
glTexImage2D(GL_TEXTURE_2D,
0,
GL_RGBA,
image.getSize().x,
image.getSize().y,
0,
GL_RGBA,
GL_UNSIGNED_BYTE,
image.getPixelsPtr());
//glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT);
//glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR_MIPMAP_LINEAR);
glGenerateMipmap(GL_TEXTURE_2D);
matProp.texture = generatedTex;