Results 1 to 2 of 2

Thread: Shared context for background thread loading

  1. #1
    Junior Member
    Join Date
    Mar 2010
    Posts
    2

    Shared context for background thread loading

    Hi,

    I've been trying to get shared context to loading opengl resources in a background thread however I'm can't seems to get it to work.

    Here is what I am doing:

    mEglContextMain = eglCreateContext( mEglDisplay, mEglConfig, EGL_NO_CONTEXT, contextAttribs);

    mEglContextThread = eglCreateContext( mEglDisplay, mEglConfig, mEglContextMain, contextAttribs);

    mEglWindow = eglCreateWindowSurface( mEglDisplay, mEglConfig, nwt, attrib_list );

    mAuxSurface = eglCreatePbufferSurface( mEglDisplay, auxConfig, pbufferAttribs);

    on the main thread, I call:
    eglMakeCurrent( mEglDisplay, mEglWindow, mEglWindow, mEglContextMain );

    on the background loading thread (using std::thread), I call:
    eglMakeCurrent( mEglDisplay, mAuxSurface, mAuxSurface, mEglContextThread);

    The error I'm getting is when I call the make current call on the background thread, the main thread opengl es functions will start to give me an error of INVALID_OPERATION.

    I've managed to get this shared context working on iPhone (xcode) and regular Opengl, but I can't seems to get it to work with the PowerVR Imagination SDK.

    Does anyone have any ideas?

    Thanks.

  2. #2

    Re: Shared context for background thread loading

    AFIK, you cant make current two contexts at a time. Before make current of other context you need to makecurrent(NULL) previous one.

Similar Threads

  1. Replies: 2
    Last Post: 04-26-2010, 08:38 PM
  2. Using bitmaps as a background
    By lucafr in forum OpenGL ES general technical discussions
    Replies: 0
    Last Post: 06-25-2008, 03:00 PM

Posting Permissions

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