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