Skip to main content
gamedev.net
🔒 Locked

ResizeBuffer Not Working !

Started by Belkacem 0 replies 1.1k views
Original Post
Belkacem
Belkacem
hi ;

i have this function to resize my Application

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);
}
}



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.
Belkacem
Belkacem
anothrt question !!
what is the difference between resizebuffer and resizetarget ??

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.