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

fix: Handle webgl context lost + Recover from hidpi scale too large #2958

Merged
merged 4 commits into from Mar 8, 2024

Conversation

eonarheim
Copy link
Member

@eonarheim eonarheim commented Mar 6, 2024

===:clipboard: PR Checklist :clipboard:===

  • 📌 issue exists in github for these changes
  • 🔬 existing tests still pass
  • 🙈 code conforms to the style guide
  • 📐 new tests written and passing / old tests updated with new scenario(s)
  • 📄 changelog entry added (or not needed)

==================

This PR addresses some issues with webgl contexts

  • Fixed issue when WebGL context lost occurs where there was no friendly output to the user
  • Fixed issue where HiDPI scaling could accidentally scale past the 4k mobile limit, if the context would scale too large it will now attempt to recover by backing off.
  • Added way to add custom WebGL context lost/recovered handlers for your game
    const game = new ex.Engine({
      handleContextLost: (e) => {...},
      handleContextRestored: (e) => {...}
    })

Default context lost screen

image

@github-actions github-actions bot added the bug This issue describes undesirable, incorrect, or unexpected behavior label Mar 6, 2024
Copy link

cloudflare-pages bot commented Mar 6, 2024

Deploying with  Cloudflare Pages  Cloudflare Pages

Latest commit: 2939c57
Status: ✅  Deploy successful!
Preview URL: https://fb7e9b8d.excaliburjs.pages.dev
Branch Preview URL: https://fix-webgl-context-lost-and-h.excaliburjs.pages.dev

View logs

@eonarheim eonarheim merged commit 31548c9 into main Mar 8, 2024
4 of 5 checks passed
@eonarheim eonarheim deleted the fix/webgl-context-lost-and-hidpi branch March 8, 2024 15:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This issue describes undesirable, incorrect, or unexpected behavior
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant