FNA-XNA / FNA

FNA - Accuracy-focused XNA4 reimplementation for open platforms
https://fna-xna.github.io/
2.65k stars 272 forks source link

Removed graphics device reset when display event enum is not orientation. #501

Closed DoubleBullet closed 1 week ago

DoubleBullet commented 1 week ago

This change no longer resets the viewport to 8x8 when the display is connected or disconnected for a full screen window.

The reason why the viewport is specifically reset to 8x8 is because the FNA3D.FNA3D_GetMaxMultiSampleCount returns 8.

Resetting might make sense if the monitor was swapped entirely with another one. I'm not sure how I can track for when that happens.

This has been tested on Windows, but not linux and mac.

Fixes #500

flibitijibibo commented 1 week ago

Looking at the git history this was added because the GraphicsDevice.Adapter property becomes out-of-date when this happens. After this event happens, are you able to find the GraphicsDevice.Adapter instance in GraphicsAdapter.Adapters?

Either way we could probably just manually reassign the adapter without doing a whole reset... and for all I know the instance is outdated on XNA too, I'd have to add a second monitor to my VM somehow.

flibitijibibo commented 1 week ago

Dug around a bit and I think this was for Axiom Verge 1/2 and it might have been for something unrelated, so yeah let's just update the Adapter manually - if doing that still fixes the issue we can get this in!