当前位置: 首页>>代码示例>>C++>>正文


C++ GLContext::fFramebufferTexture2D方法代码示例

本文整理汇总了C++中GLContext::fFramebufferTexture2D方法的典型用法代码示例。如果您正苦于以下问题:C++ GLContext::fFramebufferTexture2D方法的具体用法?C++ GLContext::fFramebufferTexture2D怎么用?C++ GLContext::fFramebufferTexture2D使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在GLContext的用法示例。


在下文中一共展示了GLContext::fFramebufferTexture2D方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1:

void
GLBlitTextureImageHelper::SetBlitFramebufferForDestTexture(GLuint aTexture)
{
    GLContext *gl = mCompositor->gl();
    if (!mBlitFramebuffer) {
        gl->fGenFramebuffers(1, &mBlitFramebuffer);
    }

    gl->fBindFramebuffer(LOCAL_GL_FRAMEBUFFER, mBlitFramebuffer);
    gl->fFramebufferTexture2D(LOCAL_GL_FRAMEBUFFER,
                               LOCAL_GL_COLOR_ATTACHMENT0,
                               LOCAL_GL_TEXTURE_2D,
                               aTexture,
                               0);

    GLenum result = gl->fCheckFramebufferStatus(LOCAL_GL_FRAMEBUFFER);
    if (aTexture && (result != LOCAL_GL_FRAMEBUFFER_COMPLETE)) {
        nsAutoCString msg;
        msg.AppendLiteral("Framebuffer not complete -- error 0x");
        msg.AppendInt(result, 16);
        // Note: if you are hitting this, it is likely that
        // your texture is not texture complete -- that is, you
        // allocated a texture name, but didn't actually define its
        // size via a call to TexImage2D.
        NS_RUNTIMEABORT(msg.get());
    }
}
开发者ID:msliu,项目名称:gecko-dev,代码行数:27,代码来源:GLBlitTextureImageHelper.cpp

示例2: Texture

void
WebGLFramebuffer::Attachment::FinalizeAttachment(GLenum attachmentLoc) const {
    if (Texture()) {
        GLContext* gl = Texture()->Context()->gl;
        if (attachmentLoc == LOCAL_GL_DEPTH_STENCIL_ATTACHMENT) {
            gl->fFramebufferTexture2D(LOCAL_GL_FRAMEBUFFER, LOCAL_GL_DEPTH_ATTACHMENT,
                                      TexImageTarget(), Texture()->GLName(), TexImageLevel());
            gl->fFramebufferTexture2D(LOCAL_GL_FRAMEBUFFER, LOCAL_GL_STENCIL_ATTACHMENT,
                                      TexImageTarget(), Texture()->GLName(), TexImageLevel());
        } else {
            gl->fFramebufferTexture2D(LOCAL_GL_FRAMEBUFFER, attachmentLoc,
                                      TexImageTarget(), Texture()->GLName(), TexImageLevel());
        }
        return;
    }

    if (Renderbuffer()) {
        Renderbuffer()->FramebufferRenderbuffer(attachmentLoc);
        return;
    }

    // Neither?
    MOZ_ASSERT(false, "FB attachment without a tex or RB.");
}
开发者ID:armikhael,项目名称:cunaguaro,代码行数:24,代码来源:WebGLFramebuffer.cpp


注:本文中的GLContext::fFramebufferTexture2D方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。