bevy-steamworks
bevy-steamworks copied to clipboard
Steam overlay is flickering
When I press shift tab to open the stim overlay, it opens but starts flickering very quickly.
Steps to reproduce:
use bevy::prelude::*;
use bevy_steamworks::SteamworksPlugin;
fn main() {
App::new()
.add_plugins(DefaultPlugins)
.add_plugins(SteamworksPlugin::new(480))
.run();
}
This code works and does not cause the overlay to flicker on Bevy 0.11 (and thus bevy_steamworks 0.8).
I've verified that if you only update bevy and don't change the internals of bevy_steamworks, the flickering persists. The problem is apparently not here, but I don't know how to find where bevy is broken
I found out that if I call Client::init_app
before adding DefaultPlugins
, everything works.
To fix bevy_steamworks
, we need to move Client::init_app
to SteamworksPlugin::new
, then it will be possible to initialize stim before RenderPlugin::build
, which is the cause of the error. This solution works for me if I add SteamworksPlugin
before or together with DefaultPlugins
, adding it after does not fix the error.
Or we need to wait for a solution in Bevy, because earlier RenderPlugin::build
called delayed initialization and initialization of the Stim client was guaranteed to be called before that.
Going to leave this open until the ordering issue is resolved. See https://github.com/bevyengine/bevy/issues/1255.