[SDL2]-Flip Texture Horizontally & Vertically Simultaneously

[SDL2]-Flip Texture Horizontally & Vertically Simultaneously

Hi,

Is it possible to flip a texture horizontally and vertically simultaneously?

Here is my code, which compiles with an error:

Code:
else if (Sprites[index].FlipX == true && Sprites[index].FlipY == true)
{
SDL_RenderCopyEx(Renderer, Sprites[index].Texture, NULL, &destinationRect, Sprites[index].RotationDegree
, NULL, SDL_FLIP_HORIZONTAL | SDL_FLIP_VERTICAL);
}

Help would be appreciated, thanks!------------------------
JeZ+Lee
JessePalser <AT> Gmail <DOT> com
16BitSoft®
Video Game Design Studio
www.16BitSoft.com

Instead of SDL_RenderCopyEx, try SDL_RenderCopyFlipped.________________________________
From: JeZ-l-Lee
To: sdl at lists.libsdl.org
Sent: Tuesday, August 13, 2013 8:36 AM
Subject: [SDL] [SDL2]-Flip Texture Horizontally & Vertically Simultaneously

[SDL2]-Flip Texture Horizontally & Vertically Simultaneously

Hi,

Is it possible to flip a texture horizontally and vertically simultaneously?

Here is my code, which compiles with an error:

Code:
else if (Sprites[index].FlipX == true && Sprites[index].FlipY == true)
{
? ? SDL_RenderCopyEx(Renderer, Sprites[index].Texture, NULL, &destinationRect, Sprites[index].RotationDegree
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? , NULL, SDL_FLIP_HORIZONTAL | SDL_FLIP_VERTICAL);
} Help would be appreciated, thanks!


JeZ+Lee
JessePalser Gmail com
16BitSoft®
Video Game Design Studio
www.16BitSoft.com


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

First of all: C++? Because in C++ you aren’t allowed to do bit
operations on enumerations… (yeah, the flags are an enumeration,
that’s kind of a big issue sigh) Maybe there should be a
SDL_FLIP_BOTH that’s just the OR of both values.

Meanwhile: rotating 180? is exactly the same as flipping horizontally
and vertically, so you can try that as a workaround.

2013/8/13, JeZ-l-Lee :> [SDL2]-Flip Texture Horizontally & Vertically Simultaneously

Hi,

Is it possible to flip a texture horizontally and vertically
simultaneously?

Here is my code, which compiles with an error:

Code:
else if (Sprites[index].FlipX == true && Sprites[index].FlipY == true)
{
SDL_RenderCopyEx(Renderer, Sprites[index].Texture, NULL,
&destinationRect, Sprites[index].RotationDegree
, NULL, SDL_FLIP_HORIZONTAL |
SDL_FLIP_VERTICAL);
}

Help would be appreciated, thanks!


JeZ+Lee
JessePalser <AT> Gmail <DOT> com
16BitSoft®
Video Game Design Studio
www.16BitSoft.com

First of all: C++? Because in C++ you aren’t allowed to do bit
operations on enumerations… (yeah, the flags are an enumeration,
that’s kind of a big issue sigh)

But you can define it easily:

enum ab {a,b};
ab operator | (ab x, ab y) { return ab (uint_t x | uint_t u); }

(untested)On 14/08/2013, at 1:58 AM, Sik the hedgehog wrote:


john skaller
@john_skaller
http://felix-lang.org