D3DPRESENT_PARAMETERS
Describes the presentation parameters.
Type D3DPRESENT_PARAMETERS
AutoDepthStencilFormat As CONST_D3DFORMAT
BackBufferCount As Long
BackBufferFormat As CONST_D3DFORMAT
BackBufferHeight As Long
BackBufferWidth As Long
EnableAutoDepthStencil As Long
Flags As Long
FullScreen_PresentationInterval As Long
FullScreen_RefreshRateInHz As Long
hDeviceWindow As Long
MultiSampleType As CONST_D3DMULTISAMPLE_TYPE
SwapEffect As CONST_D3DSWAPEFFECT
Windowed As Long
End Type
Members
- AutoDepthStencilFormat
- A member of the CONST_D3DFORMAT enumeration. The format of the automatic depth-stencil surface that the device will create. This member is ignored unless EnableAutoDepthStencil is a nonzero value (True).
- BackBufferCount
- This value can be 0, 1, 2 or 3. Note that 0 is treated as 1. If the number of back buffers cannot be created, Microsoft® Direct3D will fail the method call and fill this value with the number of back buffers that could be created. As a result, an application can call the method twice with the same D3DPRESENT_PARAMETERS type and expect it to work the second time.
One back buffer is considered the minimum number of back buffers. The method call fails if 1 back buffer cannot be created. The value of BackBufferCount influences what set of swap effects are allowed. Specifically, any D3DSWAPEFFECT_COPY swap effect requires that there be exactly one back buffer.
- BackBufferFormat
- A member of the CONST_D3DFORMAT enumeration. This value must be one of the render target formats as validated by Direct3D8.CheckDeviceType.
If Windowed is set to 1, then BackBufferFormat must be set to match the format of the current display mode. Use Direct3DDevice8.GetDisplayMode to obtain the current format.
- BackBufferHeight and BackBufferWidth
- The height and width of the new swap chain's back buffers, in pixels. If Windowed is zero (False) the presentation is full-screen, and these values must equal the height and width of one of the enumerated display modes found through Direct3D8.EnumAdapterModes. If Windowed is 1 and either of these values is zero, then the corresponding dimension of the client area of the hDeviceWindow (or the focus window, if hDeviceWindow is Nothing) is taken.
- EnableAutoDepthStencil
- If this value is 1, Direct3D® will manage depth buffers for the application. The device will create a depth-stencil buffer when it is created. The depth-stencil buffer will be automatically set as the render target of the device. When the device is reset, the depth-stencil buffer will be automatically destroyed and recreated in the new size.
If EnableAutoDepthStencil is 1, then AutoDepthStencilFormat must be a valid depth-stencil format.
- Flags
- Currently this value is not used, it must be set to 0.
- FullScreen_PresentationInterval
- A bit mask of values representing what presentation swap intervals are available. For windowed mode, this value must be 0; otherwise, this value must be one of the values enumerated in the PresentationIntervals member of D3DCAPS8. Possible values are defined by the CONST_D3DPRESENT_INTERVAL_FLAGS enumeration.
- FullScreen_RefreshRateInHz
- The rate at which the display adapter refreshes the screen. For windowed mode, this value must be 0; otherwise, this value must be one of the refresh rates returned by Direct3D8.EnumAdapterModes, or one of the refresh rates defined by the CONST_D3DPRESENT_RATE_FLAGS enumeration.
- hDeviceWindow
- If full-screen, this is the cover window. If windowed, this will be the default target window for Direct3DDevice8.Present. If this value is Nothing, the focus window will be taken. For applications that use multiple full-screen devices, such as a multi-monitor system, exactly one device should use the focus window as the device window. All other devices should have unique device windows. Otherwise, behavior is undefined and applications will not work as expected.
Note that no attempt is made by Direct3D to reflect user changes in window size. The back buffer is not implicitly reset when this window is reset. However, the Present method does automatically track window position changes.
- MultiSampleType
- A member of the CONST_D3DMULTISAMPLE_TYPE enumeration. The value must be D3DMULTISAMPLE_NONE unless SwapEffect has been set to D3DSWAPEFFECT_DISCARD. Multisampling is supported only if the swap effect is D3DSWAPEFFECT_DISCARD.
- SwapEffect
- A member of the CONST_D3DSWAPEFFECT enumeration. Direct3D will guarantee the implied semantics concerning buffer swap behavior. So if Windowed is 1 and D3DSWAPEFFECT_FLIP, then Direct3D will create one extra back buffer, and copy whichever becomes the front buffer at presentation time.
D3DSWAPEFFECT_COPY and D3DSWAPEFFECT_COPY_VSYNC require that BackBufferCount be set to 1.
D3DSWAPEFFECT_DISCARD will be enforced in the debug run time by filling any buffer with noise after it is presented.
- Windowed
- 1 if the application runs windowed, 0 if the application runs full-screen.
See Also
Direct3D8.CreateDevice, Direct3DDevice8.CreateAdditionalSwapChain, Direct3DDevice8.Present, Direct3DDevice8.Reset