I have successfully rendered a triangle with a hard coded shader using NativeActivity of Android NDK. Now I have the requirement to load a shader file. I tried to use fopen but it is returning NULL.

I have researched a little bit and found out there's an AAssetManager which I can use. I want to know why fopen didn't work and why should I use AAssetManager to load files?

  • \$\begingroup\$ fopen returns NULL if it can't open the file, probably because you just have the path to it incorrect. \$\endgroup\$ Commented Oct 29, 2018 at 3:12
  • \$\begingroup\$ Ya that' correct. But I am pretty sure that's not the issue because I have tried all the possible paths. \$\endgroup\$ Commented Oct 29, 2018 at 3:14


You must log in to answer this question.

Browse other questions tagged .