diff --git a/src/rlgl.h b/src/rlgl.h index ecd3795a9..8d1b41d7a 100644 --- a/src/rlgl.h +++ b/src/rlgl.h @@ -2108,6 +2108,13 @@ void rlClearColor(unsigned char r, unsigned char g, unsigned char b, unsigned ch glClearColor(cr, cg, cb, ca); } +// Clears the depth buffer. Useful for drawing first person weapons over the +// rendered scene without them clipping through world geometry. +void rlClearDepthBuffer(void) +{ + glClear(GL_DEPTH_BUFFER_BIT); // Beats having to #import just to call this one function. +} + // Clear used screen buffers (color and depth) void rlClearScreenBuffers(void) { @@ -5364,4 +5371,4 @@ static Matrix rlMatrixInvert(Matrix mat) } #endif -#endif // RLGL_IMPLEMENTATION \ No newline at end of file +#endif // RLGL_IMPLEMENTATION