Welcome, Guest. Please login or register. Did you miss your activation email?

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - tester

Pages: 1 [2]
16
Graphics / Sprite is blurry
« on: April 15, 2010, 11:40:43 pm »
Oh great! Thanks a lot.

17
Graphics / Sprite is blurry
« on: April 15, 2010, 11:32:01 pm »
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:
Code: [Select]
#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();
}
}

Pages: 1 [2]