将glReadBuffer()/glDrawBuffer()调用转换为OpenGL ES [英] Converting glReadBuffer() / glDrawBuffer() calls into OpenGL ES

查看:705
本文介绍了将glReadBuffer()/glDrawBuffer()调用转换为OpenGL ES的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在理解如何移植glReadBuffer()和&时遇到麻烦. glDrawBuffer()调用Open GL ES 1.1.互联网上的各种论坛帖子都只是在说使用VBO",而不必更深入.

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);

跟着

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

如何将像素写出来?

推荐答案

glReadBufferglDrawBuffer只是设置后续绘图操作的源和目标.假设您要定位的是单视设备(例如iPhone或Android设备),并且已经请求了两个缓冲区,那么您已经准备好绘制到后缓冲区.在GL ES中读取颜色缓冲区的唯一方法是glReadPixels,它将从您要绘制到的相同缓冲区中读取.

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.

所有这些都与VBO完全无关,VBO将数据数组的管理传递给驱动程序,通常隐式地允许将它们放入GPU的直接地址空间中.

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.

这篇关于将glReadBuffer()/glDrawBuffer()调用转换为OpenGL ES的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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