Sign in to follow this  

ResizeBuffer Not Working !

This topic is 2476 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 have this function to resize my Application

[code] RECT Rect ;
ZeroMemory(&Rect , sizeof(RECT));
::GetWindowRect ( _hwnd , &Rect);

UINT tempwidth = Rect.right - Rect.left ;
UINT tempheight = Rect.bottom - Rect.top ;


ReleaseCOM(_Target);
ReleaseCOM(_Target_Tex2D);



if ( SUCCEEDED ( _SwapChain->ResizeBuffers ( _Swp_Chain_desc.BufferCount, tempwidth , tempheight , _Device_Format , 0 )))
{

if ( SUCCEEDED (_SwapChain->GetBuffer (0 , __uuidof(ID3D11Texture2D) , reinterpret_cast <void**>(&_Target_Tex2D))))
{

if ( FAILED( _Device->CreateRenderTargetView ( _Target_Tex2D , 0 , &_Target)))
{
exit(0);
}
}[/code]


and i call this function when i get WM_SIZE message in the loop game.

and whene i resize my window i get everything black and it is my render target color

but if i dont resize my window i get the scene correctly that is a HUD and meshes



ok guys you have the code

is it the probleme in the code or another else.

Share this post


Link to post
Share on other sites
anothrt question !!
what is the difference between resizebuffer and resizetarget ??

Share this post


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