Add Cardboard VR
Based on hrydgard/ppsspp/pull/12449
This commit is contained in:
parent
da3a9bfc96
commit
60235827c5
5 changed files with 174 additions and 6 deletions
|
@ -1016,6 +1016,16 @@ void RendererOpenGL::DrawScreens(const Layout::FramebufferLayout& layout, bool f
|
|||
((float)top_screen.left / 2) + ((float)layout.width / 2),
|
||||
(float)top_screen.top, (float)top_screen.GetWidth() / 2,
|
||||
(float)top_screen.GetHeight());
|
||||
} else if (Settings::values.render_3d == Settings::StereoRenderOption::CardboardVR) {
|
||||
DrawSingleScreenRotated(screen_infos[0], layout.top_screen.left,
|
||||
layout.top_screen.top, layout.top_screen.GetWidth(),
|
||||
layout.top_screen.GetHeight());
|
||||
glUniform1i(uniform_layer, 1);
|
||||
DrawSingleScreenRotated(screen_infos[1],
|
||||
layout.cardboard.top_screen_right_eye +
|
||||
((float)layout.width / 2),
|
||||
layout.top_screen.top, layout.top_screen.GetWidth(),
|
||||
layout.top_screen.GetHeight());
|
||||
} else if (stereo_single_screen) {
|
||||
DrawSingleScreenStereoRotated(
|
||||
screen_infos[0], screen_infos[1], (float)top_screen.left, (float)top_screen.top,
|
||||
|
@ -1033,6 +1043,14 @@ void RendererOpenGL::DrawScreens(const Layout::FramebufferLayout& layout, bool f
|
|||
((float)top_screen.left / 2) + ((float)layout.width / 2),
|
||||
(float)top_screen.top, (float)top_screen.GetWidth() / 2,
|
||||
(float)top_screen.GetHeight());
|
||||
} else if (Settings::values.render_3d == Settings::StereoRenderOption::CardboardVR) {
|
||||
DrawSingleScreen(screen_infos[0], layout.top_screen.left, layout.top_screen.top,
|
||||
layout.top_screen.GetWidth(), layout.top_screen.GetHeight());
|
||||
glUniform1i(uniform_layer, 1);
|
||||
DrawSingleScreen(screen_infos[1],
|
||||
layout.cardboard.top_screen_right_eye + ((float)layout.width / 2),
|
||||
layout.top_screen.top, layout.top_screen.GetWidth(),
|
||||
layout.top_screen.GetHeight());
|
||||
} else if (stereo_single_screen) {
|
||||
DrawSingleScreenStereo(screen_infos[0], screen_infos[1], (float)top_screen.left,
|
||||
(float)top_screen.top, (float)top_screen.GetWidth(),
|
||||
|
@ -1056,6 +1074,16 @@ void RendererOpenGL::DrawScreens(const Layout::FramebufferLayout& layout, bool f
|
|||
screen_infos[2], ((float)bottom_screen.left / 2) + ((float)layout.width / 2),
|
||||
(float)bottom_screen.top, (float)bottom_screen.GetWidth() / 2,
|
||||
(float)bottom_screen.GetHeight());
|
||||
} else if (Settings::values.render_3d == Settings::StereoRenderOption::CardboardVR) {
|
||||
DrawSingleScreenRotated(screen_infos[2], layout.bottom_screen.left,
|
||||
layout.bottom_screen.top, layout.bottom_screen.GetWidth(),
|
||||
layout.bottom_screen.GetHeight());
|
||||
glUniform1i(uniform_layer, 1);
|
||||
DrawSingleScreenRotated(screen_infos[2],
|
||||
layout.cardboard.bottom_screen_right_eye +
|
||||
((float)layout.width / 2),
|
||||
layout.bottom_screen.top, layout.bottom_screen.GetWidth(),
|
||||
layout.bottom_screen.GetHeight());
|
||||
} else if (stereo_single_screen) {
|
||||
DrawSingleScreenStereoRotated(screen_infos[2], screen_infos[2],
|
||||
(float)bottom_screen.left, (float)bottom_screen.top,
|
||||
|
@ -1076,6 +1104,16 @@ void RendererOpenGL::DrawScreens(const Layout::FramebufferLayout& layout, bool f
|
|||
((float)bottom_screen.left / 2) + ((float)layout.width / 2),
|
||||
(float)bottom_screen.top, (float)bottom_screen.GetWidth() / 2,
|
||||
(float)bottom_screen.GetHeight());
|
||||
} else if (Settings::values.render_3d == Settings::StereoRenderOption::CardboardVR) {
|
||||
DrawSingleScreen(screen_infos[2], layout.bottom_screen.left,
|
||||
layout.bottom_screen.top, layout.bottom_screen.GetWidth(),
|
||||
layout.bottom_screen.GetHeight());
|
||||
glUniform1i(uniform_layer, 1);
|
||||
DrawSingleScreen(screen_infos[2],
|
||||
layout.cardboard.bottom_screen_right_eye +
|
||||
((float)layout.width / 2),
|
||||
layout.bottom_screen.top, layout.bottom_screen.GetWidth(),
|
||||
layout.bottom_screen.GetHeight());
|
||||
} else if (stereo_single_screen) {
|
||||
DrawSingleScreenStereo(screen_infos[2], screen_infos[2], (float)bottom_screen.left,
|
||||
(float)bottom_screen.top, (float)bottom_screen.GetWidth(),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue