PDA

View Full Version : OpenVG VG_NO_CONTEXT_ERROR



sammy
11-11-2011, 02:06 AM
Hi All,

I am relatively new to OpenVG and currently am just experimenting with some code. The following scenario led me to ask this question:

- I am currently working on EFL Port of Webkit in Linux env (ubuntu 11.04)
- spc requirement is to try to enable OpenVG in EFL webkit port.
- I have all the needed libraries installed (EGL/Mesa etc and Amanith VG ).
- When the EGL calls are being made, i am able to creat the pbuffer surface.

--> When i am trying to call vgCreatePath, getting stuck with VG_NO_CONTEXT_ERROR.
I had gone through OpenVG specs, where its mentioned "If no context is current at the time vgGetError is called, the error code VG_NO_CONTEXT_ERROR is returned". I could not get much out of this statement while running the code :( .

Any pointers, links , help would be highly appreciated.

PS: Being new to OpenVG, I may have missed out on providing more relevant information for the problem statement , which I would be more than happy to provide. :?

Thanks,

muratmat
11-13-2011, 06:33 AM
Hi All,

I am relatively new to OpenVG and currently am just experimenting with some code. The following scenario led me to ask this question:

- I am currently working on EFL Port of Webkit in Linux env (ubuntu 11.04)
- spc requirement is to try to enable OpenVG in EFL webkit port.
- I have all the needed libraries installed (EGL/Mesa etc and Amanith VG ).
- When the EGL calls are being made, i am able to creat the pbuffer surface.

--> When i am trying to call vgCreatePath, getting stuck with VG_NO_CONTEXT_ERROR.
I had gone through OpenVG specs, where its mentioned "If no context is current at the time vgGetError is called, the error code VG_NO_CONTEXT_ERROR is returned". I could not get much out of this statement while running the code :( .

Any pointers, links , help would be highly appreciated.

PS: Being new to OpenVG, I may have missed out on providing more relevant information for the problem statement , which I would be more than happy to provide. :?

Thanks,

Hi sammy,

I'm Matteo Muratori, the main coder of AmanithVG.
In order to use AmanithVG GLE, you must:

1) instantiate (and make it current) a valid OpenGL / OpenGL ES context + surface; such surface must "contain" a color buffer and a depth buffer (or stencil buffer). So I suggest you to include the following attributes when you create the pbuffer surface: EGL_BUFFER_SIZE, 32, EGL_DEPTH_SIZE, 24, EGL_STENCIL_SIZE, 8

2) make the GL surface and context current, using eglMakeCurrent

3) initialize AmanithVG GLE driver, creating an OpenVG context + surface:


void *vgContext = NULL;
void *vgSurface = NULL;
VGboolean initOpenVG(const VGint width, const VGint height) {
vgContext = vgPrivContextCreateMZT(NULL);
if (!vgContext)
return VG_FALSE;
vgSurface = vgPrivSurfaceCreateMZT(width, height, VG_FALSE, VG_TRUE);
if (!vgSurface) {
vgPrivContextDestroyMZT(vgContext);
return VG_FALSE;
}
if (vgPrivMakeCurrentMZT(vgContext, vgSurface) == VG_FALSE) {
vgPrivSurfaceDestroyMZT(vgSurface);
vgPrivContextDestroyMZT(vgContext);
return VG_FALSE;
}
return VG_TRUE;
}


The vgPrivMakeCurrentMZT call can fail if your current GL surface has no depth buffer nor stencil buffer attached. In such case, VG_FALSE is returned and every OpenVG function returns VG_NO_CONTEXT_ERROR.
Anyway, if you are going to use AmanithVG in conjunction with Webkit, I would suggest to have a try with AmanithVG SRE, that is more suitable for high quality rendering, and it includes an EGL 1.4 layer too (so you can totally exclude Mesa/OpenGL).

If you need more details, please feel free to contact me via private message.

Kind Regards,
Matteo.