Hello. I just started messing with SFML for fun, i found something strange when trying to get colors per pixels, maybe (probably) i'm using something wrong, but still, here's what i'm getting:
img_Width = myImage.GetWidth ( );
img_Height = myImage.GetHeight ( );
for ( Uint32 i = 0; i != img_Width; ++i ) {
for ( Uint32 j = 0; j != img_Height; ++j ) {
const sf::Color color = myImage.GetPixel ( i, j );
std::cout << "Color of Pixel [i] x [j] \n";
std::cout << "Red = " << color.r;
std::cout << " Green = " << color.g;
std::cout << " Blue = " << color.b << std::endl;
}
}
testSprite.SetImage ( myImage );
}
i don't get why every GetPixel are returning an empty sf::Color, it's showing well on the window (it's the blue square with green border)