Skip to content

BGFX shutdown does not reset properly #3516

Description

@PowerOfNames

(Have read and confirm :) )

Describe the bug
A clear and concise description of what the bug is.

When calling bgfx::shutdown() but keeping the application alive, it currently seesm to not be possible to create a fresh bgfx context via bgfx::Init again from another thread. (Have an application where a dedicatd thread manages bgfx, and I want to be able to completely close the thread -> shutting bgfx down, and later to create a new thread with a fresh bgfx instance)

The first thing that creates an error is the s_renderFrameCalled field. This is not being reset to false during shutdown.

To Reproduce
Steps to reproduce the behavior:

  1. Create a thread
  2. Initialize bgfx on it
  3. Shut bgfx down
  4. join the thread and delete it
  5. create a new thread
  6. initialize bgfx there -> error occurs (wrong thread context)

Expected behavior
A clear and concise description of what you expected to happen.

If bgfx has been shutted down, it should reset to its original state completely, so its possible to keep the application alive and create bgfx on another thread freshly.

Screenshots
If applicable, add screenshots to help explain your problem.

Additional context
Add any other context about the problem here. OS, drivers, etc.

Should not be necessary, but its Win11, using Vulkan backend.

The fix is simple but I'm not sure if anything else was overlocked.
Besides that: Great framework, its simple and fun to use and expand :)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions