MonoGame.Extended
MonoGame.Extended copied to clipboard
Throw exception in ViewportAdapter constructor if the GraphicsDevice is null
If the viewport adapter is initialized in the constructor of game, GraphicsDevice will be null.
There is no check for this, so the null ref only occurs when trying to call GetViewMatrix().
This PR aims to improve the public API.
Firstly, thank you for attention!
It's a good idea, but why do you use the custom exception? There is ArgumentNullException.
It can be simply:
if (graphicsDevice is null) throw new ArgumentNullException(nameof(graphicsDevice));
People often use this way, so more easy to understand.