Jump to content
  • Advertisement
Sign in to follow this  
nchannon

how do I copy multible textures to an offscreensurface

This topic is 2581 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi,
I need to copy multible textures to one offscreensurface I know how to copy one texture to a surface but not two or more textures to a surface. My code might explain it better
hr = g_pd3dDevice->Clear(0,NULL,D3DCLEAR_TARGET| D3DCLEAR_ZBUFFER ,D3DCOLOR_XRGB(0,0,0),1.0f,0);
D3DXMatrixTranslation( &matWorld, 0.0f, 0.0f, 2.5f );
hr = g_pd3dDevice->SetTransform( D3DTS_WORLD, &matWorld );
g_pd3dDevice->BeginScene();
hr = g_pd3dDevice->SetTextureStageState( 1, D3DTSS_COLOROP, D3DTOP_ADD );
hr = g_pd3dDevice->SetTexture( 0, g_LiveTexture );
hr = g_pd3dDevice->SetTexture( 1, g_Texture[0] );
hr = g_pd3dDevice->SetStreamSource( 0, g_VertexBuffer, 0, (Vertex) );
hr = g_pd3dDevice->SetFVF( Vertex::FVF_Flags );
hr = g_pd3dDevice->DrawPrimitive( D3DPT_TRIANGLESTRIP, 0, 2 );
g_pd3dDevice->EndScene();
g_LiveTexture->Release();
g_pd3dDevice->Present( NULL, NULL, NULL, NULL );


So instead of presenting the two textures g_LiveTexture and g_Texture[0] to the frontbuffer as is in the example I want to copy them to an offscreensurface first so I can use StretchRect(..) so my surfaces fit my window correctly as my window size is not 2 ^ 2

currently i have to use
[font="Consolas"][font="Consolas"]D3DXMatrixPerspectiveFovLH(&matProj,D3DX_PI / 4.0f,aspect,1.0f,100.0f); and change aspect float value to 0.9f but its not an exact fit to my window I guess theres a betterway of doing this if someone could point me into the right direction
thanks[/font][/font] Edited by nchannon

Share this post


Link to post
Share on other sites
Advertisement
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!