aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorJukka Jylänki <jujjyl@gmail.com>2013-12-19 23:58:45 +0200
committerJukka Jylänki <jujjyl@gmail.com>2013-12-20 11:21:19 +0200
commitc1f5a5b30a53f22e495de4313c81496431b2e759 (patch)
tree2a8ff59df33d644439e97dbb3bf4728a29d9e6c9 /tests
parent68bc17077e0919d369fe898631f7a2108487534a (diff)
Make EGL function eglCreateContext spec-conformant and actually read the EGL_CONTEXT_CLIENT_VERSION field when creating a context. Require the version number 2, since WebGL1 maps to GLES2.
Diffstat (limited to 'tests')
-rw-r--r--tests/test_egl.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/tests/test_egl.c b/tests/test_egl.c
index 5864a797..d66949d0 100644
--- a/tests/test_egl.c
+++ b/tests/test_egl.c
@@ -37,12 +37,21 @@ int main(int argc, char *argv[])
assert(eglGetError() == EGL_SUCCESS);
assert(surface != 0);
+ // WebGL maps to GLES2. GLES1 is not supported.
+ EGLint contextAttribsOld[] =
+ {
+ EGL_CONTEXT_CLIENT_VERSION, 1,
+ EGL_NONE
+ };
+ EGLContext context = eglCreateContext(display, config, NULL, contextAttribsOld);
+ assert(eglGetError() != EGL_SUCCESS);
+
EGLint contextAttribs[] =
{
EGL_CONTEXT_CLIENT_VERSION, 2,
EGL_NONE
};
- EGLContext context = eglCreateContext(display, config, NULL, contextAttribs);
+ context = eglCreateContext(display, config, NULL, contextAttribs);
assert(eglGetError() == EGL_SUCCESS);
assert(context != 0);