"We offer new support options and therefor the forums are now in read-only mode! Please check out our Support Center for more information." - Vuforia Engine Team

OpenGL texture load on separate thread

Hello, I need to load textures for different animations when QCAR recognizes a marker. I want to load them on a separate thread from the rendering thread so that the camera doesn't appear frozen during this process. Is there a way to accomplish this in android. I was able to do this successfully in ios because I could setup another OpenGL context on another thread that used the same sharegroup, but I'm not sure if there is a similar facility on android.

vladislavdexheimer

Fri, 11/11/2011 - 07:14

Try using the [I]AsyncTask[/I] class for this. Load your texture in the [I]onBackground(...)[/I] method and pass it to the native components in [I]onPostExecute(...)[/I]. Best regards

thematerialgroup

Fri, 11/11/2011 - 16:22

That wouldn't work because you need a shared open gl context on that separate thread. That's the problem I'm having, figuring out how to create a new context and share with the existing one.

vladislavdexheimer

Mon, 11/14/2011 - 22:54

The onPostExecute() method is called in the main thread and there shouldn't be a problem as far as I know with the OpenGL context. Or do you want to pass the extracted bitmap data of the texture also inside that separate thread?