Skip to content
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

add headless graphics api #167

Merged
merged 1 commit into from
Aug 11, 2024
Merged

add headless graphics api #167

merged 1 commit into from
Aug 11, 2024

Conversation

galister
Copy link
Contributor

@galister galister commented Aug 2, 2024

Currently, creating a headless session is needlessly complicated, and developers effectively need to lie that they use a graphics API that they are not actually intending to use.

Since no graphics API is a valid choice of graphics API, I made a implementation that simplifies creating such sessions.

The inner create_session will fail with the correct XrResult if headless session is attempted without first enabling XR_MND_headless.

Usage example:

let (session, _, _) = unsafe {
     instance.create_session(system, &xr::headless::SessionCreateInfo {})?
};

@galister galister force-pushed the master branch 2 times, most recently from 9f5bbef to 91e62cf Compare August 2, 2024 10:40
Copy link
Owner

@Ralith Ralith left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, this seems reasonable.

openxr/src/graphics/headless.rs Outdated Show resolved Hide resolved
openxr/src/graphics/headless.rs Outdated Show resolved Hide resolved
@galister galister force-pushed the master branch 5 times, most recently from 41e1171 to fcae09d Compare August 10, 2024 09:36
openxr/src/graphics/headless.rs Outdated Show resolved Hide resolved
openxr/src/graphics/headless.rs Show resolved Hide resolved
@Ralith Ralith merged commit 6c7747a into Ralith:master Aug 11, 2024
6 checks passed
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