Skip to content

Commit

Permalink
workaround for SteamVR 1.16.4/5
Browse files Browse the repository at this point in the history
  • Loading branch information
ChristophHaag committed Feb 1, 2021
1 parent f27180f commit 623d8d5
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions main.c
Original file line number Diff line number Diff line change
Expand Up @@ -1539,6 +1539,10 @@ main(int argc, char** argv)
return 1;
}

// TODO: should not be necessary, but is for SteamVR 1.16.4 (but not 1.15.x)
glXMakeCurrent(graphics_binding_gl.xDisplay, graphics_binding_gl.glxDrawable,
graphics_binding_gl.glxContext);

// Set up rendering (compile shaders, ...) before starting the session
if (init_gl(view_count, vr_swapchains[SWAPCHAIN_PROJECTION].swapchain_lengths, &gl_rendering) !=
0) {
Expand Down Expand Up @@ -1811,6 +1815,11 @@ main(int argc, char** argv)

int w = viewconfig_views[i].recommendedImageRectWidth;
int h = viewconfig_views[i].recommendedImageRectHeight;

// TODO: should not be necessary, but is for SteamVR 1.16.4 (but not 1.15.x)
glXMakeCurrent(graphics_binding_gl.xDisplay, graphics_binding_gl.glxDrawable,
graphics_binding_gl.glxContext);

render_frame(w, h, &gl_rendering, projection_index, frameState.predictedDisplayTime, i,
hand_pose_action.pose_locations, &hand_tracking, projection_matrix, view_matrix,
projection_image, depth.supported, depth_image);
Expand Down

0 comments on commit 623d8d5

Please sign in to comment.