diff options
| author | Ray <raysan5@gmail.com> | 2016-06-17 13:54:45 +0200 |
|---|---|---|
| committer | Ray <raysan5@gmail.com> | 2016-06-17 13:54:45 +0200 |
| commit | 24c9b1f717bd9a6510667907614928188a6b6a6f (patch) | |
| tree | 4dbed77c7b27390d28bc0977f0588a9f8d7d9aa7 /examples | |
| parent | 9fdf4420d5354c32394246703015a686df8135ce (diff) | |
| download | raylib-24c9b1f717bd9a6510667907614928188a6b6a6f.tar.gz raylib-24c9b1f717bd9a6510667907614928188a6b6a6f.zip | |
Improving Oculus Rift example...
Under design... looking for the easiest and most comprehensive way for
the user to use VR...
Diffstat (limited to 'examples')
| -rw-r--r-- | examples/core_oculus_rift.c | 40 |
1 files changed, 22 insertions, 18 deletions
diff --git a/examples/core_oculus_rift.c b/examples/core_oculus_rift.c index 3c9d7840..32e6b1c6 100644 --- a/examples/core_oculus_rift.c +++ b/examples/core_oculus_rift.c @@ -51,27 +51,31 @@ int main() ClearBackground(RAYWHITE); - BeginOculusDrawing(); + Begin3dMode(camera); + //BeginOculusDrawing(camera); // Add it to Begin3dMode() ? - for (int eye = 0; eye < 2; eye++) - { - // TODO: Probably projection and view matrices could be created here... - // ...without the need to create it internally through Begin3dMode() - Begin3dMode(camera); + for (int eye = 0; eye < 2; eye++) + { + // TODO: Probably projection and view matrices could be created here... + // ...without the need to create it internally through Begin3dMode() + //Begin3dMode(camera); + + SetOculusView(eye); + + DrawCube(cubePosition, 2.0f, 2.0f, 2.0f, RED); + DrawCubeWires(cubePosition, 2.0f, 2.0f, 2.0f, MAROON); + + DrawGrid(10, 1.0f); + + // TODO: Call internal buffers drawing directly (rlglDraw()) and... + // ...reset internal matrices, instead of letting End3dMode() do that + //End3dMode(); - SetOculusMatrix(eye); - - DrawCube(cubePosition, 2.0f, 2.0f, 2.0f, RED); - DrawCubeWires(cubePosition, 2.0f, 2.0f, 2.0f, MAROON); - - DrawGrid(10, 1.0f); - - // TODO: Call internal buffers drawing directly (rlglDraw()) and... - // ...reset internal matrices, instead of letting End3dMode() do that - End3dMode(); - } + DrawDefaultBuffers(); // Process internal dynamic buffers + } - EndOculusDrawing(); + End3dMode(); + //EndOculusDrawing(); // Add it to End3dMode() ? EndDrawing(); //---------------------------------------------------------------------------------- |
