diff options
| author | Ray <raysan5@gmail.com> | 2016-07-04 01:29:23 +0200 |
|---|---|---|
| committer | Ray <raysan5@gmail.com> | 2016-07-04 01:29:23 +0200 |
| commit | ee72654b557202a673f042484c83d3020ae618b8 (patch) | |
| tree | 3479ad33ec4feafe25b7b32ee8c9df973d5f1a3f /src/core.c | |
| parent | 164ead03c9f4d8af6d2e2e0eabcf40a60ad47cb3 (diff) | |
| download | raylib-ee72654b557202a673f042484c83d3020ae618b8.tar.gz raylib-ee72654b557202a673f042484c83d3020ae618b8.zip | |
Redesigned stereo rendering mechanism
Now it's easier for the user! Just init Oculus device and get stereo
rendering!
Diffstat (limited to 'src/core.c')
| -rw-r--r-- | src/core.c | 18 |
1 files changed, 5 insertions, 13 deletions
@@ -520,6 +520,8 @@ void BeginDrawing(void) currentTime = GetTime(); // Number of elapsed seconds since InitTimer() was called updateTime = currentTime - previousTime; previousTime = currentTime; + + if (IsOculusReady()) BeginOculusDrawing(); rlClearScreenBuffers(); // Clear current framebuffers rlLoadIdentity(); // Reset current matrix (MODELVIEW) @@ -533,6 +535,8 @@ void BeginDrawing(void) void EndDrawing(void) { rlglDraw(); // Draw Buffers (Only OpenGL 3+ and ES2) + + if (IsOculusReady()) EndOculusDrawing(); SwapBuffers(); // Copy back buffer to front buffer PollInputEvents(); // Poll user events @@ -608,15 +612,11 @@ void Begin3dMode(Camera camera) rlMultMatrixf(MatrixToFloat(cameraView)); // Multiply MODELVIEW matrix by view matrix (camera) rlEnableDepthTest(); // Enable DEPTH_TEST for 3D - - if (IsOculusReady()) BeginOculusDrawing(); } // Ends 3D mode and returns to default 2D orthographic mode void End3dMode(void) -{ - if (IsOculusReady()) EndOculusDrawing(); - +{ rlglDraw(); // Process internal buffers (update + draw) rlMatrixMode(RL_PROJECTION); // Switch to projection matrix @@ -1021,14 +1021,6 @@ Matrix GetCameraMatrix(Camera camera) return MatrixLookAt(camera.position, camera.target, camera.up); } -// Update and draw default buffers vertex data -// NOTE: This data has been stored dynamically during frame on each Draw*() call -void DrawDefaultBuffers(void) -{ - rlglUpdateDefaultBuffers(); // Upload frame vertex data to GPU - rlglDrawDefaultBuffers(); // Draw vertex data into framebuffer -} - //---------------------------------------------------------------------------------- // Module Functions Definition - Input (Keyboard, Mouse, Gamepad) Functions //---------------------------------------------------------------------------------- |
