The open source OpenXR runtime

d/wmr: use u_extents_2d_split_side_by_side instead of u_device_setup_split_side_by_side

+8 -18
+8 -18
src/xrt/drivers/wmr/wmr_hmd.c
··· 1016 1016 math_pose_invert(&wh->config.sensors.mag.pose, &wh->mag_to_centerline); 1017 1017 math_pose_transform(&wh->centerline, &wh->mag_to_centerline, &wh->mag_to_centerline); 1018 1018 1019 - struct u_device_simple_info info; 1020 - info.display.w_pixels = (uint32_t)wh->config.eye_params[0].display_size.x; 1021 - info.display.h_pixels = (uint32_t)wh->config.eye_params[0].display_size.y; 1019 + struct u_extents_2d exts; 1022 1020 1023 - info.lens_horizontal_separation_meters = 1024 - fabs(wh->display_to_centerline[1].position.x - wh->display_to_centerline[0].position.x); 1021 + exts.w_pixels = (uint32_t)wh->config.eye_params[0].display_size.x; 1022 + exts.h_pixels = (uint32_t)wh->config.eye_params[0].display_size.y; 1025 1023 1026 - /* We set up a dummy side-by-side config, then adjust the actual FoV bounds 1027 - * in compute_distortion_bounds() below */ 1028 - info.display.w_meters = 0.13f; 1029 - info.display.h_meters = 0.07f; 1030 - info.lens_vertical_position_meters = 0.07f / 2.0f; 1031 - info.views[0].fov = 85.0f * ((float)M_PI / 180.0f); 1032 - info.views[1].fov = 85.0f * ((float)M_PI / 180.0f); 1024 + u_extents_2d_split_side_by_side(&wh->base, &exts); 1033 1025 1034 - if (!u_device_setup_split_side_by_side(&wh->base, &info)) { 1035 - WMR_ERROR(wh, "Failed to setup basic HMD device info"); 1036 - wmr_hmd_destroy(&wh->base); 1037 - wh = NULL; 1038 - return NULL; 1039 - } 1026 + // Fill in blend mode - just opqaue, unless we get Hololens support one day. 1027 + size_t idx = 0; 1028 + wh->base.hmd->blend_modes[idx++] = XRT_BLEND_MODE_OPAQUE; 1029 + wh->base.hmd->blend_mode_count = idx; 1040 1030 1041 1031 // Distortion information, fills in xdev->compute_distortion(). 1042 1032 for (eye = 0; eye < 2; eye++) {