diff options
| author | raysan5 <[email protected]> | 2020-04-05 17:50:37 +0200 |
|---|---|---|
| committer | raysan5 <[email protected]> | 2020-04-05 17:50:37 +0200 |
| commit | 4ceb4d3bf3780a8a1c85b89415879799bf81d422 (patch) | |
| tree | 8e8f9d95849b2a5cecc621dc6612ff55a67cd739 /src/rlgl.h | |
| parent | 9c280bc7afcca1e3c813fc5620d9a0074e5a9db9 (diff) | |
| download | raylib-4ceb4d3bf3780a8a1c85b89415879799bf81d422.tar.gz raylib-4ceb4d3bf3780a8a1c85b89415879799bf81d422.zip | |
Some code tweaks, comments and defines
Diffstat (limited to 'src/rlgl.h')
| -rw-r--r-- | src/rlgl.h | 22 |
1 files changed, 11 insertions, 11 deletions
@@ -144,17 +144,17 @@ #define MAX_MATRIX_STACK_SIZE 32 // Max size of Matrix stack #define MAX_DRAWCALL_REGISTERED 256 // Max draws by state changes (mode, texture) -#ifndef DEFAULT_NEAR_CULL_DISTANCE - #define DEFAULT_NEAR_CULL_DISTANCE 0.01 // Default near cull distance -#endif -#ifndef DEFAULT_FAR_CULL_DISTANCE - #define DEFAULT_FAR_CULL_DISTANCE 1000.0 // Default far cull distance -#endif - // Shader and material limits #define MAX_SHADER_LOCATIONS 32 // Maximum number of predefined locations stored in shader struct #define MAX_MATERIAL_MAPS 12 // Maximum number of texture maps stored in shader struct +#ifndef RL_NEAR_CULL_DISTANCE + #define RL_NEAR_CULL_DISTANCE 0.01 // Default near cull distance +#endif +#ifndef RL_FAR_CULL_DISTANCE + #define RL_FAR_CULL_DISTANCE 1000.0 // Default far cull distance +#endif + // Texture parameters (equivalent to OpenGL defines) #define RL_TEXTURE_WRAP_S 0x2802 // GL_TEXTURE_WRAP_S #define RL_TEXTURE_WRAP_T 0x2803 // GL_TEXTURE_WRAP_T @@ -3267,7 +3267,7 @@ Texture2D GenTextureCubemap(Shader shader, Texture2D map, int size) glTexParameteri(GL_TEXTURE_CUBE_MAP, GL_TEXTURE_MAG_FILTER, GL_LINEAR); // Create projection and different views for each face - Matrix fboProjection = MatrixPerspective(90.0*DEG2RAD, 1.0, DEFAULT_NEAR_CULL_DISTANCE, DEFAULT_FAR_CULL_DISTANCE); + Matrix fboProjection = MatrixPerspective(90.0*DEG2RAD, 1.0, RL_NEAR_CULL_DISTANCE, RL_FAR_CULL_DISTANCE); 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 }), MatrixLookAt((Vector3){ 0.0f, 0.0f, 0.0f }, (Vector3){ -1.0f, 0.0f, 0.0f }, (Vector3){ 0.0f, -1.0f, 0.0f }), @@ -3345,7 +3345,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*DEG2RAD, 1.0, DEFAULT_NEAR_CULL_DISTANCE, DEFAULT_FAR_CULL_DISTANCE); + Matrix fboProjection = MatrixPerspective(90.0*DEG2RAD, 1.0, RL_NEAR_CULL_DISTANCE, RL_FAR_CULL_DISTANCE); 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 }), MatrixLookAt((Vector3){ 0.0f, 0.0f, 0.0f }, (Vector3){ -1.0f, 0.0f, 0.0f }, (Vector3){ 0.0f, -1.0f, 0.0f }), @@ -3426,7 +3426,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*DEG2RAD, 1.0, DEFAULT_NEAR_CULL_DISTANCE, DEFAULT_FAR_CULL_DISTANCE); + Matrix fboProjection = MatrixPerspective(90.0*DEG2RAD, 1.0, RL_NEAR_CULL_DISTANCE, RL_FAR_CULL_DISTANCE); 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 }), MatrixLookAt((Vector3){ 0.0f, 0.0f, 0.0f }, (Vector3){ -1.0f, 0.0f, 0.0f }, (Vector3){ 0.0f, -1.0f, 0.0f }), @@ -3647,7 +3647,7 @@ void SetVrConfiguration(VrDeviceInfo hmd, Shader distortion) // Compute camera projection matrices float projOffset = 4.0f*lensShift; // Scaled to projection space coordinates [-1..1] - Matrix proj = MatrixPerspective(fovy, aspect, DEFAULT_NEAR_CULL_DISTANCE, DEFAULT_FAR_CULL_DISTANCE); + Matrix proj = MatrixPerspective(fovy, aspect, RL_NEAR_CULL_DISTANCE, RL_FAR_CULL_DISTANCE); RLGL.Vr.config.eyesProjection[0] = MatrixMultiply(proj, MatrixTranslate(projOffset, 0.0f, 0.0f)); RLGL.Vr.config.eyesProjection[1] = MatrixMultiply(proj, MatrixTranslate(-projOffset, 0.0f, 0.0f)); |
