SFML community forums

Help => Graphics => Topic started by: kryx on May 22, 2014, 10:08:50 am

Title: RenderTexture and Shapes: Fantoms Pixels
Post by: kryx on May 22, 2014, 10:08:50 am
Helllo!

I have a problem when I use 2 RenderTexture and a CircleShape.
If I draw the on the first RenderTexture, this on the second RenderTexture and then on the screen and if I move the Circle, I obtain som pixels where the circle was and shouldn't be.

I use the last version of sfml 32 bits. I'm on Windows 7 and I use a Nvidia 650M GT (up-to-date). I have tried with last sdk and last version of github. I don't have tried with 64 bits version.

Here is my code:

#include "stdafx.h"
#include <SFML/Graphics.hpp>

int main()
{
    sf::RenderWindow window(sf::VideoMode(500, 500), "SFML works!");
        sf::RenderTexture t1,t2;
        sf::Sprite s1,s2;
    sf::CircleShape shape(10.f);
    shape.setFillColor(sf::Color::Green);

        t1.create(500,500);
        t2.create(500,500);
        s1.setTexture(t1.getTexture());
        s2.setTexture(t2.getTexture());

        int i = 5;

    while (window.isOpen())
    {
        sf::Event event;
        while (window.pollEvent(event))
        {
            if (event.type == sf::Event::Closed)
                window.close();
        }

                t1.clear();
                t2.clear();
                t1.draw(shape);
                t1.display();
                t2.draw(s1);
                t2.display();

                i += 5;
                shape.setPosition(i,0);

        window.clear();
        window.draw(s2);
        window.display();
    }

    return 0;
}
 

and the result:

(http://img15.hostingpics.net/pics/426288Sanstitre.png) (http://www.hostingpics.net/viewer.php?id=426288Sanstitre.png)

Thanks a lot!
Title: Re: RenderTexture and Shapes: Fantoms Pixels
Post by: binary1248 on May 22, 2014, 11:42:51 am
This is the same issue as described in this thread:
http://en.sfml-dev.org/forums/index.php?topic=9350.0

The fix (https://github.com/SFML/SFML/pull/591) is complete and is pending a merge into master.
Title: Re: RenderTexture and Shapes: Fantoms Pixels
Post by: kryx on May 22, 2014, 11:44:00 am
perfect, I'm waiting it so