Converting glReadBuffer() / glDrawBuffer() calls into OpenGL ES

浪尽此生 提交于 2019-12-10 11:16:09

问题


I'm having trouble understanding how to port glReadBuffer() & glDrawBuffer() calls into Open GL ES 1.1. Various forum posts on the internet just say "use VBOs," without going into more depth.

Can you please help me understand an appropriate conversion? Say I have:

glReadBuffer(GL_FRONT);

followed by

glDrawBuffer(GL_BACK_LEFT);
state->paint(state_id, f);

How can I write the pixels out?


回答1:


glReadBuffer and glDrawBuffer just set the source and target for subsequent drawing operations. Assuming you're targeting a monoscopic device, such as the iPhone or an Android device, and have requested two buffers then you're already set for drawing to the back buffer. The only means of reading the colour buffer in GL ES is glReadPixels, which will read from the same buffer that you're drawing to.

All of these are completely unrelated to VBOs, which pass off management of arrays of data to the driver, often implicitly allowing them to be put into the GPU's direct address space.



来源:https://stackoverflow.com/questions/4641017/converting-glreadbuffer-gldrawbuffer-calls-into-opengl-es

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!