mirror of
https://github.com/raysan5/raylib.git
synced 2025-09-27 21:48:31 +00:00
Support VR mode disable on Oculus device
This commit is contained in:
12
src/rlgl.c
12
src/rlgl.c
@@ -2671,7 +2671,17 @@ bool IsVrDeviceReady(void)
|
|||||||
// Enable/Disable VR experience (device or simulator)
|
// Enable/Disable VR experience (device or simulator)
|
||||||
void ToggleVrMode(void)
|
void ToggleVrMode(void)
|
||||||
{
|
{
|
||||||
vrEnabled = !vrEnabled;
|
if (vrDeviceReady || vrSimulator) vrEnabled = !vrEnabled;
|
||||||
|
else vrEnabled = false;
|
||||||
|
|
||||||
|
if (!vrEnabled)
|
||||||
|
{
|
||||||
|
// Reset viewport and default projection-modelview matrices
|
||||||
|
rlViewport(0, 0, GetScreenWidth(), GetScreenHeight());
|
||||||
|
projection = MatrixOrtho(0, GetScreenWidth(), GetScreenHeight(), 0, 0.0f, 1.0f);
|
||||||
|
MatrixTranspose(&projection);
|
||||||
|
modelview = MatrixIdentity();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Update VR tracking (position and orientation)
|
// Update VR tracking (position and orientation)
|
||||||
|
Reference in New Issue
Block a user