-
Notifications
You must be signed in to change notification settings - Fork 1.1k
OpenXR only visuals headset #2620
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
base: main
Are you sure you want to change the base?
Conversation
pulling comments about mac
# Conflicts: # simulate/simulate.h
# Conflicts: # simulate/simulate.cc
simulate/simulate_xr/simulate_xr.cc
Outdated
void SimulateXr::init() { | ||
// Needed for textures | ||
if (!gladLoadGLLoader((GLADloadproc)glfwGetProcAddress)) { | ||
mju_warning("Failed to initialize OpenGL context for OpenXR."); |
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.
If we can't init we should probably error?
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, changed this. Many of the other warnings can be useful because the whole system will still launch, just without the XR
if (strcmp(requestLayer.c_str(), layerProperty.layerName) != 0) { | ||
continue; | ||
} else { | ||
m_activeAPILayers.push_back(requestLayer.c_str()); |
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.
It looks like we add if requestLayer equals layerProperty, which is different to the comment on the requestLayer for loop?
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.
Hmm, it is a bit confusing, also due to the fact that m_apiLayers stays empty. I took most of this chunk from the openxr example, where it is not used, too. I think it can be used when integrating with more modern OpenGL versions or for some other functionality if there is desire.
if (xrEnumerateApiLayerProperties(apiLayerCount, &apiLayerCount, | ||
apiLayerProperties.data()) < 0) { | ||
mju_warning("Failed to enumerate ApiLayerProperties."); | ||
return -1; |
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.
Enums for these returns would improve readability
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, we can introduce an error enum or class here, never got my hands on reading up what is the google styleguide for those.
std::end(supportSwapchainFormats)); | ||
if (swapchainFormatIt == formats.end()) { | ||
mju_warning("ERROR: Unable to find supported Color Swapchain Format"); | ||
return 0; |
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.
is this returning success when failure is intended?
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.
It is never really checked directly if it is successful, but the next xrCreateSwapchain with format set to 0 fails, which will highlight the previous failure at finding the format. I guess it could throw an error earlier, too.
Disabled by default. For description, see README. RFC