Skip to content

Conversation

@Frozenreflex
Copy link
Collaborator

No description provided.

vilhalmer and others added 4 commits April 30, 2025 12:56
This uses a macro to ADD_SIGNAL and track the data types associated with
each EVREventType in a single action, preventing any risk of signals
getting out of sync with handled events as more are added by Valve.

The OpenVREventHandler is only ever intended to be used as the parent
class of the autoload singleton. This allows the macro magic to be used
for generating signal names instead of having to manually define them in
GDScript. There should also only ever be one handler, and the interface
for hooking it to openvr_data reflects this.

Each macro call includes an extra parameter that is only intended to be
used as developer reference for the source of documentation about which
data type a signal uses. This is generally not documented within the
openvr headers, and often comes from replies to issues on github or
similar. Some of them are educated guesses, and patches with more
definitive information are very welcome.

Signals for events that will never be sent to a client app are not
registered.

Since Valve may release new versions of openvr at any time and we may
not immediately be ready to cut a new godot_openvr release, the method
`register_event_signal` is provided. When new events appear in later
releases of OpenVR, they tend to have an existing data type. This allows
users of the extension to register signals for these new events instead
of having to wait for a new release of godot_openvr to take advantage of
them. For example:

		OpenVRInterface.register_event_signal(
				539, OpenVREventHandler.Overlay, "OverlayCreated")
		OpenVRInterface.connect("OverlayCreated", print)

This could also be used to add signals for events in the vendor-specific
space starting at ID 10000.

Overlay-specific events are received on the appropriate
OpenVROverlayContainer automatically. Overlays do not receive global
events even though this is how it works on the OpenVR level, as this
would lead to events being received multiple times.

Finally, OpenVR is updated to 2.5.1 to pick up several new events. The
demo also now has a HUD which displays a few vrevents to serve as a
basic test.
Expose VREvents as Godot signals
Update library feature tag to x86_64 to match Godot defaults
@Frozenreflex Frozenreflex merged commit 15bb5c4 into Project-Babble:master Oct 10, 2025
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