4
« on: October 31, 2011, 06:47:37 pm »
Hello everyone, this is my first post. I've been using SFML for a while now and I love it. Thanks for your hard work, Laurent.
I have this unwanted line problem also. I'm confused as to what I need to do. Using easy's advice to convert the view to integer coordinates doesn't work for me. And Haikarainen, I don't understand what you have suggested. Could you clarify please?
My view never moves. I render my game at 1280x720 and use the view to scale it up or down, depending on the resolution. Here is where I set my view:
MainView->Reset(sf::FloatRect(0, 0, 1280, 720));
MainView->SetViewport(sf::FloatRect(0.0f, 0.0f, 1.0f, 1.0f));
MainWindow->SetView(*MainView);
That never changes. I get the lines when I'm not rendering to a native 1280x720 resolution or window size. Does that mean I'm out of luck? Is there any hack I can apply? Am I doing this completely wrong and should I be using another technique instead of using the view to scale my game?
Edit: I just looked into RenderTexture. Would this be the correct way? I could render the entire scene into a texture and then scale that to the window? Would there be a performance hit for that?
Edit again: I just tried the RenderTexture. It was so easy to change over. It works perfect now. I can scale my game to any resolution without the lines showing up. I'd still like to know if I have the right idea though.