Open safoster88 opened 9 months ago
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.
Is this resolved? I'd like to take a shot at my first PR if it's not!
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.