is the problem. I haven't worked with SDL, but my intuition tells me you need to adjust your width/height after rotating a surface. Looking at the sdl_rotatezoom header I found a function that may help you:
void rotozoomSurfaceSize(int width, int height, double angle, double zoom, int *dstwidth,int *dstheight);
On a side note, what is this line for?
m_image=imagerotated;
It looks like a memory leak.
[Edited by - deathkrush on May 6, 2006 3:51:22 PM]
how does it kill both of my pointers? don't i free only the imagerotated surface with freesurface?
and i still get the segmentation fault even after adding that line (though it wouldn't be practical because i don't want to loose the image in the m_image surface because it's a class member not a local variable)
"Try not to become a man of success but rather to become a man of value." - Albert Einstein
Quote:Original post by Hypherion how does it kill both of my pointers? don't i free only the imagerotated surface with freesurface?
and i still get the segmentation fault even after adding that line (though it wouldn't be practical because i don't want to loose the image in the m_image surface because it's a class member not a local variable)
Well, when you do
m_image=imagerotated;
that pretty loses whatever data m_image was pointing too. When you free imagerotated surface, both m_image and imagerotated pointers end up pointing into nothing.