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 - Odysseus

Pages: [1]
1
Graphics / Strange Blurring
« on: January 21, 2009, 09:21:30 pm »
Quote from: "quasius"

Because OpenGL is autmatically using sub-pixel interpolation to place your sprite.  (Remember positions are in floats).  This makes movement look smoother, but you may want to round your sprite positions the the nearest whole number when they stop.  Alternately, just disable the smoothing completely as Laurent showed.


Ahh.  I don't really understand, but that's alright.  SetSmooth(false) will work fine.

I guess I just don't consider it intuitive.

2
Graphics / Strange Blurring
« on: January 21, 2009, 08:53:51 pm »
Ok, thanks.

It still seems odd to me that it gets stretched even though it hasn't been moved or scaled or rotated or anything.  Why is that?
I mean, what's the point of the smooth filter anyway.  I don't really understand it.

And at any rate, it certainly wasn't the expected output.

3
Graphics / Strange Blurring
« on: January 21, 2009, 07:08:02 am »
With the same sprite centered in a larger window:


Looking at the image in gimp reveals that the sprite size is indeed 100x100 pixels, but for some reason, the texture has been stretched half a pixel in all directions. :?:

I also wonder if this stretching is hurting performance.

4
Graphics / Strange Blurring
« on: January 21, 2009, 06:48:01 am »
This code:
Code: [Select]
#include <SFML/Graphics.hpp>

int main()
{
    //A simple, randomized pixel array
    uint8_t PixelData[100*100*4];
    for (int i=0; i < 100*100*4; i++)
    {
        PixelData[i] = rand();
    }

    //respective images and sprite using that array
    sf::Image Image( 100, 100, PixelData );
    sf::Sprite Sprite(Image);

    //draw the sprite to a window
    sf::RenderWindow App( sf::VideoMode(100,100,32), "SFML WIndow" );
    App.Draw(Sprite);
    App.Display();

    //Capture the window
    App.Capture().SaveToFile("window.png");

    return 0;
}


results in:


when it shoud result in:


 What gives?

Pages: [1]
anything