本文整理汇总了C++中AttributeMap::insert方法的典型用法代码示例。如果您正苦于以下问题:C++ AttributeMap::insert方法的具体用法?C++ AttributeMap::insert怎么用?C++ AttributeMap::insert使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AttributeMap
的用法示例。
在下文中一共展示了AttributeMap::insert方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: CreateFromAttribArray
// static
AttributeMap AttributeMap::CreateFromAttribArray(const EGLAttrib *attributes)
{
AttributeMap map;
if (attributes)
{
for (const EGLAttrib *curAttrib = attributes; curAttrib[0] != EGL_NONE; curAttrib += 2)
{
map.insert(curAttrib[0], curAttrib[1]);
}
}
return map;
}
示例2: CreateFromIntArray
// static
AttributeMap AttributeMap::CreateFromIntArray(const EGLint *attributes)
{
AttributeMap map;
if (attributes)
{
for (const EGLint *curAttrib = attributes; curAttrib[0] != EGL_NONE; curAttrib += 2)
{
map.insert(static_cast<EGLAttrib>(curAttrib[0]), static_cast<EGLAttrib>(curAttrib[1]));
}
}
return map;
}
示例3: GetPlatformDisplayEXT
//.........这里部分代码省略.........
case EGL_ANGLE_DISPLAY_ALLOW_RENDER_TO_BACK_BUFFER:
ERR("EGL_ANGLE_DISPLAY_ALLOW_RENDER_TO_BACK_BUFFER is deprecated, please use"
"EGL_EXPERIMENTAL_PRESENT_PATH_ANGLE.");
switch (curAttrib[1])
{
case EGL_FALSE:
case EGL_TRUE:
break;
default:
SetGlobalError(egl::Error(EGL_SUCCESS));
return EGL_NO_DISPLAY;
}
foundRenderToBackbuffer = true;
requestedAllowRenderToBackBuffer = (curAttrib[1] == EGL_TRUE);
break;
default:
break;
}
}
}
if (!majorVersionSpecified && minorVersionSpecified)
{
SetGlobalError(Error(EGL_BAD_ATTRIBUTE));
return EGL_NO_DISPLAY;
}
if (deviceType == EGL_PLATFORM_ANGLE_DEVICE_TYPE_WARP_ANGLE &&
platformType != EGL_PLATFORM_ANGLE_TYPE_D3D11_ANGLE)
{
SetGlobalError(
Error(EGL_BAD_ATTRIBUTE,
"EGL_PLATFORM_ANGLE_DEVICE_TYPE_WARP_ANGLE requires a device type of "
"EGL_PLATFORM_ANGLE_TYPE_D3D11_ANGLE."));
return EGL_NO_DISPLAY;
}
if (enableAutoTrimSpecified && platformType != EGL_PLATFORM_ANGLE_TYPE_D3D11_ANGLE)
{
SetGlobalError(
Error(EGL_BAD_ATTRIBUTE,
"EGL_PLATFORM_ANGLE_ENABLE_AUTOMATIC_TRIM_ANGLE requires a device type of "
"EGL_PLATFORM_ANGLE_TYPE_D3D11_ANGLE."));
return EGL_NO_DISPLAY;
}
if (presentPathSpecified && platformType != EGL_PLATFORM_ANGLE_TYPE_D3D11_ANGLE)
{
SetGlobalError(Error(EGL_BAD_ATTRIBUTE,
"EGL_EXPERIMENTAL_PRESENT_PATH_ANGLE requires a device type of "
"EGL_PLATFORM_ANGLE_TYPE_D3D11_ANGLE."));
return EGL_NO_DISPLAY;
}
if (deviceTypeSpecified && platformType != EGL_PLATFORM_ANGLE_TYPE_D3D9_ANGLE &&
platformType != EGL_PLATFORM_ANGLE_TYPE_D3D11_ANGLE)
{
SetGlobalError(
Error(EGL_BAD_ATTRIBUTE,
"EGL_PLATFORM_ANGLE_DEVICE_TYPE_ANGLE requires a device type of "
"EGL_PLATFORM_ANGLE_TYPE_D3D9_ANGLE or EGL_PLATFORM_ANGLE_TYPE_D3D9_ANGLE."));
return EGL_NO_DISPLAY;
}
AttributeMap attribMap = AttributeMap(attrib_list);
if (requestedAllowRenderToBackBuffer)
{
// Redirect EGL_ANGLE_DISPLAY_ALLOW_RENDER_TO_BACK_BUFFER to
// EGL_PLATFORM_ANGLE_EXPERIMENTAL_DIRECT_RENDERING for backcompat
attribMap.insert(EGL_EXPERIMENTAL_PRESENT_PATH_ANGLE, EGL_EXPERIMENTAL_PRESENT_PATH_FAST_ANGLE);
}
SetGlobalError(Error(EGL_SUCCESS));
return Display::GetDisplayFromAttribs(native_display, attribMap);
}
else if (platform == EGL_PLATFORM_DEVICE_EXT)
{
Device *eglDevice = reinterpret_cast<Device *>(native_display);
if (eglDevice == nullptr || !Device::IsValidDevice(eglDevice))
{
SetGlobalError(Error(EGL_BAD_ATTRIBUTE,
"native_display should be a valid EGL device if platform equals "
"EGL_PLATFORM_DEVICE_EXT"));
return EGL_NO_DISPLAY;
}
SetGlobalError(Error(EGL_SUCCESS));
return Display::GetDisplayFromDevice(native_display);
}
else
{
UNREACHABLE();
return EGL_NO_DISPLAY;
}
}