I have a project where I scale a lot of images. I have a class where I keep a pointer to the original and create a new surface for the scaled image any time it needs to be re-sized.
I was using the SetRenderTarget and blit-stretching onto it, then passing back a pointer to the new surface. It appeared to not have the correct size (image was skewed and partially corrupted).
After changing the SetRenderTarget to CreateRasterizer before the stretch-blit, everything works out as expected.
The question is what's the difference? Is there a problem with starting a scene with the "display" and then setting/resetting the target and then calling display->update? Or should it be kept completely separate (ie. don't start scene until after temp images have been re-scaled). And, in theory, do you need to end drawing to the surface by calling a display->Update()?
BTW, thanks to Presto for pointing out the CreateRasterizer function. I hadn't paid much attention to it. It's actually much better than having to set the target and more readable as well. And, unless there's something I haven't seen, there's not really a reason to use the SetRenderTarget unless you had a chunk of code that you wanted to draw to both the screen and a surface.
Jason
I was using the SetRenderTarget and blit-stretching onto it, then passing back a pointer to the new surface. It appeared to not have the correct size (image was skewed and partially corrupted).
After changing the SetRenderTarget to CreateRasterizer before the stretch-blit, everything works out as expected.
The question is what's the difference? Is there a problem with starting a scene with the "display" and then setting/resetting the target and then calling display->update? Or should it be kept completely separate (ie. don't start scene until after temp images have been re-scaled). And, in theory, do you need to end drawing to the surface by calling a display->Update()?
BTW, thanks to Presto for pointing out the CreateRasterizer function. I hadn't paid much attention to it. It's actually much better than having to set the target and more readable as well. And, unless there's something I haven't seen, there's not really a reason to use the SetRenderTarget unless you had a chunk of code that you wanted to draw to both the screen and a surface.
Jason