mirror of
https://github.com/zenorogue/hyperrogue.git
synced 2025-06-03 06:54:08 +00:00
added CAP_VR
This commit is contained in:
parent
a59dc8be58
commit
5c1568d288
@ -245,8 +245,15 @@ EX void start_projection(int ed, bool perspective) {
|
|||||||
glhr::projection_multiply(glhr::translate(tx, -ty, 0));
|
glhr::projection_multiply(glhr::translate(tx, -ty, 0));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if CAP_VR
|
||||||
|
EX hookset<bool()> *hooks_vr_eye_view, *hooks_vr_eye_projection;
|
||||||
|
#endif
|
||||||
|
|
||||||
EX void eyewidth_translate(int ed) {
|
EX void eyewidth_translate(int ed) {
|
||||||
glhr::using_eyeshift = false;
|
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));
|
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);
|
eyewidth_translate(ed);
|
||||||
|
|
||||||
|
#if CAP_VR
|
||||||
|
if(callhandlers(false, hooks_vr_eye_projection)) ; else
|
||||||
|
#endif
|
||||||
if(pers3) {
|
if(pers3) {
|
||||||
glhr::projection_multiply(glhr::frustum(current_display->tanfov, current_display->tanfov * cd->ysize / cd->xsize));
|
glhr::projection_multiply(glhr::frustum(current_display->tanfov, current_display->tanfov * cd->ysize / cd->xsize));
|
||||||
glhr::projection_multiply(glhr::scale(1, -1, -1));
|
glhr::projection_multiply(glhr::scale(1, -1, -1));
|
||||||
|
@ -1852,6 +1852,9 @@ EX void draw_main() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if CAP_VR
|
||||||
|
EX hookset<bool()> *hooks_vr_draw_all;
|
||||||
|
#endif
|
||||||
|
|
||||||
EX void drawqueue() {
|
EX void drawqueue() {
|
||||||
callhooks(hook_drawqueue);
|
callhooks(hook_drawqueue);
|
||||||
@ -1906,6 +1909,9 @@ EX void drawqueue() {
|
|||||||
spherephase = 0;
|
spherephase = 0;
|
||||||
reset_projection();
|
reset_projection();
|
||||||
|
|
||||||
|
#if CAP_VR
|
||||||
|
if(callhandlers(false, hooks_vr)) {} else
|
||||||
|
#endif
|
||||||
if(model_needs_depth() && current_display->stereo_active()) {
|
if(model_needs_depth() && current_display->stereo_active()) {
|
||||||
global_projection = -1;
|
global_projection = -1;
|
||||||
draw_main();
|
draw_main();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user