New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Issue #8084: DesktopGL GraphicsDevice.ScissorRectangle Fix #8284
base: develop
Are you sure you want to change the base?
Conversation
The fix to this problem was testing to see if the ScissorRectangle was enabled and resizing it whenever the viewport was resized. This was not done by default for DesktopGL as far as I could tell.
_game.GraphicsDevice.PresentationParameters.BackBufferWidth = width; | ||
_game.GraphicsDevice.PresentationParameters.BackBufferHeight = height; | ||
_game.GraphicsDevice.Viewport = new Viewport(0, 0, width, height); | ||
|
||
if (_game.GraphicsDevice.RasterizerState.ScissorTestEnable && prevScissorRect == prevViewport.Bounds) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A question, if the check is only on the PREVIOUS viewport bounds (and not the updated version in lines 306-308), then why is this change AFTER the viewport update?
- If the Scissor check is based on the PREVIOUS viewport bounds, then this condition should be moved to line 305.
- If the Scissor check is AFTER the update to the viewport bounds, should this not be validating against the NEW and not the previous bounds?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
After looking over it, it should have been at line 305 as you stated. Just pushed an update.
Resolving Simon's comment with regards to the placement of the conditional.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Grumble, Grumble, Brackets... But otherwise ok
Solution for issue #8084.
Updates ClientResize function in order to update the ScissorRectangle when the viewport is resized. This change mimics the behavior found on other platforms such as WindowsDX.