开发者

Can I write directly into the color buffer in OpenGL?

开发者 https://www.devze.com 2023-03-08 17:39 出处:网络
For some reason I want to write directly some pixels into the screen. For example, is there any function call that close to: glDrawPixels(int x, int y), or is there any way I can get and set the color

For some reason I want to write directly some pixels into the screen. For example, is there any function call that close to: glDrawPixels(int x, int y), or is there any way I can get and set the color buffer?

Hahaha ... it's funny b开发者_JAVA百科ecause glDrawPixels is a name I made up, and after reading Ramya's reply I went to the reference and found that they really got a function called glDrawPixels, and it is just what I need. How ironical!


Yes, glDrawPixels does that, but it's slow, to draw pixel data, use textures by drawing a textured quad. If you want to draw individual pixels, that will be a lot slower than drawing bigger textured areas.

0

精彩评论

暂无评论...
验证码 换一张
取 消