Sorry, I don't know what push to buffer/pop back from buffer means. I'm drawing a bunch of sprites on a surface using a shader, then drawing the surface with a different shader. I thought it would be "cleaner" to use Draw Begin and Draw.no. you should push the surface to buffer after finishing all draw operation.
and pop it back from buffer when the surface vanishing before painting.
Cause when you set the target, all things are drawn to it until you reset, right? I'm setting it only in the main draw, right before I need to clear/draw on it and then immediately resetting. Thanks for clearing it up, it's all much more organised now.EDIT: I think @Zhanghua was thinking that you were setting the surface target in the Draw Begin and then trying to draw to it in the Draw event. I assume you're not. If you're just checking if the surface exists and creating it if it doesn't in the Draw Begin, and setting the target and drawing to it in the Draw, that's fine. If you're setting the target in the Draw Begin and then trying to draw to it in the Draw event, that's not a good idea.