glClear
来源:互联网 发布:java字节码 编辑:程序博客网 时间:2024/04/29 15:26
1. glClear
Bitwise OR of masks that indicate the buffers to be cleared. The four masks are as follows. Mask Buffer to be Cleared 可以使用|运算符组合不同的缓冲标志位,表明需要清除的缓冲,例如glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT)表示要清除颜色缓冲以及深度缓冲
glClear
The glClear function clears buffers to preset values.
void glClear(
GLbitfield mask
);
参数
Parameters
mask当前可写的颜色缓冲
GL_DEPTH_BUFFER_BIT The depth buffer.深度缓冲
GL_ACCUM_BUFFER_BIT The accumulation buffer.累积缓冲
GL_STENCIL_BUFFER_BIT The stencil buffer.模板缓冲
//注释
Remarks
The glClear function sets the bitplane area of the window to values previously selected by glClearColor, glClearIndex, glClearDepth, glClearStencil, and glClearAccum. You can clear multiple color buffers simultaneously by selecting more than one buffer at a time using glDrawBuffer.
The pixel-ownership test, the scissor test, dithering, and the buffer writemasks affect the operation of glClear. The scissor box bounds the cleared region. The alpha function, blend function, logical operation, stenciling, texture mapping, and z-buffering are ignored by glClear.
The glClear function takes a single argument (mask) that is the bitwise OR of several values indicating which buffer is to be cleared.
The value to which each buffer is cleared depends on the setting of the clear value for that buffer.
If a buffer is not present, a glClear call directed at that buffer has no effect.
The following functions retrieve information related to glClear:
glGet with argument GL_ACCUM_CLEAR_VALUE
glGet with argument GL_DEPTH_CLEAR_VALUE
glGet with argument GL_INDEX_CLEAR_VALUE
glGet with argument GL_COLOR_CLEAR_VALUE
glGet with argument GL_STENCIL_CLEAR_VALUE
以下参考机械工业出版社的《OpenGL编程指南》第五版p18-p20。
glClear()语句的作用是用当前缓冲区清除值,也就是glClearColor或者glClearDepth等函数所指定的值来清除指定的缓冲区。比如:
glClearColor(0.0,0.0,0.0,0.0);
glClear(GL_COLOR_BUFFER_BIT);
第一条语句表示清除颜色设为黑色,第二条语句表示把整个窗口清除为当前的清除颜色,glClear()的唯一参数表示需要被清除的缓冲区。
- glClear
- glClear
- glClearColor() glClear()
- OpenGL函数思考-glClear
- OpenGL函数思考-glClear
- OpenGL函数-glClear
- OpenGL函数思考-glClear
- glclear glclearcolor小记
- (3)glClear()+glClearColor()
- 【OpenGL】理解glClear函数
- Opengl函数-glclear()
- 【OpenGL】glClear函数的使用
- 帧缓存操作 glClearColor,glClear,glClearDepth
- OpenGL函数思考-glClear and glClearColor
- glClearColor函数,glClear函数的底层解析
- glClearColor、glClear、glColor、glShadeModel、glClearDepth、glDepthFunc
- 关于glClear等函数的用法
- 【读书笔记】glClearColor和glClear的位置,glutReshapeFunc函数的调用
- hash冲突的解决方法以及hashMap的底层实现
- 【追求进步】数值的整数次方
- 指定打印的字符串
- C++ *max_element函数找最大元素 *min_element函数找最小元素 STL算法(找时间看)
- BZOJ-1876 SuperGCD Python(欧几里德算法)
- glClear
- 纪伯伦 《先知》 孩子
- HDOJ 1012
- AngularJS Scope(作用域)
- 遇见SVN——揭开你的面纱,体验团队的力量
- OpenGL中的Blend
- 更新内容
- ubuntu 搜索文件方法(find命令)
- 蓝桥杯_算法提高_金属采集(树形动态规划)