glFlush
OpenGL中的函数
glFlush( )是OpenGL中的函数,用于强制刷新缓冲,保证绘图命令将被执行,而不是存储在缓冲区中等待其他的OpenGL命令。
函数简介
glFlush( )是OpenGL中的函数,用于强制刷新缓冲,保证绘图命令将被执行,而不是存储在缓冲区中等待其他的OpenGL命令。
函数作用
简单地说glFlush( )就是强制刷新,OpenGL是使用一条渲染管线线性处理命令的,一般情况下,我们提交给OpenGL的指令并不是马上送到驱动程序里执行的,而是放到一个缓冲区里面,等这个缓冲区满了再一次过发到驱动程序里执行;很多时候只有几条指令是填充不满那个缓冲区的,就是说这些指令根本没有被发送到驱动里,所以我们要调用glFlush来强制把这些指令送到驱动里进行处理。
MSDN中解释
glFlush
The glFlush function forces execution of OpenGL functions in finite time.
void glFlush( void );
Parameters
This function has no parameters.
Remarks
Different OpenGL implementations buffer commands in several different locations, including network buffers and the graphics accelerator itself. The glFlush function empties all these buffers, causing all issued commands to be executed as quickly as they are accepted by the actual rendering engine. Though this execution may not be completed in any particular time period, it does complete in a finite amount of time.
Because any OpenGL program might be executed over a network, or on an accelerator that buffers commands, be sure to call glFlush in any programs requiring that all of their previously issued commands have been completed. For example, call glFlush before waiting for user input that depends on the generated image.
The glFlush function can return at any time. It does not wait until the execution of all previously issued OpenGL functions is complete.
参考资料
最新修订时间:2024-05-30 12:07
目录
概述
函数简介
函数作用
MSDN中解释
参考资料