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


C++ ContextFormat::stereo方法代码示例

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


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

示例1: verifyPixelFormat

bool ContextFormat::verifyPixelFormat(
    const ContextFormat & requested
    , const ContextFormat & created)
{
    std::vector<std::string> issues;

    const bool sameSwapBehaviors(requested.swapBehavior() == created.swapBehavior());

    if (!sameSwapBehaviors)
    {
        warning() << "Swap behavior mismatch for the current context: "
            << swapBehaviorString(requested.swapBehavior()) << " requested, "
            << swapBehaviorString(created.swapBehavior()) << " created.";
    }

    if (requested.depthBufferSize())
    {
        if (!created.depthBufferSize())
            issues.push_back("- Depth Buffer requested, but none created.");
        else
            verifyBufferSize(requested.depthBufferSize(), created.depthBufferSize()
            , "- Depth Buffer", issues);
    }

    verifyBufferSize(requested.redBufferSize(), created.redBufferSize()
        , "- Red Buffer", issues);
    verifyBufferSize(requested.greenBufferSize(), created.greenBufferSize()
        , "- Green Buffer", issues);
    verifyBufferSize(requested.blueBufferSize(), created.blueBufferSize()
        , "- Blue Buffer", issues);
    verifyBufferSize(requested.alphaBufferSize(), created.alphaBufferSize()
        , "- Alpha Buffer", issues);

    if (requested.stencilBufferSize())
    {
        if (!created.stencilBufferSize())
            issues.push_back("- Stencil Buffer requested, but none created.");
        else
            verifyBufferSize(requested.stencilBufferSize(), created.stencilBufferSize()
            , "- Stencil Buffer", issues);
    }

    if (requested.stereo() && !created.stereo())
        issues.push_back("- Stereo Buffering requested, but not initialized.");

    if (requested.samples())
    {
        if (!created.samples())
            issues.push_back("- Sample Buffers requested, but none initialized.");
        else
            verifyBufferSize(requested.samples(), created.samples(), "- Samples ", issues);
    }

    if (issues.empty())
        return true;

    warning() << "Pixelformat mismatch for the current context:";
    for (const std::string & issue : issues)
        warning() << issue;

    return false;
}
开发者ID:PFischbeck,项目名称:globjects,代码行数:62,代码来源:ContextFormat.cpp


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