Image may be NSFW.
Clik here to view.Short answer: To initialize your Windows Store App for OpenGL ES using ANGLE, we highly recommend using our Visual Studio templates. These templates perform all of the OpenGL ES API calls necessary to initialize your Windows Store app on any supported hardware, ranging from desktop PCs to Surface RTs and Windows Phones.
Long answer: By default, EGL APIs such as eglGetDisplay do not expose D3D11 Feature Level 9. We have collaborated with Google to design a mechanism to expose D3D11 Feature Level 9 to an app when it specifically requests it via the ANGLE extension procedure eglGetPlatformDisplayEXT.
Here’s a snippet of code showing how to initialize an EGL display to D3D11 Feature Level 9.3:
constEGLint displayAttributes[] =
{
EGL_PLATFORM_ANGLE_TYPE_ANGLE, EGL_PLATFORM_ANGLE_TYPE_D3D11_ANGLE,
EGL_PLATFORM_ANGLE_MAX_VERSION_MAJOR_ANGLE, 9,
EGL_PLATFORM_ANGLE_MAX_VERSION_MINOR_ANGLE, 3,
EGL_NONE,
};
PFNEGLGETPLATFORMDISPLAYEXTPROC eglGetPlatformDisplayEXT = reinterpret_cast<PFNEGLGETPLATFORMDISPLAYEXTPROC>(eglGetProcAddress("eglGetPlatformDisplayEXT"));
if (!eglGetPlatformDisplayEXT)
{
throwException::CreateException(E_FAIL, L"Failed to get function eglGetPlatformDisplayEXT");
}
mEglDisplay = eglGetPlatformDisplayEXT(EGL_PLATFORM_ANGLE_ANGLE, EGL_DEFAULT_DISPLAY, displayAttributes);
if (mEglDisplay == EGL_NO_DISPLAY)
{
throwException::CreateException(E_FAIL, L"Failed to get EGL display");
}
if (eglInitialize(mEglDisplay, NULL, NULL) == EGL_FALSE)
{
throwException::CreateException(E_FAIL, L"Failed to initialize EGL");
}
To get Feature Level 9.3, the EGL_PLATFORM_ANGLE_MAX_VERSION_MAJOR_ANGLE attribute has been set to 9 and the EGL_PLATFORM_ANGLE_MAX_VERSION_MINOR_ANGLE attribute has been set to 3.
The ms-master branch of ANGLE supports D3D11 Feature Levels 9.3 and above. To initialize EGL on a platform whose default GPU doesn’t support 9.3 or above (such as a Surface RT), you must use WARP. WARP is a fully-featured software rasterizer for D3D11 which supports D3D11 Feature Level 11_0. To use WARP, you should set the EGL_PLATFORM_ANGLE_DEVICE_TYPE_ANGLE ATTRIBUTE to EGL_PLATFORM_ANGLE_DEVICE_TYPE_WARP_ANGLE in your display attributes list.
Austin Kinross
Software Engineer