diff options
| author | victorfisac <victorfisac@gmail.com> | 2016-07-06 17:13:19 +0200 |
|---|---|---|
| committer | victorfisac <victorfisac@gmail.com> | 2016-07-06 17:13:19 +0200 |
| commit | 9fea631bfbe3d24565d100b55bbb0c43ae737374 (patch) | |
| tree | c649a47b83ac949f1abaea255ebbd30214e88711 /examples | |
| parent | 1aecd5be072083e27e4289499865b5681f1ea656 (diff) | |
| parent | 09cc27ca7a6d29434bd5f6274788d5a6a8de4ad6 (diff) | |
| download | raylib-9fea631bfbe3d24565d100b55bbb0c43ae737374.tar.gz raylib-9fea631bfbe3d24565d100b55bbb0c43ae737374.zip | |
Merge remote-tracking branch 'refs/remotes/raysan5/develop' into develop
Diffstat (limited to 'examples')
| -rw-r--r-- | examples/core_oculus_rift.c | 19 | ||||
| -rw-r--r-- | examples/core_oculus_rift.png | bin | 0 -> 154835 bytes |
2 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 //-------------------------------------------------------------------------------------- diff --git a/examples/core_oculus_rift.png b/examples/core_oculus_rift.png Binary files differnew file mode 100644 index 00000000..04a3e067 --- /dev/null +++ b/examples/core_oculus_rift.png |
