Game Development Reference
In-Depth Information
Alternatively, the API may discard the content that was just rendered, allowing the
game to continue, but wasting a frame and causing the front buffer to repeat if the
monitor wants to refresh while the game is drawing. This is where three buffers can
come in handy, allowing the game to continue working and render ahead.
Double buffering
The swap chain is also directly tied to the resolution, and if the display area is res-
ized, the swap chain needs to be recreated. You may think that all the games are full
screen now and should not need to be resized! Remember that the snap functionality
in Windows 8 resizes the screen, requiring your game to match the available space.
Alongside the creation code, we need a way to respond to the window resize events
so that we can resize the swap chain and elegantly handle the changes.
All of this happens inside Direc-
t3DBase::CreateWindowSizeDependentResources . Here we will check to
see if there is a resize, as well as some orientation-handling checks so that the game
can handle rotation if enabled. We want to avoid the work that we don't need to do,
Search WWH ::




Custom Search