Jump to content
  • Advertisement
Sign in to follow this  
Rozik

Tricky Question:)

This topic is 4416 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;	
	FBS2DRenderTarget::instance()->SetXScale(BestResolutionWidth/BackBufferWidth);
	FBS2DRenderTarget::instance()->SetYScale(BestResolutionHeight/BackBufferHeight);
	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
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.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!