Jump to content

View more

Image of the Day

The night is still, but the invasion brings chaos. #screenshotsaturday #hanako #indiegame #gameart #ue4 #samurai https://t.co/cgILXuokoS
IOTD | Top Screenshots

The latest, straight to your Inbox.

Subscribe to GameDev.net Direct to receive the latest updates and exclusive content.


Sign up now

How does one recreate the backbuffer in d3d 9?

4: Adsense

Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.


  • You cannot reply to this topic
3 replies to this topic

#1 noatom   Members   

925
Like
0Likes
Like

Posted 16 February 2013 - 05:30 AM

Because I don't have experience with d3d9,I don't know how to do it.I tried msdn,but d3d9 is a little bit different from 10 and 11.

 

Anyway,if I have a pointer to a backbuffer,what's the proper way to resize it in d3d9?

BTW: If you could show me some actual code,it would help a lot!



#2 NewDisplayName   Members   

359
Like
0Likes
Like

Posted 16 February 2013 - 06:30 AM

Whenever window gets resized, I usually take the following approach. This should work for you as well.
 
d3dpp.SwapEffect = D3DSWAPEFFECT_DISCARD;
 
GetClientRect(winh, &winRect);
 
//Use winRect to calculate winHeight and winWidth.
 
if(!fullScreen)
{
d3dpp.Windowed = TRUE;
d3dpp.BackBufferHeight = winHeight;
d3dpp.BackBufferWidth = winWidth;
}
else
{
d3dpp.Windowed = FALSE;
d3dpp.BackBufferWidth = (LONG) ::GetSystemMetrics(SM_CXSCREEN);
d3dpp.BackBufferHeight = (LONG) ::GetSystemMetrics(SM_CYSCREEN);
d3dpp.PresentationInterval = D3DPRESENT_INTERVAL_IMMEDIATE;
}

 

 

D3DDISPLAYMODE d3ddm;
pD3D->GetAdapterDisplayMode(D3DADAPTER_DEFAULT, &d3ddm);
pd3dpp->BackBufferFormat = d3ddm.Format;
 
// Call CreateDevice


#3 mhagain   Members   

13160
Like
0Likes
Like

Posted 16 February 2013 - 07:05 AM

The "official" way to resize the back buffer is to call IDirect3DDevice9::Reset - you will probably also need to do a bunch of work before and after the Reset call - see the Remarks section in the link provided.


It appears that the gentleman thought C++ was extremely difficult and he was overjoyed that the machine was absorbing it; he understood that good C++ is difficult but the best C++ is well-nigh unintelligible.


#4 BornToCode   Members   

1185
Like
0Likes
Like

Posted 16 February 2013 - 11:03 AM

The "official" way to resize the back buffer is to call IDirect3DDevice9::Reset - you will probably also need to do a bunch of work before and after the Reset call - see the Remarks section in the link provided.

You will also need to delete all resources allocated with D3DPOOL_DEFAULT and reallocate them otherwise Reset will fail. Once you reset the device you will need to reallocate all the resources that were using D3DPOOL_DEFAULT. I hope this helps






Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.