gLFlush和glutSwapBuffers

gLFlush和glutSwapBuffers

本文介绍了OpenGL缓冲区,gLFlush和glutSwapBuffers()的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用glutInitDisplayMode(GLUT_SINGLE|GLUT_RGB);之间有什么区别吗和glFlush()

Is there any difference between using, glutInitDisplayMode(GLUT_SINGLE|GLUT_RGB);withglFlush()

glutInitDisplayMode(GLUT_DOUBLE|GLUT_RGB);glutSwapBuffers()?

通过差异,我暗指代码的执行或显示吗?

By difference, I imply difference in the execution or display of code ?

推荐答案

在现代平台上存在巨大差异,从某种意义上来说,组合窗口管理器(例如Windows Vista +上的Aero)实际上拥有前缓冲区.如果绘制单个缓冲区,则永远不会发生缓冲区交换,最终结果是屏幕上将不会显示任何内容.

There is a huge difference on modern platforms, in the sense that compositing window mangers (e.g. Aero on Windows Vista+) effectively own the front-buffer. If you draw single buffered, a buffer swap never occurs, and the end result is that nothing will ever be displayed on the screen.

即使没有复合窗口管理器,这也会影响混合GPU的某些实现(例如,笔记本电脑上的Intel集成+ NVIDIA离散).在这样的系统上,缓冲区交换操作可以将离散GPU的帧缓冲区复制到集成的帧中,以进行最终输出.

This also affects some implementations of hybrid GPUs (e.g. Intel integrated + NVIDIA discrete on laptops) even without a compositing window manager. On such a system, the buffer swap operation is what copies the discrete GPU's framebuffer to the integrated for final output.

几乎没有理由在现代GPU上使用单缓冲渲染.过去,必须维护两个颜色缓冲区会占用大量内存,这也是反对三重缓冲的一个引人注目的论点,但如今,颜色缓冲区所需的内存量只是VRAM的一小部分.

There is almost no reason to use single-buffered rendering on modern GPUs. It used to be that having to maintain two color buffers ate a lot of memory, which was also a compelling argument against triple-buffering, but these days the amount of memory required for the color buffer is a minute fraction of VRAM.

这篇关于OpenGL缓冲区,gLFlush和glutSwapBuffers()的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-05 02:33