0

I am developing an Android app based on Kudan SDK. On my AR screen, I have a button and onclick should download the image from the server, save it locally, and add the image to marker.

The issue is when my ARActivity opens, if I add the image as code below, inside setup method, it works but on button click if I use the same method I get the following error:

[unnamed-7603-0] bindTextureImage: clearing GL error: 0x501

On log console and image doesn't show up.

ARTexture2D texture = new ARTexture2D();
texture.loadFromPath(testPath);
texture.setTextureID(1);
ARImageNode imageNode = new ARImageNode(texture);
trackable.getWorld().addChild(imageNode);
imageNode.setVisible(true);
reformed
  • 4,505
  • 11
  • 62
  • 88
  • This clearly sounds like a threading issue. OpenGLes expects all gl functions to be called from the same thread. Possibly in your case, you are calling the function from button event which can be a different thread. – codetiger Sep 07 '16 at 03:38
  • Any sample code would be appreciated! – Sushant Giri Sep 07 '16 at 05:09
  • Just use a boolean flag like 'bool shouldShowImage' and make it true in the button event. Then in the draw function you can load and render the image. – codetiger Sep 07 '16 at 05:22

0 Answers0