Linux 需要 OpenGL/PBO 像素绘制示例

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/6428796/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-05 04:38:57  来源:igfitidea点击:

OpenGL/PBO pixel drawing example needed

c++linuxopenglpixelpbo

提问by Stan

I need to draw pixels very fast on a screen.

我需要在屏幕上非常快速地绘制像素。

I found this interesting page Fast pixel drawing library

我发现了这个有趣的页面 快速像素绘图库

author posted: "Using an OpenGL texture along with a PBO seems to be the best choice. Thanks."

作者写道:“使用 OpenGL 纹理和 PBO 似乎是最佳选择。谢谢。”

I guess OpenGL/PBO is what i need.

我想 OpenGL/PBO 是我需要的。

I was reading about PBO here http://www.opengl.org/registry/specs/ARB/pixel_buffer_object.txtand here http://www.songho.ca/opengl/gl_pbo.htmlbut i don't get it...

我在http://www.opengl.org/registry/specs/ARB/pixel_buffer_object.txthttp://www.songho.ca/opengl/gl_pbo.html 上阅读了 PBO , 但我不明白。 ..

Can someone provide simple example, how to draw pixels on a bitmap on a 2D texture with PBO extension?

有人可以提供简单的例子,如何在带有 PBO 扩展名的 2D 纹理上的位图上绘制像素?

回答by Martin Beckett

This is probably a good place to start OpenGL Pixel Buffer Object (PBO)

这可能是开始OpenGL Pixel Buffer Object (PBO)的好地方

If you need to draw an image then the easiest way is textures, basically a 2D block of memory that you write pixel RGB (or whatever) values into an then ask openGL to draw to the screen. VBOs and PBOs just improve on the process of getting the texture to the screen.

如果您需要绘制图像,那么最简单的方法是纹理,基本上是将像素 RGB(或其他)值写入一个 2D 内存块,然后让 openGL 绘制到屏幕上。VBO 和 PBO 只是改进了将纹理传送到屏幕的过程。

To draw individual 3D points then you need to learn more about OpenGL start here

要绘制单个 3D 点,则需要从此处开始了解有关 OpenGL 的更多信息