Esempio n. 1
0
Renderbuffer *ResourceManager::checkRenderbufferAllocation(rx::GLImplFactory *factory,
                                                           GLuint handle)
{
    if (handle == 0)
    {
        return nullptr;
    }

    auto renderbufferMapIt = mRenderbufferMap.find(handle);
    bool handleAllocated   = (renderbufferMapIt != mRenderbufferMap.end());

    if (handleAllocated && renderbufferMapIt->second != nullptr)
    {
        return renderbufferMapIt->second;
    }

    Renderbuffer *renderbuffer = new Renderbuffer(factory->createRenderbuffer(), handle);
    renderbuffer->addRef();

    if (handleAllocated)
    {
        renderbufferMapIt->second = renderbuffer;
    }
    else
    {
        mRenderbufferHandleAllocator.reserve(handle);
        mRenderbufferMap[handle] = renderbuffer;
    }

    return renderbuffer;
}
Esempio n. 2
0
void ResourceManager::checkRenderbufferAllocation(GLuint handle)
{
    if (handle != 0)
    {
        auto renderbufferMapIt = mRenderbufferMap.find(handle);
        bool handleAllocated = (renderbufferMapIt != mRenderbufferMap.end());

        if (handleAllocated && renderbufferMapIt->second != nullptr)
        {
            return;
        }

        Renderbuffer *renderbuffer = new Renderbuffer(mFactory->createRenderbuffer(), handle);
        renderbuffer->addRef();

        if (handleAllocated)
        {
            renderbufferMapIt->second = renderbuffer;
        }
        else
        {
            mRenderbufferHandleAllocator.reserve(handle);
            mRenderbufferMap[handle] = renderbuffer;
        }
    }
}
Esempio n. 3
0
void ResourceManager::checkRenderbufferAllocation(GLuint renderbuffer)
{
    if (renderbuffer != 0 && !getRenderbuffer(renderbuffer))
    {
        Renderbuffer *renderbufferObject = new Renderbuffer(mRenderer->createRenderbuffer(), renderbuffer);
        mRenderbufferMap[renderbuffer] = renderbufferObject;
        renderbufferObject->addRef();
    }
}
void ResourceManager::checkRenderbufferAllocation(GLuint renderbuffer)
{
    if (renderbuffer != 0 && !getRenderbuffer(renderbuffer))
    {
        Renderbuffer *renderbufferObject = new Renderbuffer(mRenderer, renderbuffer, new Colorbuffer(mRenderer, 0, 0, GL_RGBA4, 0));
        mRenderbufferMap[renderbuffer] = renderbufferObject;
        renderbufferObject->addRef();
    }
}
Esempio n. 5
0
// static
Renderbuffer *RenderbufferManager::AllocateNewObject(rx::GLImplFactory *factory, GLuint handle)
{
    Renderbuffer *renderbuffer = new Renderbuffer(factory->createRenderbuffer(), handle);
    renderbuffer->addRef();
    return renderbuffer;
}