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

Author Topic: Flipped Y coordinate in a shader  (Read 1879 times)

0 Members and 1 Guest are viewing this topic.

dydya-stepa

  • Jr. Member
  • **
  • Posts: 82
    • View Profile
Flipped Y coordinate in a shader
« on: January 07, 2012, 03:24:05 pm »
/* idea
RenderImage image;
image.Create(800, 600);
*/

I have a render image (slightely outdated SFML 2.0). If I draw into it with shader and then draw into window it works ok.

image.Clear();
image.Draw(background , shader);
image.Display();

sf::Sprite sprite(image.GetImage());
window.Draw(sprite);

If I try to set shader in the second call Y coordinate is flipped in result shader

image.Clear();
image.Draw(background);
image.Display();

sf::Sprite sprite(image.GetImage());
window.Draw(sprite, shader);

Why ?

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32504
    • View Profile
    • SFML's website
    • Email
Flipped Y coordinate in a shader
« Reply #1 on: January 07, 2012, 04:48:30 pm »
Because you use an old version of SFML 2 ;)
Laurent Gomila - SFML developer

dydya-stepa

  • Jr. Member
  • **
  • Posts: 82
    • View Profile
Flipped Y coordinate in a shader
« Reply #2 on: January 07, 2012, 08:35:32 pm »
are you sure it will help me? i can fix myself if it's not much if you point me where is this bug. I don't want to switch now to newest version - i need to write more code first.

Nexus

  • SFML Team
  • Hero Member
  • *****
  • Posts: 6287
  • Thor Developer
    • View Profile
    • Bromeon
Flipped Y coordinate in a shader
« Reply #3 on: January 07, 2012, 09:50:47 pm »
Quote from: "dydya-stepa"
I don't want to switch now to newest version - i need to write more code first.
What's the point of that? Then you only have to convert more code... Remember that there will be a lot to convert ;)
Zloxx II: action platformer
Thor Library: particle systems, animations, dot products, ...
SFML Game Development:

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32504
    • View Profile
    • SFML's website
    • Email
Flipped Y coordinate in a shader
« Reply #4 on: January 07, 2012, 10:10:26 pm »
I'm not sure of what the source of the problem is, but I'm sure that it works with the current revision.
Laurent Gomila - SFML developer

dydya-stepa

  • Jr. Member
  • **
  • Posts: 82
    • View Profile
Flipped Y coordinate in a shader
« Reply #5 on: January 10, 2012, 12:30:16 pm »
my actual code doesn't depend on sfml fortunately. All I need is to change some internal implementations - like switch from RenderImage to RenderTexture. It's not much at all.

Probably I can live with this bug for a while. I want to switch to an official sfml 2.0.