Hi, we're upgrading to SFML2 using the latest snapshot, thus we use the recent sf::Texture addition.
We have discovered a possible bug having to do with using the image pixel width rather than pitch in Texture::LoadFromImage.
This is the current code:
// Copy the pixels to the texture, row by row
const Uint8* pixels = image.GetPixelsPtr() + rectangle.Left + (width * rectangle.Top);
GLCheck(glBindTexture(GL_TEXTURE_2D, myTexture));
for (int i = 0; i < rectangle.Height; ++i)
{
GLCheck(glTexSubImage2D(GL_TEXTURE_2D, 0, 0, i, myWidth, 1, GL_RGBA, GL_UNSIGNED_BYTE, pixels));
pixels += width;
}
It is very likely it should take pixel bit depth into consideration, that is width * 4 for a 32bpp RGBA pixel:
// PITCH
const Uint8* pixels = image.GetPixelsPtr() + 4 * (rectangle.Left + (width * rectangle.Top));
GLCheck(glBindTexture(GL_TEXTURE_2D, myTexture));
for (int i = 0; i < rectangle.Height; ++i)
{
GLCheck(glTexSubImage2D(GL_TEXTURE_2D, 0, 0, i, myWidth, 1, GL_RGBA, GL_UNSIGNED_BYTE, pixels));
// PITCH
pixels += 4 * width;
}