使用窗口系统 (GLX) 交换缓冲区和清除返回 [英] Swap Buffers and Clear Back using windowing system (GLX)

查看:56
本文介绍了使用窗口系统 (GLX) 交换缓冲区和清除返回的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在后台缓冲区和前台缓冲区之间交换时,后台缓冲区中的内容变得不确定.我想使用窗口系统"来定义它,例如 GLX、EGL、WGL.使用诸如 OpenGL (glClear) 之类的本机"渲染器是我的备用计划,别费心提了.它是备份的原因是因为我不想弄乱本机渲染上下文.对于这个问题,我将坚持使用 X/GLX,但如果您想描述如何在其他环境中执行此操作,请继续.

When swapping between back and front buffers the content in the back buffer becomes undefined. I´d like to define it using the "windowing system", such as GLX, EGL, WGL. Using "native" renderer such as OpenGL (glClear) is my backup plan, don´t bother mentioning it. The reason it is backup is because I don´t want to mess with native rendering contexts. I´ll stick to X/GLX for this question but if you feel inclined to describe how to do it in other Environments then go ahead.

来自 Xlib 文档(http://www.x.org/docs/X11/xlib.pdf) 我找到了一个操作,XClearWindow,用于清除带有背景像素"的窗口(顺便说一句,这个名字很棒......不是).

From the Xlib documentation (http://www.x.org/docs/X11/xlib.pdf) I find an operation, XClearWindow, for clearing window with "background pixel" (awesome name by the way... not).

  1. XClearWindow 是清除前/后缓冲区还是清除两个缓冲区?我想后备缓冲是有道理的,但我无法仅从 Xlib 文档中弄清楚...如果有人问起三重缓冲,那不是我!
  2. 它是否与 OpenGL 渲染同步,或者我是否必须通过例如在操作前调用 glxWaitGL 来同步自己?
  3. 命令是否阻塞,即停止直到完成?依赖于实现?

有关如何在使用窗口系统 (GLX) 进行交换后清除后台缓冲区的其他建议.

Other suggestions as how to clear the back buffer after a swap using windowing system (GLX) is appriciated.

干杯!

推荐答案

在后台缓冲区和前台缓冲区之间交换时,后台缓冲区中的内容变得不确定.

When swapping between back and front buffers the content in the back buffer becomes undefined.

是的,这是一件好事.

我想使用窗口系统"来定义它,例如 GLX、EGL、WGL

I´d like to define it using the "windowing system", such as GLX, EGL, WGL

为什么?除此之外,这样做是未定义的,因为交换后的背景不会有任何好处.

Why? Apart from that doing this is just as undefined, as the background after a swap nothing good will come from it.

如果 OpenGL DDX 知道它将同步的 XClearWindow,它充其量只会降低性能.在最坏的情况下,您会引入一个竞争条件,结果是不可预测的.

At best it will just degrade performance if the OpenGL DDX is aware of the XClearWindow it will sync. At worst you're introducing a race condition between which the results are unpredicatable.

有关如何在使用窗口系统 (GLX) 进行交换后清除后台缓冲区的其他建议.

Other suggestions as how to clear the back buffer after a swap using windowing system (GLX) is appriciated.

使用正确的 OpenGL 操作:glClear(…).

Use the proper OpenGL operation: glClear(…).

这篇关于使用窗口系统 (GLX) 交换缓冲区和清除返回的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆