Support VR mode disable on Oculus device
This commit is contained in:
parent
31b64d4689
commit
9d6d68f00a
1 changed files with 13 additions and 3 deletions
12
src/rlgl.c
12
src/rlgl.c
|
@ -2671,7 +2671,17 @@ bool IsVrDeviceReady(void)
|
|||
// Enable/Disable VR experience (device or simulator)
|
||||
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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue