diff options
| author | Ray <[email protected]> | 2021-04-06 23:23:03 +0200 |
|---|---|---|
| committer | Ray <[email protected]> | 2021-04-06 23:23:03 +0200 |
| commit | b3f75b91ff6859f5c19c4b1e6b17c78b5e66530f (patch) | |
| tree | c476d384e41fb957e5cce5f1c5289ddeae4d06e5 /src | |
| parent | 84d0d21f23a55d5f4aab9a9bba8ffa3091230248 (diff) | |
| download | raylib-b3f75b91ff6859f5c19c4b1e6b17c78b5e66530f.tar.gz raylib-b3f75b91ff6859f5c19c4b1e6b17c78b5e66530f.zip | |
REDESIGNED: Vr stereo mode
Diffstat (limited to 'src')
| -rw-r--r-- | src/core.c | 19 | ||||
| -rw-r--r-- | src/raylib.h | 2 |
2 files changed, 2 insertions, 19 deletions
@@ -2067,36 +2067,19 @@ void EndScissorMode(void) } // Begin VR drawing configuration -void BeginVrStereoMode(RenderTexture2D target, VrStereoConfig config) +void BeginVrStereoMode(VrStereoConfig config) { -#if defined(GRAPHICS_API_OPENGL_33) || defined(GRAPHICS_API_OPENGL_ES2) - rlEnableFramebuffer(target.id); // Setup framebuffer for stereo rendering - //glEnable(GL_FRAMEBUFFER_SRGB); // Enable SRGB framebuffer (only if required) - rlClearScreenBuffers(); // Clear current framebuffer - rlEnableStereoRender(); // Set stereo render matrices rlSetMatrixProjectionStereo(config.projection[0], config.projection[1]); rlSetMatrixViewOffsetStereo(config.viewOffset[0], config.viewOffset[1]); -#endif } // End VR drawing process (and desktop mirror) void EndVrStereoMode(void) { -#if defined(GRAPHICS_API_OPENGL_33) || defined(GRAPHICS_API_OPENGL_ES2) rlDisableStereoRender(); - - rlDisableFramebuffer(); // Unbind current framebuffer - - // Reset viewport and default projection-modelview matrices - rlViewport(0, 0, GetScreenWidth(), GetScreenHeight()); - rlSetMatrixProjection(MatrixOrtho(0.0, GetScreenWidth(), GetScreenHeight(), 0.0, 0.0, 1.0)); - rlSetMatrixModelview(MatrixIdentity()); - - rlDisableDepthTest(); -#endif } // Load VR stereo config for VR simulator device parameters diff --git a/src/raylib.h b/src/raylib.h index e8d45a91..4c70e48a 100644 --- a/src/raylib.h +++ b/src/raylib.h @@ -965,7 +965,7 @@ RLAPI void BeginBlendMode(int mode); // Begin blend RLAPI void EndBlendMode(void); // End blending mode (reset to default: alpha blending) RLAPI void BeginScissorMode(int x, int y, int width, int height); // Begin scissor mode (define screen area for following drawing) RLAPI void EndScissorMode(void); // End scissor mode -RLAPI void BeginVrStereoMode(RenderTexture2D target, VrStereoConfig config); // Begin stereo rendering (requires VR simulator) +RLAPI void BeginVrStereoMode(VrStereoConfig config); // Begin stereo rendering (requires VR simulator) RLAPI void EndVrStereoMode(void); // End stereo rendering (requires VR simulator) // VR stereo config functions for VR simulator |
