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 texture recreation when GL context is lost #1763

Merged
merged 2 commits into from
Mar 23, 2024

Conversation

smilediver
Copy link
Contributor

@smilediver smilediver commented Mar 22, 2024

Describe your changes

This PR contains 3 changes:

  • When GL context is lost on Android all textures in the context are destroyed implicitly. But TextureInfoGL::onRendererRecreated() calls glDeleteTextures() on old texture IDs and if other new textures have already allocated these IDs, then it ends up deleting those new textures corrupting their state. and the OpenGLState was reset before event EVENT_RENDERER_RECREATED fired in core/platform/android/javaactivity-android.cpp

  • TextureCubeGL seems to listen to EVENT_COME_TO_FOREGROUND when it should listen to EVENT_RENDERER_RECREATED, so fixed that.

  • Did some renaming to reflect that things are being used for renderer recreated event.

Issue ticket number and link

Checklist before requesting a review

For each PR

  • Add Copyright if it missed:
    - "Copyright (c) 2019-present Axmol Engine contributors (see AUTHORS.md)."

  • I have performed a self-review of my code.

    Optional:

    • I have checked readme and add important infos to this PR.
    • I have added/adapted some tests too.

For core/new feature PR

  • I have checked readme and add important infos to this PR.
  • I have added thorough tests.

@halx99 halx99 merged commit db05744 into axmolengine:dev Mar 23, 2024
0 of 2 checks passed
@smilediver smilediver deleted the fix_texture_recreation branch March 23, 2024 13:09
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.

2 participants