Skip to content
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

Open
wants to merge 3 commits into
base: develop
Choose a base branch
from

Conversation

samercer2002
Copy link

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.

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)
Copy link
Contributor

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?

  1. If the Scissor check is based on the PREVIOUS viewport bounds, then this condition should be moved to line 305.
  2. 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?

Copy link
Author

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.
Copy link
Contributor

@SimonDarksideJ SimonDarksideJ left a 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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants