Exemplo n.º 1
0
WebGLRenderbuffer::WebGLRenderbuffer(WebGLContext* webgl)
    : WebGLBindable<RBTarget>()
    , WebGLContextBoundObject(webgl)
    , mPrimaryRB(0)
    , mSecondaryRB(0)
    , mInternalFormat(0)
    , mInternalFormatForGL(0)
    , mImageDataStatus(WebGLImageDataStatus::NoImageData)
{
    mContext->MakeContextCurrent();

    mContext->gl->fGenRenderbuffers(1, &mPrimaryRB);
    if (!SupportsDepthStencil(mContext->gl))
        mContext->gl->fGenRenderbuffers(1, &mSecondaryRB);

    mContext->mRenderbuffers.insertBack(this);
}
Exemplo n.º 2
0
WebGLRenderbuffer::WebGLRenderbuffer(WebGLContext* webgl)
    : WebGLContextBoundObject(webgl)
    , mPrimaryRB(0)
    , mSecondaryRB(0)
    , mFormat(nullptr)
    , mImageDataStatus(WebGLImageDataStatus::NoImageData)
    , mSamples(1)
    , mIsUsingSecondary(false)
#ifdef ANDROID
    , mIsRB(false)
#endif
{
    mContext->MakeContextCurrent();

    mContext->gl->fGenRenderbuffers(1, &mPrimaryRB);
    if (!SupportsDepthStencil(mContext->gl))
        mContext->gl->fGenRenderbuffers(1, &mSecondaryRB);

    mContext->mRenderbuffers.insertBack(this);
}