diff options
| author | raysan5 <raysan5@gmail.com> | 2017-07-21 10:42:57 +0200 |
|---|---|---|
| committer | raysan5 <raysan5@gmail.com> | 2017-07-21 10:42:57 +0200 |
| commit | 980d9d4cd4ab941afc53bf8a83ea2a18d28ee4e2 (patch) | |
| tree | a8247bbd4ecc5e32b9e5fca91b1d8d8970b0d834 /src/rlgl.c | |
| parent | 84aff31973667e6bec29915d60971f9a5bb02a44 (diff) | |
| download | raylib-980d9d4cd4ab941afc53bf8a83ea2a18d28ee4e2.tar.gz raylib-980d9d4cd4ab941afc53bf8a83ea2a18d28ee4e2.zip | |
rlgl usable as standalone library
Diffstat (limited to 'src/rlgl.c')
| -rw-r--r-- | src/rlgl.c | 16 |
1 files changed, 8 insertions, 8 deletions
@@ -2548,7 +2548,7 @@ Texture2D GenTextureCubemap(Shader shader, Texture2D skyHDR, int size) glTexParameteri(GL_TEXTURE_CUBE_MAP, GL_TEXTURE_MAG_FILTER, GL_LINEAR); // Create projection (transposed) and different views for each face - Matrix fboProjection = MatrixPerspective(90.0, 1.0, 0.01, 1000.0); + Matrix fboProjection = MatrixPerspective(90.0*DEG2RAD, 1.0, 0.01, 1000.0); MatrixTranspose(&fboProjection); Matrix fboViews[6] = { MatrixLookAt((Vector3){ 0.0f, 0.0f, 0.0f }, (Vector3){ 1.0f, 0.0f, 0.0f }, (Vector3){ 0.0f, -1.0f, 0.0f }), @@ -2581,7 +2581,7 @@ Texture2D GenTextureCubemap(Shader shader, Texture2D skyHDR, int size) glBindFramebuffer(GL_FRAMEBUFFER, 0); // Reset viewport dimensions to default - glViewport(0, 0, GetScreenWidth(), GetScreenHeight()); + glViewport(0, 0, screenWidth, screenHeight); //glEnable(GL_CULL_FACE); cubemap.width = size; @@ -2620,7 +2620,7 @@ Texture2D GenTextureIrradiance(Shader shader, Texture2D cubemap, int size) glTexParameteri(GL_TEXTURE_CUBE_MAP, GL_TEXTURE_MAG_FILTER, GL_LINEAR); // Create projection (transposed) and different views for each face - Matrix fboProjection = MatrixPerspective(90.0, 1.0, 0.01, 1000.0); + Matrix fboProjection = MatrixPerspective(90.0*DEG2RAD, 1.0, 0.01, 1000.0); MatrixTranspose(&fboProjection); Matrix fboViews[6] = { MatrixLookAt((Vector3){ 0.0f, 0.0f, 0.0f }, (Vector3){ 1.0f, 0.0f, 0.0f }, (Vector3){ 0.0f, -1.0f, 0.0f }), @@ -2653,7 +2653,7 @@ Texture2D GenTextureIrradiance(Shader shader, Texture2D cubemap, int size) glBindFramebuffer(GL_FRAMEBUFFER, 0); // Reset viewport dimensions to default - glViewport(0, 0, GetScreenWidth(), GetScreenHeight()); + glViewport(0, 0, screenWidth, screenHeight); irradiance.width = size; irradiance.height = size; @@ -2696,7 +2696,7 @@ Texture2D GenTexturePrefilter(Shader shader, Texture2D cubemap, int size) glGenerateMipmap(GL_TEXTURE_CUBE_MAP); // Create projection (transposed) and different views for each face - Matrix fboProjection = MatrixPerspective(90.0, 1.0, 0.01, 1000.0); + Matrix fboProjection = MatrixPerspective(90.0*DEG2RAD, 1.0, 0.01, 1000.0); MatrixTranspose(&fboProjection); Matrix fboViews[6] = { MatrixLookAt((Vector3){ 0.0f, 0.0f, 0.0f }, (Vector3){ 1.0f, 0.0f, 0.0f }, (Vector3){ 0.0f, -1.0f, 0.0f }), @@ -2743,7 +2743,7 @@ Texture2D GenTexturePrefilter(Shader shader, Texture2D cubemap, int size) glBindFramebuffer(GL_FRAMEBUFFER, 0); // Reset viewport dimensions to default - glViewport(0, 0, GetScreenWidth(), GetScreenHeight()); + glViewport(0, 0, screenWidth, screenHeight); prefilter.width = size; prefilter.height = size; @@ -2783,7 +2783,7 @@ Texture2D GenTextureBRDF(Shader shader, Texture2D cubemap, int size) glBindFramebuffer(GL_FRAMEBUFFER, 0); // Reset viewport dimensions to default - glViewport(0, 0, GetScreenWidth(), GetScreenHeight()); + glViewport(0, 0, screenWidth, screenHeight); brdf.width = size; brdf.height = size; @@ -3985,7 +3985,7 @@ static void SetStereoConfig(VrDeviceInfo hmd) // Compute camera projection matrices float projOffset = 4.0f*lensShift; // Scaled to projection space coordinates [-1..1] - Matrix proj = MatrixPerspective(fovy, aspect, 0.01, 1000.0); + Matrix proj = MatrixPerspective(fovy*DEG2RAD, aspect, 0.01, 1000.0); vrConfig.eyesProjection[0] = MatrixMultiply(proj, MatrixTranslate(projOffset, 0.0f, 0.0f)); vrConfig.eyesProjection[1] = MatrixMultiply(proj, MatrixTranslate(-projOffset, 0.0f, 0.0f)); |
