GodotVR / TiltFiveGodot4

A Godot GDExtension for the Tilt Five glasses
MIT License
36 stars 7 forks source link

Fixes for initialization and glasses state management #65

Closed patrickdown closed 11 months ago

patrickdown commented 11 months ago

In the process of working on a Linux version some problems were found in initialization and glasses state management. Since they are relevant to other platforms I've pulled these fixes together here. I have excluded changes to build-on-push.yml because the Linux version of the plugin still has some issues to work out.

Problems and fixes: 1) A race condition was found in initialization that would cause rendering to start before frame textures had been created. This was caused when the READY state flipped between the update_connection() call and the get_events() call. The solution implemented was to move the graphics initialization into the start_display() function call chain. Since this is the function that starts rendering it can ensure that textures are setup first.

  1. Although it has never seemed to come up, there are situations where previous state variable might be reset before changes could be detected. The fix for this was stop using a single var for this and track separate vars in each place changes needed to be detected.

  2. There are a few minor changes to account for differences in C++ library functions between Windows and Linux.

  3. Update SConstruct for Linux build