-
Notifications
You must be signed in to change notification settings - Fork 43
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
Improved extension checking logic #87
Improved extension checking logic #87
Conversation
7966364
to
24ba595
Compare
I also snuck in setting the view configuration type... |
24ba595
to
ab79a58
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The overall structure looks good! I've added some feedback on some implementation details.
ab79a58
to
3795281
Compare
}; break; | ||
} | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't we just return the XR view configuration types values as is? What's the advantage for defining another set of values that map to them especially since the plan is to include as much of OpenXR as possible in Godot 4.x?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I missed this comment which seems to make the case for it: so our dropdown in the UI works properly
.
Seems fine by me if that's the only available option.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah it's just that for a enum dropdown in the UI you define the property like so:
register_property<OpenXRConfig, int>("view_configuration", ... , GODOT_PROPERTY_HINT_ENUM, "Mono,Stereo");
So 0 = Mono, 1 = Stereo, etc.
Also at some point we will have to think of how we'll unify some of this in Godot 4. We'll likely end up with our own enumerations in the core of Godot for this that map to whatever systems and capabilities that are in place in the runtime. While I'd like to think everyone will switch to OpenXR and we don't have to worry about any other runtimes, I think that is wishful thinking.
This changes the logic that checks and enabled extensions in our plugin.
It works with a
map
to which we add the extensions we want.The entry then points to a boolean that the logic either sets or clears depending on whether the extension is available.
If this pointer is a
nullptr
we deem the extension as a requirement and it not being available will fail initialization of the plugin.Finally we enabled all extensions that were requested and found.
The boolean flags allow further logic to actually implement the usage of the extension.
I've also moved most of the FB extensions out of the Android only sphere, I suspect a number of these will become extensions also implemented by other vendors as has happened with a number of Microsoft and Valve extensions that still bear their names (especially around refresh rates and such, really weird those aren't part of the core spec already).