- Home /
Question by
countimp · Oct 01, 2014 at 02:46 PM ·
androidtexturenative plugin
How to update Unity3D texture from C++ on an Android device?
I want to update a Texture2D from C++ code on an Android device. I pass the texture's native texture ID resulting from the Unity3D call texture.GetNativeTextureID() to C++. In C++ I create an array (unsigned char* img), and pass this to OpenGL functions:
glBindTexture(GL_TEXTURE_2D, textureID);
glTexImage2D(
GL_TEXTURE_2D,
0,
GL_RGBA,
width,
height,
0,
GL_RGBA,
GL_UNSIGNED_BYTE,
img
);
I got no errors (checked with glGetError()), but the array's content does not appear on the texture. What am I doing wrong?
Comment
Your answer
Follow this Question
Related Questions
How to get pixels from an external texture? 1 Answer
IMGSRV error unity in android 0 Answers
Alpha problem with textures on a plane 2 Answers
Unity 2018 UGUI Android Sprite Textures Not Rendering Correctly 1 Answer
Android textures not loading 1 Answer