If I have an image surface - How do I draw it in a different size? (ie taking a 100x100 surface and drawing it 64x64 on the screen)
If I have an image surface - How do I draw it in a different size? (ie taking a 100x100 surface and drawing it 64x64 on the screen)
William Cairns
My Games: http://www.cairnsgames.co.za (Currently very inactive)
MyOnline Games: http://TheGameDeveloper.co.za (Currently very inactive)
I believe SDL_BlitSurface lets you specify destination dimentions
From comment before SDL_BlitSurface
And if a different sized Rect is passed only the top,left parameters are used. And the whole image is drawn.This performs a fast blit from the source surface to the destination
surface. It assumes that the source and destination rectangles are
the same size. If either 'srcrect' or 'dstrect' are NULL, the entire
surface (src or dst) is copied. The final blit rectangles are saved
in 'srcrect' and 'dstrect' after all clipping is performed.
William Cairns
My Games: http://www.cairnsgames.co.za (Currently very inactive)
MyOnline Games: http://TheGameDeveloper.co.za (Currently very inactive)
Took a look through SDL unit and found no other function for blitting, guess you?¢_Tll stuck with locking surfaces and doing scaling be hand.
i tried to stretchsurfaces in sdl once only to find out that you had to use some weirdo library somewhere.. i never got i working i remember
you can't use stretchblt on sdl surfaces?
Peregrinus, expectavi pedes meos in cymbalis
Nullus norvegicorum sole urinat
I have found the following functions in SDLUtils:
SDL_ScaleSurfaceRect
SDL_Stretch8
SDL_ZoomSurface
The ScaleSurface uses Stretch8.
ZoomSurface does Pixel level gets and puts. The Stretch seems to do row by row manipulation.
I'll try get a StretchDraw function working in S2DL for doing this. (May be more efficient to size the entire image surface and then use when/if needed)
William Cairns
My Games: http://www.cairnsgames.co.za (Currently very inactive)
MyOnline Games: http://TheGameDeveloper.co.za (Currently very inactive)
Bookmarks