如何使用gles 2.x支持gles1.1扩展功能OES?

时间:2015-03-18 08:40:51

标签: opengl-es-2.0 porting opengl-es-1.1

无论如何使用gles 2.x或3.x来支持gles1.1 OES扩展吗?这是我的代码片段

bool ColorBuffer::bind_fbo()
{
    if (m_fbo) {
        // fbo already exist - just bind
        s_gl.glBindFramebufferOES(GL_FRAMEBUFFER_OES, m_fbo);
        return true;
    }

    s_gl.glGenFramebuffersOES(1, &m_fbo);
    s_gl.glBindFramebufferOES(GL_FRAMEBUFFER_OES, m_fbo);
    s_gl.glFramebufferTexture2DOES(GL_FRAMEBUFFER_OES,
                               GL_COLOR_ATTACHMENT0_OES,
                               GL_TEXTURE_2D, m_tex, 0);
    GLenum status = s_gl.glCheckFramebufferStatusOES(GL_FRAMEBUFFER_OES);
    if (status != GL_FRAMEBUFFER_COMPLETE_OES) {
        s_gl.glBindFramebufferOES(GL_FRAMEBUFFER_OES, 0);
        s_gl.glDeleteFramebuffersOES(1, &m_fbo);
        m_fbo = 0;
        return false;
    }

    return true;
}

我需要使用gles 2.x或更高版本重新实现此代码,因为新平台不再支持gles 1.1。

任何人都知道该怎么办?

谢谢, Jiancong

0 个答案:

没有答案