Commit 78477fc0 by apatrick@chromium.org

eglCreateContext checks client version is 2.

I believe we don't support version 1 since we are missing things like the fixed function pipeline. This is motivated by consistency with other EGL implementations, which return a v1 context if the EGL_CONTEXT_CLIENT_VERSION attribute is not specified. Review URL: http://codereview.appspot.com/2760041 git-svn-id: https://angleproject.googlecode.com/svn/trunk@468 736b8ea6-26fd-11df-bfd4-992fa37f6226
parent 9d7fc1db
......@@ -772,6 +772,25 @@ EGLContext __stdcall eglCreateContext(EGLDisplay dpy, EGLConfig config, EGLConte
try
{
// Get the requested client version (default is 1) and check it is two.
EGLint client_version = 1;
for (const EGLint* attribute = attrib_list; attribute[0] != EGL_NONE; attribute += 2)
{
if (attribute[0] == EGL_CONTEXT_CLIENT_VERSION)
{
client_version = attribute[1];
}
else
{
return error(EGL_BAD_ATTRIBUTE, EGL_NO_CONTEXT);
}
}
if (client_version != 2)
{
return error(EGL_BAD_CONFIG, EGL_NO_CONTEXT);
}
egl::Display *display = static_cast<egl::Display*>(dpy);
if (!validate(display, config))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment