Results 1 to 6 of 6

Thread: eglBindApi scope.

  1. #1
    Nils Pipenbrinck
    Guest

    eglBindApi scope.

    Just a minor question:

    I assume that eglBindApi sets the API for the current context, is that right? So a eglBindApi before a valid eglMakeCurrent will always return an error.

    I'm a bit worried because the only source that calls eglBindApi is from the OpenVG reference code, and it calls eglBindApi right after eglInitialize (which does not make much sense unless the current API is per thread, not per context).

    Could someone please shed some light on this?

    Thanks,
    Nils

  2. #2
    Nils Pipenbrinck
    Guest
    btw - I just read this powerpoint from the 2006 siggraph and they call eglBindApi right after eglInitialize as well.


    Siggraph talk

    Does this make sense?

  3. #3
    oddhack
    Guest

    Re: eglBindApi scope.

    Quote Originally Posted by Nils Pipenbrinck
    Just a minor question:

    I assume that eglBindApi sets the API for the current context, is that right? So a eglBindApi before a valid eglMakeCurrent will always return an error.
    eglBindAPI just sets some global state, the "current rendering API". It has nothing to do with the current context(s), and you can call it at any time. The current rendering API is used by other calls that need to know which client API is being operated on. This is admittedly, ugly. EGL was originally specified with only one client API in mind, and supporting more than one required either a new set of calls with an additional parameter, or a global value like this. As the spec says:

    Applications using multiple client APIs are responsible for ensuring the current rendering API is correct before calling the functions eglCreateContext, eglGetCurrentContext, eglGetCurrentDisplay, eglGetCurrentSurface, eglMakeCurrent (when its ctx parameter is EGL_NO_CONTEXT), eglWaitClient, or eglWaitNative.

  4. #4
    binoymvdas
    Guest

    Re: eglBindApi scope.

    I think its very old thread....but anyone can suggest me the right way to do a switch between OPENVG and OPENGLES rendering using the same EGL surface, that will be helpful for my prgrm...
    i tried to do like this
    1 Create EGL surface
    2 Create OpenVG context
    3 Create OpenGL ES context
    4 Make OpenVG context current
    5 Render OpenVG drawings
    6 call VGFinish
    7 Make OpenGL ES context current to the same surface
    8 Render OpenGL ES drawings
    9 Call EGLSwapBuffer
    but it doesn't give any result and application crashes....can any one suggest the right method...? thanks n advance....

  5. #5
    binoymvdas
    Guest

    Re: eglBindApi scope.

    DO I need to add a EGLBindApi function before rendering....? if yes where is the right place to add it.....

  6. #6
    jpilon
    Guest

    Re: eglBindApi scope.

    Before creating an EGL context is probably a good spot.

Similar Threads

  1. quicksort on program scope : -36 error
    By wrx in forum OpenCL - parallel programming of heterogeneous systems
    Replies: 5
    Last Post: 05-02-2011, 09:26 AM
  2. OpenCL : scope of application
    By Frizz in forum OpenCL - parallel programming of heterogeneous systems
    Replies: 0
    Last Post: 12-06-2010, 02:21 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
  •