Original Post
Hi all:
I had a function doing stuff on input textures, I'm not sure how to do this correctly. I want the function to be like this:
HRESULT function(IDirect3DTexture9* input1, IDirect3DTexture9* input2, IDirect3DTexture9** output)
{
IDirect3DTexture9* tempTex;
LPDIRECT3DSURFACE9 OldRT;
LPDIRECT3DSURFACE9 NewRT;
tempTex->GetSurfaceLevel(0, &NewRT);
m_pd3dDevice->GetRenderTarget( 0, &OldRT );
m_pd3dDevice->SetRenderTarget( 0, NewRT);
m_pd3dDevice->SetTexture( 0, input1 ); //??
m_pd3dDevice->SetTexture( 1, input2 ); //??
m_pd3dDevice->BeginScene();
.
.
.
m_pd3dDevice->EndScene();
*output = tempTex; //??
m_pd3dDevice->SetRenderTarget( 0, OldRT);
tempTex->Release();
OldRT->Release();
NewRT->Release();
}
I'm not sure if this function is gonna work,especially on the lines with "??", any suggestions?
[edited by - 991060 on May 2, 2004 5:45:11 AM]