diff --git a/basegraph.cpp b/basegraph.cpp index f44711a6..8b0d117f 100644 --- a/basegraph.cpp +++ b/basegraph.cpp @@ -245,8 +245,15 @@ EX void start_projection(int ed, bool perspective) { glhr::projection_multiply(glhr::translate(tx, -ty, 0)); } +#if CAP_VR +EX hookset *hooks_vr_eye_view, *hooks_vr_eye_projection; +#endif + EX void eyewidth_translate(int ed) { glhr::using_eyeshift = false; +#if CAP_VR + if(callhandlers(false, hooks_vr_eye_view)) ; else +#endif if(ed) glhr::projection_multiply(glhr::translate(-ed * current_display->eyewidth(), 0, 0)); } @@ -414,6 +421,9 @@ void display_data::set_projection(int ed) { eyewidth_translate(ed); + #if CAP_VR + if(callhandlers(false, hooks_vr_eye_projection)) ; else + #endif if(pers3) { glhr::projection_multiply(glhr::frustum(current_display->tanfov, current_display->tanfov * cd->ysize / cd->xsize)); glhr::projection_multiply(glhr::scale(1, -1, -1)); diff --git a/drawing.cpp b/drawing.cpp index 85ee02db..34e2aff0 100644 --- a/drawing.cpp +++ b/drawing.cpp @@ -1852,6 +1852,9 @@ EX void draw_main() { } } +#if CAP_VR +EX hookset *hooks_vr_draw_all; +#endif EX void drawqueue() { callhooks(hook_drawqueue); @@ -1906,6 +1909,9 @@ EX void drawqueue() { spherephase = 0; reset_projection(); + #if CAP_VR + if(callhandlers(false, hooks_vr)) {} else + #endif if(model_needs_depth() && current_display->stereo_active()) { global_projection = -1; draw_main();