Original Post
🔒 Locked
Direct3D9 SetRenderTarget usage
Advertisement
You can render to a texture as follows:
1 Get the surface (IDirect3DSurface9) interface of the texture you want to render to
2 Get the old surface that is currently being rendered to
3 Set the texture''s surface as the render target
4 Render stuff as usual
5 When done, set the old surface as the render target
I dont believe Im forgetting anything...
| TripleBuffer Software |
| Plug-in Manager :: DX Utility Engine :: C++ Debug Kit :: DirectX Tutorials :: Awesome Books |
1 Get the surface (IDirect3DSurface9) interface of the texture you want to render to
2 Get the old surface that is currently being rendered to
3 Set the texture''s surface as the render target
4 Render stuff as usual
5 When done, set the old surface as the render target
IDirect3DSurface9* pSurf, *pOldTarget;
// 1
pTexture->GetSurfaceLevel( 0, &pSurf );
// 2
pDevice->GetRenderTarget( 0, &pOldTarget );
// 3
pDevice->SetRenderTarget( pSurf );
// 4
// 5
pDevice->SetRenderTarget( pOldTarget );
// Dont forget to release surface
pSurf->Release();
pOldTarget->Release();
I dont believe Im forgetting anything...
| Plug-in Manager :: DX Utility Engine :: C++ Debug Kit :: DirectX Tutorials :: Awesome Books |
Topic Locked
This topic has been locked by a moderator. New replies are not allowed.
Sign in to reply to this topic.
Advertisement