diff options
| author | raysan5 <[email protected]> | 2017-04-17 16:42:01 +0200 |
|---|---|---|
| committer | raysan5 <[email protected]> | 2017-04-17 16:42:01 +0200 |
| commit | 881f134f4d2fb4419d50382284e19b4f8ca4660e (patch) | |
| tree | 065658f8b462dd76837f849450bdd3895134121a /docs/examples/src/core | |
| parent | 3e082f1d6251e366d7be6019d0950ea7a9e6b5b4 (diff) | |
| download | raylib-881f134f4d2fb4419d50382284e19b4f8ca4660e.tar.gz raylib-881f134f4d2fb4419d50382284e19b4f8ca4660e.zip | |
Review and recompile web examples
Diffstat (limited to 'docs/examples/src/core')
| -rw-r--r-- | docs/examples/src/core/core_input_gamepad.c | 4 | ||||
| -rw-r--r-- | docs/examples/src/core/core_vr_simulator.c | 41 |
2 files changed, 22 insertions, 23 deletions
diff --git a/docs/examples/src/core/core_input_gamepad.c b/docs/examples/src/core/core_input_gamepad.c index f98885e3..64520a47 100644 --- a/docs/examples/src/core/core_input_gamepad.c +++ b/docs/examples/src/core/core_input_gamepad.c @@ -4,8 +4,8 @@ * * NOTE: This example requires a Gamepad connected to the system * raylib is configured to work with the following gamepads: -* Xbox 360 Controller (Xbox 360, Xbox One) -* PLAYSTATION(R)3 Controller +* - Xbox 360 Controller (Xbox 360, Xbox One) +* - PLAYSTATION(R)3 Controller * Check raylib.h for buttons configuration * * This example has been created using raylib 1.6 (www.raylib.com) diff --git a/docs/examples/src/core/core_vr_simulator.c b/docs/examples/src/core/core_vr_simulator.c index eb628cd7..69e0f849 100644 --- a/docs/examples/src/core/core_vr_simulator.c +++ b/docs/examples/src/core/core_vr_simulator.c @@ -1,14 +1,11 @@ /******************************************************************************************* * -* raylib [core] example - Oculus Rift CV1 +* raylib [core] example - VR Simulator (Oculus Rift CV1 parameters) * -* Compile example using: -* gcc -o $(NAME_PART).exe $(FILE_NAME) -L. -L..\src\external\OculusSDK\LibOVR -lLibOVRRT32_1 -lraylib -lglfw3 -lopengl32 -lgdi32 -std=c99 -* -* This example has been created using raylib 1.5 (www.raylib.com) +* This example has been created using raylib 1.7 (www.raylib.com) * raylib is licensed under an unmodified zlib/libpng license (View raylib.h for details) * -* Copyright (c) 2016 Ramon Santamaria (@raysan5) +* Copyright (c) 2017 Ramon Santamaria (@raysan5) * ********************************************************************************************/ @@ -23,10 +20,9 @@ int main() // NOTE: screenWidth/screenHeight should match VR device aspect ratio - InitWindow(screenWidth, screenHeight, "raylib [core] example - oculus rift"); - - // NOTE: If device is not available, it fallbacks to default device (simulator) - InitVrDevice(HMD_OCULUS_RIFT_CV1); // Init VR device (Oculus Rift CV1) + InitWindow(screenWidth, screenHeight, "raylib [core] example - vr simulator"); + + InitVrSimulator(HMD_OCULUS_RIFT_CV1); // Init VR simulator (Oculus Rift CV1 parameters) // Define the camera to look into our 3d world Camera camera; @@ -47,10 +43,9 @@ int main() { // Update //---------------------------------------------------------------------------------- - if (IsVrSimulator()) UpdateCamera(&camera); // Update camera (simulator mode) - else if (IsVrDeviceReady()) UpdateVrTracking(&camera); // Update camera with device tracking data - - if (IsKeyPressed(KEY_SPACE)) ToggleVrMode(); // Toggle VR mode + UpdateCamera(&camera); // Update camera (simulator mode) + + if (IsKeyPressed(KEY_SPACE)) ToggleVrMode(); // Toggle VR mode //---------------------------------------------------------------------------------- // Draw @@ -58,15 +53,19 @@ int main() BeginDrawing(); ClearBackground(RAYWHITE); + + BeginVrDrawing(); - Begin3dMode(camera); + Begin3dMode(camera); - DrawCube(cubePosition, 2.0f, 2.0f, 2.0f, RED); - DrawCubeWires(cubePosition, 2.0f, 2.0f, 2.0f, MAROON); + DrawCube(cubePosition, 2.0f, 2.0f, 2.0f, RED); + DrawCubeWires(cubePosition, 2.0f, 2.0f, 2.0f, MAROON); - DrawGrid(40, 1.0f); + DrawGrid(40, 1.0f); - End3dMode(); + End3dMode(); + + EndVrDrawing(); DrawFPS(10, 10); @@ -76,10 +75,10 @@ int main() // De-Initialization //-------------------------------------------------------------------------------------- - CloseVrDevice(); // Close VR device + CloseVrSimulator(); // Close VR simulator CloseWindow(); // Close window and OpenGL context //-------------------------------------------------------------------------------------- return 0; -} +}
\ No newline at end of file |
