glClear [GL_COLOR_BUFFER_BIT,GL_DEPTH_BUFFER_BIT和GL_STENCIL_BUFFER_BIT]

问题描述:

我在http://LearnOpenGL.com学习这些教程为OpenGL,我碰到这样的功能glClearhere在渲染标题)。科林我仍然在学习英文,我在这个功能中对世界“清楚”有麻烦。 (1)清除缓冲区是什么意思?glClear [GL_COLOR_BUFFER_BIT,GL_DEPTH_BUFFER_BIT和GL_STENCIL_BUFFER_BIT]

(2)在下面这三个值中,“clear”这个词的含义是什么?

GL_COLOR_BUFFER_BIT, GL_DEPTH_BUFFER_BIT and GL_STENCIL_BUFFER_BIT 
+0

https://stackoverflow.com/questions/5479951/what-is-the-purpose-of-gl-color-buffer-bit-and-gl-depth-buffer-bit – Asesh

从这里:https://www.khronos.org/registry/OpenGL-Refpages/gl2.1/xhtml/glClear.xml

glClear设置窗口中值之前 通过glClearColorglClearIndexglClearDepthglClearStencil, 和glClearAccum

所以它选择的位平面面积只需分配默认值为缓冲位。