Archived

This topic is now archived and is closed to further replies.

wise_Guy

Simple sprite flipping in DirectX

Recommended Posts

G''day folks! I''ve been trying to flip my sprite horizontally in DirectX recently and am not sure how to do it. I have tried to just invert the left and right properties of the source and/or dest rectangles, but that don''t seem to work :-( Is there an easy way to do this using directx? Note that I don''t need to rotate the sprites or flip the backbuffer, just flip the sprite along the y axis (horizontally) - to save disk space and only use half as many sprites (less download times). Thanks in advance wise_guy

Share this post


Link to post
Share on other sites
why don''t you lock the surface and manipulate the data directly?
look for IDirectDrawSurface->Lock() in the documentation.
btw i don''t think mirrored blts are supported by HEL and that means if a user has no videocard that supports it, it won''t be emulated by ddraw, so prolly not the way to go

Share this post


Link to post
Share on other sites
I would just go ahead and draw the extra sprites beforehand. True, it will mean longer download times but manipulating the data directly like in the post above mine takes time and will slow down your program, especially as your bitmaps get larger.
I would rather take a little longer to download then watch the FPS drop due to my program having to manipulate all the data to flip it


"Now go away or I shall taunt you a second time"
- Monty Python and the Holy Grail
themGames Productions

Share this post


Link to post
Share on other sites
or you can flip them once at the begining of the program and save it to an offscreen surface, and blt from that when you want it to be flipped you only get a slight slow down while loading.
after that you wouldnt loose any speed, and you dont have the huge files

Im Always Bored
--Bordem
ICQ: 76947930

Share this post


Link to post
Share on other sites