I'm slightly confused about how Direct3D rendering works. Basically, as long as I render to one surface, everything is fine. But when I try rendering to multiple surfaces, it seems like everything is still rendered to one surface. I think there's something wrong with my calls.
For each update cycle this is what I do 1. device->BeginScene() 2. sprite->Begin(...)
... A bunch of GetRenderTarget to store the old render target, then SetRenderTarget to set a new surface, and then things like CreateVertexBuffer, SetTexture, etc to draw on the new render target. Then resetting to the old render target.
- sprite->Draw([the back buffer]) (the back buffer is actually another surface, not the actual back buffer. But here it is being drawn onto the actual back buffer, I think)
Also, it seems like if I mix sprite drawing and non-sprite drawing onto a surface, that first one set of render commands is executed and then the other set, rather than in order by when each command was called.
If anyone could shed light on any of this, it would be much appreciated.
EDIT: To clarify, my render targets are mainly surface 0 of the texture created by D3DXCreateTexture or D3DXCreateTextureFromFileEx.