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

Author Topic: RenderTexture and Shapes: Fantoms Pixels  (Read 2131 times)

0 Members and 1 Guest are viewing this topic.

kryx

  • Jr. Member
  • **
  • Posts: 67
    • View Profile
RenderTexture and Shapes: Fantoms Pixels
« 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:



Thanks a lot!

binary1248

  • SFML Team
  • Hero Member
  • *****
  • Posts: 1405
  • I am awesome.
    • View Profile
    • The server that really shouldn't be running
Re: RenderTexture and Shapes: Fantoms Pixels
« Reply #1 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 is complete and is pending a merge into master.
SFGUI # SFNUL # GLS # Wyrm <- Why do I waste my time on such a useless project? Because I am awesome (first meaning).

kryx

  • Jr. Member
  • **
  • Posts: 67
    • View Profile
Re: RenderTexture and Shapes: Fantoms Pixels
« Reply #2 on: May 22, 2014, 11:44:00 am »
perfect, I'm waiting it so

 

anything