View Full Version : How can we use same VGPath in multiple threads
09-14-2009, 10:18 PM
I am using OpenVG for Map Rendering. I want to know how can i use the vgPath created in one thread and drawing in another thread. This requirements come because I get the map data in different thread, now if I create the vgPath in that thread, VG_NO_CONTEXT error comes. is it possible to create the vgPath in different thread?
Thanks is advance.
09-15-2009, 09:01 AM
Strange - I thought it should be ok to use them directly... odd.
Anyways, since it's not, create a shared context with the first thread for the second thread (eglCreateContext(display, config, share_context, attribs) and make it current). This will allow you to share resources (like paths) across threads.
That is, if you are using EGL (if not, there may still be something similar available in whatever you're using). If you're not, I don't really know.
09-16-2009, 10:15 PM
Yes, I am using EGL. Also I already tried this thing but when I create the context using eglCreateContext with shared context is not null then it returns into an error EGL_BAD_CONTEXT.
What might be the issue?
09-17-2009, 09:48 AM
The EGL spec says that EGL_BAD_CONTEXT is returned when the share-context is not a valid context of the same client API as the one you're creating. My guess is it's just the driver saying: "I don't support that". Theoretically, it should be working just fine.
Check with your driver vendor to see if they are limiting contexts to only per application, or if they have some other mechanisms to get past that.
Powered by vBulletin® Version 4.2.2 Copyright © 2013 vBulletin Solutions, Inc. All rights reserved.