Microsoft DirectX 8.1 (Visual Basic) |
Defines driver-specific capabilities.
Enum CONST_D3DCAPS2FLAGS D3DCAPS2_NO2DDURING3DSCENE = 2 D3DCAPS2_FULLSCREENGAMMA = 131072 (&H20000) D3DCAPS2_CANRENDERWINDOWED = 524288 (&H80000) D3DCAPS2_CANCALIBRATEGAMMA = 1048576 (&H100000) D3DCAPS2_RESERVED = 33554432 (&H2000000) End Enum
Typically, this capability is set by hardware that partitions the scene and then renders each partition in sequence. The partitioning is performed in the driver, and the hardware will contain a small color and depth buffer that corresponds to the size of the image partition. On this type of rendering hardware, it is typical that once each part of the image is rendered, the data in the color buffers are written to video memory and the contents of the depth-buffer are discarded. Also, note that 3-D rendering does not start until EndScene is encountered. Then, the scene is processed in regions. As such, the processing order cannot be guaranteed. For example, the first region, typically the upper left corner of the window, that is processed may include the last triangle in the frame. To contrast this with more traditional graphics systems, in the typical system each command is processed sequentially in the order that it was sent. The 2-D operations are implied to occur at some fixed point in the processing. In the systems that set D3DCAPS2_NO2DDURING3DSCENE the processing order is not guaranteed, so 2-D operations that are encountered during 3-D rendering may be discarded by the display adapter.
In general, it is recommended that 2-D operations be performed outside of a BeginScene and EndScene pair. If 2-D operations are to be performed between a BeginScene and EndScene pair, then it is necessary to check the D3DCAPS2_NO2DDURING3DSCENE capability. If it is set, the application must expect that any 2-D operation that occurs between BeginScene and EndScene will be discarded. For more information on writing applications for systems that set D3DCAPS2_NO2DDURING3DSCENE, see Remarks.
These flags may be combined and present in the Caps2 member of D3DCAPS8.
For systems that set the D3DCAPS2_NO2DDURING3DSCENE capability flag, performance problems may occur if you use a texture and then modify it during a scene. This is true on all hardware, but it is more severe on hardware that exposes the D3DCAPS2_NO2DDURING3DSCENE capability. If D3DCAPS2_NO2DDURING3DSCENE is present on the hardware, application-based texture management should ensure that no texture used in the current BeginScene and EndScene block is evicted unless absolutely necessary.
In the case of extremely high texture usage within a scene (that is, where you modify a texture that you have used in the scene and there is no spare texture memory available), the results are undefined. For such systems, the contents of the z buffer become invalid at EndScene. Applications should not call Direct3DDevice8.CopyRects to or from the back buffer on this type of hardware inside a BeginScene and EndScene pair. In addition, applications should not try to access the z-buffer if the D3DPRASTERCAPS_ZBUFFERLESSHSR capability flag is set. Finally, applications should not lock the back buffer or the z buffer inside a BeginScene and EndScene pair.