I'm looking at the android ndk opengl es example. Anyway, it has the lines in there:
int[] attrib_list = {EGL_CONTEXT_CLIENT_VERSION, 2, EGL10.EGL_NONE };
EGLContext context = egl.eglCreateContext(display, eglConfig, EGL10.EGL_NO_CONTEXT, attrib_list);
Where EGL_CONTEXT_CLIENT_VERSION is defined as:
private static int EGL_CONTEXT_CLIENT_VERSION = 0x3098;
I've been going over the API for that call, and it says that the last parameter is for the attributes list. But I can't seem to find anything that actually gives attributes you might want to put in there, or even explain the two attributes that the example puts in there. Can anyone tell me what these attributes mean? (Or better yet, also point me to some documentation that explains it).
Thank you
Edit: I just realised that a bit of context would help. The particular sample is in samples/hello-gl2. The file is in the view class, in particular, the ContextFactory static class.
Check the spec, page 43:
attrib list
may beNULL
or empty (first attribute isEGL_NONE
), in which case attributes assume their default values as described below.
EGL_CONTEXT_CLIENT_VERSION
determines which version of an OpenGL ES context to create. An attribute value of1
specifies creation of an OpenGL ES 1.x context. An attribute value of2
specifies creation of an OpenGL ES 2.x context. The default value forEGL_CONTEXT_CLIENT_VERSION
is1
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With