Ok, so you said we could ask anything here... :-)
We currently have an app running with thousand of users online, and the client uses DirectX7 2D.
Have been test-converting it to DirectX9 3D. Runs very well in test, but before advancing in modifying all the code, I have some questions, which are code design questions... here goes...
What do we have now: we have one window with the app running.
What do we want to have: multiple windows, showing different graphics from the same graphics-base.
So when I create a texture for use with a sprite (for now), then the texture seems to be bound to the device and the device seems to be bound to a window. So if I want to have 5 windows (different size), then does that mean that it has to have 5 devices and 5 sets of textures What I want, is to load all the textures, just once, and then use them across windows (scaling the textures among things)... how do to that
Next thing I want, is to display one texture into another... for example, I build a texture from other textures...
How to do that
Hope to get a reply soon! :-)
thanx in advance
Soren

IDirect3DDevice9 and multiple windows etc.
Baji Prasad
Will that create independent swapchains, that can be used for multiple windows If yes: when I use sprite->Draw, then it drawes to the device's default swapchain... how can I draw to other swapchains, and build several views with different sizes
GeorgeBH
I guess the following answers my question: :-)
// Tell the Direct3D device to render to the second swap chain’s back buffer
LPDIRECT3DSURFACE9 pBackBuffer = NULL;
g_swapChain_1->GetBackBuffer( 0, D3DBACKBUFFER_TYPE_MONO, &pBackBuffer );
g_pd3dDevice->SetRenderTarget( 0, pBackBuffer );
last question is still: how can I render one texture into another...
Lanex
cis001
El Bruno
wxin
So far so good...
new question: if I have say 5 windows... then I could render to #1, then 2, then 3, then 4 and then 5 and then call Present... but if I would render like #1, #2, #3, #1, #2, #5, #2 sort of randomly, then I use setrendertarget several times extra... does that cost performance If yes, then small/medium/big
and... this this the 100% correct way :
beginscene
setrendertarget #0
draw to #0
setrendertarget #1
draw to #1
setrendertarget #2
draw to #2
endscene
present #0
present #1
present #2
Loop
thanx again
sincerely,
Soren