• Advertisement
Sign in to follow this  

Tricky Question:)

This topic is 4321 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

Ok this is tricky:) i have a texture thats 1024x768 my backbuffer is 1024x768 and i have texture thats 800x100 now what i do is render the 3rd texture onto the first one and then the first one to the backbuffer and then i present the backbuffer:) all works fine but the texture is the whole width of the screen:) i checked the widths of all three and they are exactly what they are supposed to be. i just cant figure out why my 800width texture fills the whole screen on a 1024 backbuffer:( here some code: Settup of the first texture:
 FBS2DRenderTarget::DoSetup(float BackBufferWidth, float BackBufferHeight, float BestResolutionWidth, float BestResolutionHeight, LPDIRECT3DDEVICE9 Device){	
	Device->GetRenderTarget(0, &m_pMainRenderTarget);
	D3DXCreateTexture(Device, BestResolutionWidth, BestResolutionHeight, 1, D3DUSAGE_RENDERTARGET, D3DFMT_A8R8G8B8, D3DPOOL_DEFAULT, &m_pMainTexture);	
	m_pMainTexture->GetSurfaceLevel(0, &m_pRenderTarget2D);
	D3DXCreateSprite(Device, &m_pSprite);	
	D3DXVECTOR2 Translation;
	Translation.x = 0;
	Translation.y = 0;
	D3DXVECTOR2 Scaling;	
	Scaling.x = BackBufferWidth/BestResolutionWidth;
	Scaling.y = BackBufferHeight/BestResolutionHeight;

	D3DXMatrixTransformation2D(&m_Mat, NULL, 0, &Scaling, NULL, 0, &Translation);	

well the 3rd i just create with createtexturefromfile and i draw it onto the first with the sprite draw funktion anyone have an idea what could cause this?:) its late and i should probably go to bed:)

Share this post

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

  • Advertisement