1 Reply Latest reply on May 15, 2012 3:30 AM by ianblaire

    GLES SDK: eglCreateContext ignores clientversion

    kphillisjr

      When i was figuring out how to work with OpenGL ES, OpenGL, and EGL using the sdk I found a small bug with the eglCreateContext, and eglBind functions. First off is that the eglCreateContext Function completely ignores the attrib_list of the call.

       

       

      //
      if(!eglBindAPI(EGL_OPENGL_API))
      {
              printf("Could not Bind OpenGL API\n");
              return GL_FALSE;
      }
      
      // Set OpenGL Client Version
      EGLint myRequestedClientVer[3]; 
      myRequestedClientVer[0] = EGL_CONTEXT_CLIENT_VERSION; 
      myRequestedClientVer[1] = 5; 
      myRequestedClientVer[2] = 0;
      
      // Create Context
      EGLContext eglContext;
      eglContext = eglCreateContext(eglDisplay, eglConfig, EGL_NO_CONTEXT, myRequestedClientVer);
      if (eglContext == EGL_NO_CONTEXT){
           printf("Could not create EGL context\n");
           // eglGetError() should return EGL_BAD_ATTRIBUTE
           DestroyNativeWin(nativeDisplay, nativeWin);
           CloseNativeDisplay(nativeDisplay);
           return GL_FALSE;
      }