diff options
| author | Ray <raysan5@gmail.com> | 2016-07-06 00:54:38 +0200 |
|---|---|---|
| committer | Ray <raysan5@gmail.com> | 2016-07-06 00:54:38 +0200 |
| commit | bc80174357392c0a16b74cd4a9e497a1de367760 (patch) | |
| tree | fdcf31178509e2e5dde7d2b8fcc8e78edba578b8 /examples | |
| parent | 2ff2096b36d80078cbda5e61ff77d7fedeeeaeb5 (diff) | |
| download | raylib-bc80174357392c0a16b74cd4a9e497a1de367760.tar.gz raylib-bc80174357392c0a16b74cd4a9e497a1de367760.zip | |
VR Functions renaming (for generic HMD device)
Stereo rendering has been moved again to Begin3dMode() and End3dMode(),
it has some limitations but makes more sense...
Diffstat (limited to 'examples')
| -rw-r--r-- | examples/core_oculus_rift.c | 19 |
1 files changed, 8 insertions, 11 deletions
diff --git a/examples/core_oculus_rift.c b/examples/core_oculus_rift.c index 734ba8fd..fa70c487 100644 --- a/examples/core_oculus_rift.c +++ b/examples/core_oculus_rift.c @@ -23,7 +23,8 @@ int main() InitWindow(screenWidth, screenHeight, "raylib [core] example - oculus rift"); - InitOculusDevice(); + // NOTE: If device is not available, it fallbacks to default device (simulator) + InitVrDevice(HMD_OCULUS_RIFT_CV1); // Init VR device (Oculus Rift CV1) // Define the camera to look into our 3d world Camera camera; @@ -42,9 +43,9 @@ int main() { // Update //---------------------------------------------------------------------------------- - UpdateOculusTracking(); + UpdateVrTracking(); - if (IsKeyPressed(KEY_SPACE)) ToggleVR(); + if (IsKeyPressed(KEY_SPACE)) ToggleVrMode(); //---------------------------------------------------------------------------------- // Draw @@ -52,20 +53,16 @@ int main() BeginDrawing(); ClearBackground(RAYWHITE); - - if (IsOculusReady()) BeginOculusDrawing(); Begin3dMode(camera); DrawCube(cubePosition, 2.0f, 2.0f, 2.0f, RED); DrawCubeWires(cubePosition, 2.0f, 2.0f, 2.0f, MAROON); - + DrawGrid(10, 1.0f); - + End3dMode(); - - if (IsOculusReady()) EndOculusDrawing(); - + DrawFPS(10, 10); EndDrawing(); @@ -74,7 +71,7 @@ int main() // De-Initialization //-------------------------------------------------------------------------------------- - CloseOculusDevice(); // Close Oculus Rift device + CloseVrDevice(); // Close VR device CloseWindow(); // Close window and OpenGL context //-------------------------------------------------------------------------------------- |
