I'm experimenting with the SFML and wrote a sample program to display a sprite.
This is the sprite (as a BMP, but PNG produces the same problem):
And this is the output:
But of course, I would expect this:
So, why is it displayed so blurry?
This is my code:
#include <SFML/Graphics.hpp>
int main()
{
sf::RenderWindow screen(sf::VideoMode(100, 50, 32), "Test");
sf::Image image;
image.LoadFromFile("Mario.png");
sf::Sprite sprite;
sprite.SetImage(image);
while (screen.IsOpened())
{
sf::Event event;
while (screen.GetEvent(event))
{
if (event.Type == sf::Event::Closed)
screen.Close();
}
screen.Clear(sf::Color(0, 127, 127));
screen.Draw(sprite);
screen.Display();
}
}