Results 1 to 4 of 4

Thread: How interchangeable is OpenGL and OpenVG

  1. #1

    How interchangeable is OpenGL and OpenVG

    Hi Everyone,
    I am relatively new to OpenVG and I am just experimenting with some code. The following code is what prompted me to ask this question:

    glPixelStorei(GL_PACK_ALIGNMENT,1);
    vgReadPixels(buf1, WINDSIZEX*4, VG_sRGBA_8888, 0, 0, WINDSIZEX, WINDSIZEY);

    Is this valid? I would assume not because i'm guessing vg has its own statemachine? Is there a vg equivalent for most / all OpenGL functions? e.g.

    vgPixelStorei(GL_PACK_ALIGNMENT, 1);

    Are there any good resources you could point me to?

    I appreciate any information you can give me!

  2. #2

    Re: How interchangeable is OpenGL and OpenVG

    Ok so for the example posted:

    glPixelStorei(GL_PACK_ALIGNMENT,1);
    vgReadPixels(buf1, WINDSIZEX*4, VG_sRGBA_8888, 0, 0, WINDSIZEX, WINDSIZEY);

    I now see that readpixels takes the equivalent data so i assume:

    vgReadPixels(buf1, WINDSIZEX , VG_sRGBA_8888, 0, 0, WINDSIZEX, WINDSIZEY);

    would give me the same alignment?

  3. #3
    Senior Member
    Join Date
    Feb 2006
    Posts
    115

    Re: How interchangeable is OpenGL and OpenVG

    It wont work because, as you say, it is a separate state machine. Both Open GL and Open VG need to have their own contexts, and 2 contexts cannot be active at the same time. In GL contexts you can only use GL commands, and VG contexts only VG commands. There are various mechanisms for sharing things between Open GL and Open VG and most of them are located in the surface management standard EGL (calls like eglCreateSurfaceFromClientBuffer() - I think that's what it's called if I recall correctly [there are others too]).

    Otherwise, yes, vgReadPixels() and glReadPixels() work pretty much in the exact same way. Transferring data from one APi to the other via ReadPixels should be used only as your last resort though (if the other functions are nor present or work correctly), as it typically transfers data from video memory to CPU memory and back again.

  4. #4

    Re: How interchangeable is OpenGL and OpenVG

    Thank you for confirming that, its very helpful to have it clarified and also thank you for the information on how they do work together. I Appreciate it.

    -Thanks,
    Chris

Similar Threads

  1. Using OpenGL ES with OpenVG
    By jrabbani in forum OpenGL ES general technical discussions
    Replies: 0
    Last Post: 11-29-2010, 12:29 AM
  2. OpenGL ES 2.0 + OpenVG 1.1
    By jrabbani in forum OpenVG and VGU
    Replies: 0
    Last Post: 11-24-2010, 10:44 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
  •