I am new to programming and trying to learn android with native c++ code.

I am trying to open a bitmap file in native code so I can load it as a texture in opengl.

FILE* img = NULL;

img = fopen("banana.bmp","rb");

if (img == NULL)

{

__android_log_print(ANDROID_LOG_DEBUG, DEBUG_TAG, "NDK:LC: [%s]", "load texture file = null");

return -1;

}

the above code always return img as null.

Where should I put my banana.bmp file?

Right now I put it in the jni folder along with the android.mk and c++ source files.

Can someone please explain to me? Thanks

Logo

为开发者提供学习成长、分享交流、生态实践、资源工具等服务,帮助开发者快速成长。

更多推荐