Any third party app might change the current screen resolution.
Poll for resolution mismatch to force a device reset.
Required for non ex devices only.
Signed-off-by: Patrick Rudolph <siro@das-labor.org>
Reviewed-by: Axel Davy <axel.davy@ens.fr>
if (NineSwapChain9_GetOccluded(This->swapchains[0])) {
This->device_needs_reset = TRUE;
return D3DERR_DEVICELOST;
+ } else if (NineSwapChain9_ResolutionMismatch(This->swapchains[0])) {
+ This->device_needs_reset = TRUE;
+ return D3DERR_DEVICENOTRESET;
} else if (This->device_needs_reset) {
return D3DERR_DEVICENOTRESET;
}
return S_PRESENT_OCCLUDED;
}
} else {
- if (NineSwapChain9_GetOccluded(This)) {
+ if (NineSwapChain9_GetOccluded(This) ||
+ NineSwapChain9_ResolutionMismatch(This)) {
This->base.device->device_needs_reset = TRUE;
}
if (This->base.device->device_needs_reset) {
return FALSE;
}
+
+BOOL
+NineSwapChain9_ResolutionMismatch( struct NineSwapChain9 *This )
+{
+ if (This->base.device->minor_version_num > 1) {
+ return ID3DPresent_ResolutionMismatch(This->present);
+ }
+
+ return FALSE;
+}
BOOL
NineSwapChain9_GetOccluded( struct NineSwapChain9 *This );
+BOOL
+NineSwapChain9_ResolutionMismatch( struct NineSwapChain9 *This );
+
#endif /* _NINE_SWAPCHAIN9_H_ */