You can’t. For that we’d need a rotation API, with the ability to manipulate vertices as they’re being drawn. We don’t have one yet.>From: delete12345 <tom_mai78101 at yahoo.com.tw>
Subject: [SDL] SDL 1.2 or 1.3: How to do Flip Sprites Vertically/Horizontally?
The other solution is to just blit it in strips, backwards or upside-down.
(Either to the display surface, or to a buffer, if you expect to use
the flipped- or mirrored- results often.)
e.g.:
/* src = your source surface /
/ dest = a dest surface; in this example, identical in size to src */
dest_rect.x = 0;
dest_rect.y = src->h - y - 1;
/* then blit */
}
/* now dest is a flipped version of src */
-bill!On Sun, May 02, 2010 at 08:45:41AM -0700, Jonathan Dearborn wrote:
Using Sprig (in SDL 1.2), this creates a new surface, vertically flipped:
SPG_Scale(mysurface, 1, -1);
SDL_gfx has a similar function in its rotozoom interface.
Jonny D
I need to use SDL_BlitSurface() and use dest_rect? Else, what is the
src_rect for?
The effects, which I have tried making it, isn’t right. Following along
the for loop, it seemed to move away from my sprite.
Awaiting your replies.
Bill Kendrick wrote:>
On Sun, May 02, 2010 at 08:45:41AM -0700, Jonathan Dearborn wrote:
Using Sprig (in SDL 1.2), this creates a new surface, vertically
flipped:
SPG_Scale(mysurface, 1, -1);
SDL_gfx has a similar function in its rotozoom interface.
Jonny D
The other solution is to just blit it in strips, backwards or upside-down.
(Either to the display surface, or to a buffer, if you expect to use
the flipped- or mirrored- results often.)
e.g.:
/* src = your source surface /
/ dest = a dest surface; in this example, identical in size to src */
I need to use SDL_BlitSurface() and use dest_rect? Else, what is the
src_rect for?
To take the appropriate slice of the source. In my example,
it takes the 1st row of the source, and blits it on the last row of the
destination. Then it takes the 2nd row of the source, and blits it on the
2nd-to-last row of the destination. And so forth, until it takes the last
(bottom-most) row of the source, and blits it on the 1st (top-most) row
of the destination. And there, you have the destination filled with an
upside-down rendering of the source surface.
The effects, which I have tried making it, isn’t right. Following along
the for loop, it seemed to move away from my sprite.
I have no idea what that means, sorry.
-bill!On Tue, May 04, 2010 at 02:01:33AM -0700, delete12345 wrote:
It means my sprite art wouldn’t show up, and instead, by reading the code
in the debugger, it tends to move the blitting offset away from the target
destination.
In data mercoled? 05 maggio 2010 15:20:36, delete12345 ha scritto:
: > 2. It means my sprite art wouldn’t show up, and instead, by reading the> code in the debugger, it tends to move the blitting offset away from the
target destination.
Bill Kendrick wrote:
I have no idea what that means, sorry.
–
Fabio Giovagnini
Aurion s.r.l.
P.I e C.F.
00885711200
Tel. +39.051.594.78.24
Cell. +39.335.83.50.919
I’m not sure if SDL and/or other libraries can be compiled under Visual
Studio 2010. I’ve been searching around Google for some time, but there’s no
answers.
Andreas Schiffler-2 wrote:>
Yes, you can use SDL_gfx:
SDL_SurfacezoomSurface(SDL_Surface src, double zoomx, double zoomy,
int smooth)
When zoomx and/or zoomy are negative the image is flipped on the
vertical and/or horizontal respectively.
It’s been 9 days since I had checked on this place. I was having midterm
exams, so I hoped this does not count as a bump or any sort.
Anyway, the problem I’m having is “Converting the Visual C projects to
Visual Studio 2010 (Version 10.0) C Projects”.
And what “vcproj” file should I use for minimal errors/warnings? And when
will SDL have VS 2010 compatible project files and subversions? (If worded
correctly…)
Awaiting replies sincerely.
Jonathan Dearborn-2 wrote:>
What problems are you having? Are you using the VisualC project in the
source distribution?