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


C++ Problem::Shutdown方法代码示例

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


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

示例1: NullProblem

// --------------------------------------------------------------------------------------------------------------------
// --------------------------------------------------------------------------------------------------------------------
// --------------------------------------------------------------------------------------------------------------------
ProblemFactory::ProblemFactory(bool _skipInit)
{
    Problem* newProb = nullptr;
    // Null
    newProb = new NullProblem();
    if (_skipInit || newProb->Init()) {
        if (!_skipInit) {
            newProb->Shutdown();
        }
        mProblems.push_back(newProb);
        mSolutions[mProblems.back()->GetName()].push_back(new NullSolution());
    } else {
        newProb->Shutdown();
        SafeDelete(newProb);
        console::error("Unable to create the Null Problem--exiting.");
    }

    // DynamicStreaming
    newProb = new DynamicStreamingProblem();
    if (_skipInit || newProb->Init()) {
        if (!_skipInit) {
            newProb->Shutdown();
        }
        mProblems.push_back(newProb);
        mSolutions[mProblems.back()->GetName()].push_back(new DynamicStreamingGLBufferSubData());
        mSolutions[mProblems.back()->GetName()].push_back(new DynamicStreamingGLMapUnsynchronized());
        mSolutions[mProblems.back()->GetName()].push_back(new DynamicStreamingGLMapPersistent());
        #if WITH_D3D11
            mSolutions[mProblems.back()->GetName()].push_back(new DynamicStreamingD3D11MapNoOverwrite());
            mSolutions[mProblems.back()->GetName()].push_back(new DynamicStreamingD3D11UpdateSubresource());
        #endif
    } else {
        newProb->Shutdown();
        SafeDelete(newProb);
    }

    // UntexturedObjects
    newProb = new UntexturedObjectsProblem();
    if (_skipInit || newProb->Init()) {
        if (!_skipInit) {
            newProb->Shutdown();
        }
        mProblems.push_back(newProb);
        mSolutions[mProblems.back()->GetName()].push_back(new UntexturedObjectsGLUniform());
        mSolutions[mProblems.back()->GetName()].push_back(new UntexturedObjectsGLDrawLoop());
        mSolutions[mProblems.back()->GetName()].push_back(new UntexturedObjectsGLMultiDraw(true));
        mSolutions[mProblems.back()->GetName()].push_back(new UntexturedObjectsGLMultiDraw(false));
        mSolutions[mProblems.back()->GetName()].push_back(new UntexturedObjectsGLMultiDrawBuffer(true));
        mSolutions[mProblems.back()->GetName()].push_back(new UntexturedObjectsGLMultiDrawBuffer(false));
        mSolutions[mProblems.back()->GetName()].push_back(new UntexturedObjectsGLBindless());
        mSolutions[mProblems.back()->GetName()].push_back(new UntexturedObjectsGLBindlessIndirect());
        mSolutions[mProblems.back()->GetName()].push_back(new UntexturedObjectsGLBufferRange());
        mSolutions[mProblems.back()->GetName()].push_back(new UntexturedObjectsGLBufferStorage(true));
        mSolutions[mProblems.back()->GetName()].push_back(new UntexturedObjectsGLBufferStorage(false));
        mSolutions[mProblems.back()->GetName()].push_back(new UntexturedObjectsGLDynamicBuffer());
        mSolutions[mProblems.back()->GetName()].push_back(new UntexturedObjectsGLMapUnsynchronized());
        mSolutions[mProblems.back()->GetName()].push_back(new UntexturedObjectsGLMapPersistent());
        mSolutions[mProblems.back()->GetName()].push_back(new UntexturedObjectsGLTexCoord());
        #if WITH_D3D11
            mSolutions[mProblems.back()->GetName()].push_back(new UntexturedObjectsD3D11Naive());
        #endif
    } else {
        newProb->Shutdown();
        SafeDelete(newProb);
    }

    // Textured Quads
    newProb = new TexturedQuadsProblem();
    if (_skipInit || newProb->Init()) {
        if (!_skipInit) {
            newProb->Shutdown();
        }
        mProblems.push_back(newProb);
        mSolutions[mProblems.back()->GetName()].push_back(new TexturedQuadsGLBindless());
        mSolutions[mProblems.back()->GetName()].push_back(new TexturedQuadsGLBindlessMultiDraw());
        mSolutions[mProblems.back()->GetName()].push_back(new TexturedQuadsGLNaive());
        mSolutions[mProblems.back()->GetName()].push_back(new TexturedQuadsGLNaiveUniform());
        mSolutions[mProblems.back()->GetName()].push_back(new TexturedQuadsGLNoTex());
        mSolutions[mProblems.back()->GetName()].push_back(new TexturedQuadsGLNoTexUniform());
        mSolutions[mProblems.back()->GetName()].push_back(new TexturedQuadsGLSparseBindlessTextureArray());
        mSolutions[mProblems.back()->GetName()].push_back(new TexturedQuadsGLSparseBindlessTextureArrayMultiDraw(true));
        mSolutions[mProblems.back()->GetName()].push_back(new TexturedQuadsGLSparseBindlessTextureArrayMultiDraw(false));
        mSolutions[mProblems.back()->GetName()].push_back(new TexturedQuadsGLTextureArray());
        mSolutions[mProblems.back()->GetName()].push_back(new TexturedQuadsGLTextureArrayUniform());
        mSolutions[mProblems.back()->GetName()].push_back(new TexturedQuadsGLTextureArrayMultiDraw(true));
        mSolutions[mProblems.back()->GetName()].push_back(new TexturedQuadsGLTextureArrayMultiDraw(false));
        mSolutions[mProblems.back()->GetName()].push_back(new TexturedQuadsGLTextureArrayMultiDrawBuffer(true));
        mSolutions[mProblems.back()->GetName()].push_back(new TexturedQuadsGLTextureArrayMultiDrawBuffer(false));
        #if WITH_D3D11
            mSolutions[mProblems.back()->GetName()].push_back(new TexturedQuadsD3D11Naive());
        #endif

    } else {
        newProb->Shutdown();
        SafeDelete(newProb);
    }
}
开发者ID:ChickenEggSolutions,项目名称:apitest,代码行数:100,代码来源:factory.cpp


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