GLCLEARDEPTH(3G)

πŸ“¦ version 24.3.3, in opensuse-leap 16.0

✨ GLCLEARDEPTH πŸ’…

ok so bestie, welcome to glClearDepth β€” it's from the 3G part of the manual, which is where all the OpenGL girlies hang out πŸŽ€


πŸ’– NAME πŸ’–

glClearDepth β€” specify the clear value for the depth buffer. that's it, that's the whole vibe. it sets the number. the depth buffer gets that number when it gets cleared. iconic behavior honestly 🌸


πŸ¦‹ C SPECIFICATION πŸ¦‹

void glClearDepth( GLclampd depth )

look at her. one parameter. no drama. main character energy πŸ”₯


πŸ‘‘ PARAMETERS πŸ‘‘

  • depth β€” this is the depth value that gets used when the depth buffer is cleared. and ngl, the initial value is 1. yes, one. she comes out the box with 1 and she's not sorry about it πŸ’…

🌈 DESCRIPTION 🌈

okay so here's the tea β˜• β€” glClearDepth specifies the depth value that glClear uses to clear the depth buffer. that's the whole job. that's what she does.

and here's the lil detail you gotta remember: values you hand to glClearDepth get clamped to the range [0, 1]. so if you try to be cute and pass something outside that, it gets squished back in. no exceptions, no negotiating, the range is the range 🫢


πŸ’€ ERRORS πŸ’€

  • GL_INVALID_OPERATION gets generated if glClearDepth is executed between the execution of glBegin and the corresponding execution of glEnd. like literally do not do that. it's not the moment. read the room πŸ™ˆ
fr fr, if you're chillin' inside a glBegin/glEnd pair, glClearDepth is NOT the move. the error is gonna show up and it's gonna be awkward for everyone 😭

πŸ“ ASSOCIATED GETS πŸ“

  • glGet with argument GL_DEPTH_CLEAR_VALUE β€” this is how you peek at what the clear value currently is πŸ‘€

🧚 SEE ALSO 🧚

  • glClear(3G) β€” the bestie that actually does the clearing. glClearDepth just tells her what number to use 🫢

ok that's the whole page, you ate that, go clear some depth buffers bestie πŸ’œβœ¨

sign-off time: this was GLCLEARDEPTH(3G) β€” the 3G manual, page name GLCLEARDEPTH β€” source and version and date all wrapped up in that one glorious footer line. mwah πŸ’‹

πŸ“¦ where this page comes from