Results 1 to 3 of 3

Thread: After eglInitialize(), can I create window multiple times?

  1. #1
    Junior Member
    Join Date
    Apr 2010
    Posts
    1

    After eglInitialize(), can I create window multiple times?

    Hi, All,

    I have an application that repeatedly creates OpenKODE window and does something
    and then destories it. The window destroy sequence is:
    -----------------------------------
    eglMakeCurrent(m_redInfo->egl_disp, EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT);
    eglDestroyContext(m_redInfo->egl_disp, m_redInfo->egl_ctx);
    eglDestroySurface(m_redInfo->egl_disp, m_redInfo->egl_surf);
    kdDestroyWindow(m_redInfo->kd_win);
    ------------------------------------

    However, it seems there is resourcce leak. Each loop, the process size increase.
    After about 20 rounds of loop, the process hangs inside eglSwapBuffers().

    If I destroy the kdWindow as this:
    ---------------------------------
    eglMakeCurrent(m_redInfo->egl_disp, EGL_NO_SURFACE, EGL_NO_SURFACE,
    EGL_NO_CONTEXT);
    eglDestroyContext(m_redInfo->egl_disp, m_redInfo->egl_ctx);
    eglDestroySurface(m_redInfo->egl_disp, m_redInfo->egl_surf);
    kdDestroyWindow(m_redInfo->kd_win);
    eglTerminate(m_redInfo->egl_disp);
    eglReleaseThread();
    ---------------------------------
    And call eglInitialize() again the second time, it still does not work.

    Please inform what is the correct sequence to start kdWindow multiples with egl.

  2. #2
    Member
    Join Date
    Sep 2003
    Location
    Silicon Valley
    Posts
    57

    Re: After eglInitialize(), can I create window multiple times?

    Hi,

    It's hard to be sure from this level of detail, but it sounds like this might be a bug in the OpenKODE or EGL implementation you're using. If there is an implementation-specific developer forum for those, you might get a better response asking there and specifying the driver(s) and device you're using.

    The only general comment I can think of is that EGL resources are not always released immediately, they are (effectively) reference-counted and other parts of the system could conceivably have a reference on something that you're attempting to destroy (mapped window that doesn't get unmapped, say? But I'm stretching for ideas here.) Sorry not to be more helpful.
    Jon Leech
    EGL & OpenGL Specification Editor / OpenGL ARB Ecosystem TSG Chair / Khronos API Registrar

  3. #3
    Junior Member
    Join Date
    Oct 2011
    Posts
    1

    Re: After eglInitialize(), can I create window multiple time

    Thanks, guys, for such a detailed reply. I found much useful things there that helped me to find the solution to my issue!!!

Similar Threads

  1. Can I only Create a Pbuffer without create a window surface
    By sunim in forum Cross API and window system integration
    Replies: 3
    Last Post: 02-04-2012, 12:14 PM
  2. Modifying a texture multiple times during one frame.
    By Unarmed in forum OpenGL ES general technical discussions
    Replies: 2
    Last Post: 10-27-2010, 05:06 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •