Skip to content

New interface versions#193

Open
Mr-Zero88 wants to merge 12 commits intoSupreeeme:mainfrom
Mr-Zero88:new-interface-versions
Open

New interface versions#193
Mr-Zero88 wants to merge 12 commits intoSupreeeme:mainfrom
Mr-Zero88:new-interface-versions

Conversation

@Mr-Zero88
Copy link
Contributor

This fixes a bug that caused #177
Also needed for UEVR crash

@Mr-Zero88 Mr-Zero88 force-pushed the new-interface-versions branch from 8f9e076 to 08fdb6b Compare September 10, 2025 00:23
@Mr-Zero88 Mr-Zero88 marked this pull request as ready for review September 10, 2025 00:38
Copy link
Owner

@Supreeeme Supreeeme left a comment

Choose a reason for hiding this comment

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

  • What are these changes for? What are they fixing?
  • Quite a few of these commits can be squashed together.

#[derive(macros::InterfaceImpl)]
#[interface = "IVRExtendedDisplay"]
#[versions(001)]
pub struct ExtendedDisplay {
Copy link
Owner

Choose a reason for hiding this comment

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

Is this interface actually needed? A lot of games seem to request it but all of the ones I've looked at function fine without it.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes it was necessary for space engine. It would crash without getting proper window dimensions, as it would resize its in game overlays. See: #177 (comment)

Comment on lines +817 to +821
let mut result = self.CreateOverlay(key, name, handle);
if result == vr::EVROverlayError::None {
result = self.CreateOverlay(key, name, thumbnail_handle);
}
result
Copy link
Owner

Choose a reason for hiding this comment

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

Creating dashboard overlay handles without actually creating the dashboard overlays seems pointless and misleading.

transform: Option<(vr::ETrackingUniverseOrigin, vr::HmdMatrix34_t)>,
compositor: Option<SupportedBackend>,
rect: Option<xr::Rect2Di>,
flags: u32,
Copy link
Owner

Choose a reason for hiding this comment

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

Instead of just storing a u32, you can have bindgen generate vr::VROverlayFlags as bitflags and just use it directly.

name: *const c_char,
) -> vr::EVROverlayError {
get_overlay!(self, handle, mut overlay);
overlay.set_name(unsafe { CStr::from_ptr(name).to_owned() });
Copy link
Owner

Choose a reason for hiding this comment

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

This needs a null check.

Comment on lines +837 to +843
let key = unsafe { CStr::from_ptr(key) };

let mut concatenation = key.to_bytes().to_vec();
concatenation.extend_from_slice(b".thumbnail\0");
let thumbnail_key = CString::from_vec_with_nul(concatenation).unwrap();

result = self.CreateOverlay(thumbnail_key.as_ptr(), name, thumbnail_handle);
Copy link
Owner

Choose a reason for hiding this comment

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

What is this?

) -> Result<(), vr::EVROverlayError> {
debug!("setting overlay raw texture on {:?} with size {width}x{height} and {bytes_per_pixel} bytes per pixel", self.name);

// let backend = self
Copy link
Owner

Choose a reason for hiding this comment

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

Why is this giant chunk left commented out?

src/system.rs Outdated
Comment on lines +460 to +462
let overlay = self
.overlay
.force(|injector| OverlayMan::new(self.openxr.clone(), injector));
Copy link
Owner

Choose a reason for hiding this comment

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

Does not need to be force

src/system.rs Outdated
if overlay_handle.is_null() {
return false;
}
let overlay_handle = unsafe { *overlay_handle };
Copy link
Owner

Choose a reason for hiding this comment

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

Nooooooo

@Mr-Zero88 Mr-Zero88 force-pushed the new-interface-versions branch 4 times, most recently from 39e6e3b to 899aa76 Compare September 22, 2025 00:59
@Mr-Zero88 Mr-Zero88 force-pushed the new-interface-versions branch from 899aa76 to a276215 Compare November 10, 2025 01:19
@Mr-Zero88 Mr-Zero88 force-pushed the new-interface-versions branch from a276215 to 8c84a2a Compare November 11, 2025 14:04
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