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


C++ Attachment::SetRenderbuffer方法代码示例

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


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

示例1: if

void
WebGLFramebuffer::FramebufferRenderbuffer(GLenum target,
                                          GLenum attachment,
                                          GLenum rbtarget,
                                          WebGLRenderbuffer* wrb)
{
    MOZ_ASSERT(mContext->mBoundFramebuffer == this);

    if (!mContext->ValidateObjectAllowNull("framebufferRenderbuffer: renderbuffer", wrb))
        return;

    if (target != LOCAL_GL_FRAMEBUFFER)
        return mContext->ErrorInvalidEnumInfo("framebufferRenderbuffer: target", target);

    if (rbtarget != LOCAL_GL_RENDERBUFFER)
        return mContext->ErrorInvalidEnumInfo("framebufferRenderbuffer: renderbuffer target:", rbtarget);

    /* Get the requested attachment. If result is NULL, attachment is
     * invalid and an error is generated.
     *
     * Don't use GetAttachment(...) here because it opt builds it
     * returns mColorAttachment[0] for invalid attachment, which we
     * really don't want to mess with.
     */
    Attachment* a = GetAttachmentOrNull(attachment);
    if (!a)
        return; // Error generated internally to GetAttachmentOrNull.

    /* Invalidate cached framebuffer status and inform texture of it's
     * new attachment
     */
    mStatus = 0;
    // Detach current
    if (a->Texture())
        a->Texture()->DetachFrom(this, attachment);
    else if (a->Renderbuffer())
        a->Renderbuffer()->DetachFrom(this, attachment);

    // Attach new
    if (wrb)
        wrb->AttachTo(this, attachment);

    a->SetRenderbuffer(wrb);
}
开发者ID:MSOpenTech,项目名称:Spidermonkey,代码行数:44,代码来源:WebGLFramebuffer.cpp

示例2: if

void
WebGLFramebuffer::FramebufferRenderbuffer(FBAttachment attachPoint,
                                          RBTarget rbtarget,
                                          WebGLRenderbuffer* rb)
{
    MOZ_ASSERT(mContext->mBoundDrawFramebuffer == this ||
               mContext->mBoundReadFramebuffer == this);

    if (!mContext->ValidateObjectAllowNull("framebufferRenderbuffer: renderbuffer",
                                           rb))
    {
        return;
    }

    /* Get the requested attachment. If result is NULL, attachment is invalid
     * and an error is generated.
     *
     * Don't use GetAttachment(...) here because it opt builds it returns
     * mColorAttachment[0] for invalid attachment, which we really don't want to
     * mess with.
     */
    Attachment* attachment = GetAttachmentOrNull(attachPoint);
    if (!attachment)
        return; // Error generated internally to GetAttachmentOrNull.

    // Invalidate cached framebuffer status and inform texture of its new
    // attachment.
    mStatus = 0;

    // Detach current:
    if (attachment->Texture())
        attachment->Texture()->DetachFrom(this, attachPoint);
    else if (attachment->Renderbuffer())
        attachment->Renderbuffer()->DetachFrom(this, attachPoint);

    // Attach new:
    if (rb)
        rb->AttachTo(this, attachPoint);

    attachment->SetRenderbuffer(rb);
}
开发者ID:,项目名称:,代码行数:41,代码来源:


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