EGL_BAD_ALLOC Error

This topic contains 1 reply, has 1 voice, and was last updated by  wangsheng 7 years, 10 months ago.

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #30009

    wangsheng
    Member

    i want to Draw 2D in my windows , so i  use the function Delete gles surfase(eglDestroySurface) , but when return 3D Draw,  i use the functon recreate the surface is failed(eglCreateWindowSurface), the error code is EGL_BAD_ALLOC. what can i do now?

    thanks!
    #33607

    wangsheng
    Member

     void DeleteSurface(void)
     {
      if(m_eglSurface != EGL_NO_SURFACE)
      {
       glFlush();
       eglMakeCurrent(m_eglDisplay ,EGL_NO_SURFACE ,EGL_NO_SURFACE , EGL_NO_CONTEXT);
       eglDestroySurface(m_eglDisplay,m_eglSurface);
       m_eglSurface = EGL_NO_SURFACE;
      }
     }

     void ResetSurface(void)
     {
      if(m_eglSurface == EGL_NO_SURFACE)
      {
       m_eglSurface = eglCreateWindowSurface(m_eglDisplay,m_eglConfig , m_nativeWindowType , NULL);
       eglMakeCurrent(m_eglDisplay ,m_eglSurface ,m_eglSurface , m_eglContext);
      }
     }

Viewing 2 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic.