Sign in to follow this  
Belkacem

ResizeBuffer Not Working !

Recommended Posts

Belkacem    100
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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this