From 2ff2096b36d80078cbda5e61ff77d7fedeeeaeb5 Mon Sep 17 00:00:00 2001 From: raysan5 Date: Mon, 4 Jul 2016 18:35:50 +0200 Subject: [PATCH] Moved Oculus enable drawing to user side... Still thinking about the best way to manage this... --- examples/core_oculus_rift.c | 4 ++++ src/core.c | 6 +++--- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/examples/core_oculus_rift.c b/examples/core_oculus_rift.c index 131a21c2..734ba8fd 100644 --- a/examples/core_oculus_rift.c +++ b/examples/core_oculus_rift.c @@ -52,6 +52,8 @@ int main() BeginDrawing(); ClearBackground(RAYWHITE); + + if (IsOculusReady()) BeginOculusDrawing(); Begin3dMode(camera); @@ -62,6 +64,8 @@ int main() End3dMode(); + if (IsOculusReady()) EndOculusDrawing(); + DrawFPS(10, 10); EndDrawing(); diff --git a/src/core.c b/src/core.c index a8557831..f8a83e25 100644 --- a/src/core.c +++ b/src/core.c @@ -521,7 +521,7 @@ void BeginDrawing(void) updateTime = currentTime - previousTime; previousTime = currentTime; - if (IsOculusReady()) BeginOculusDrawing(); + //if (IsOculusReady()) BeginOculusDrawing(); rlClearScreenBuffers(); // Clear current framebuffers rlLoadIdentity(); // Reset current matrix (MODELVIEW) @@ -536,7 +536,7 @@ void EndDrawing(void) { rlglDraw(); // Draw Buffers (Only OpenGL 3+ and ES2) - if (IsOculusReady()) EndOculusDrawing(); + //if (IsOculusReady()) EndOculusDrawing(); SwapBuffers(); // Copy back buffer to front buffer PollInputEvents(); // Poll user events @@ -2675,7 +2675,7 @@ static void *MouseThread(void *arg) int mouseRelX = 0; int mouseRelY = 0; - while (1) + while (!windowShouldClose) { if (read(mouseStream, &mouse, sizeof(MouseEvent)) == (int)sizeof(MouseEvent)) {