I want to write a native android library that can access shader and texture files from the res/raw folder of my application (or rather res/assets?) without being dependent of a specific activity object.
I want to avoid code like
Java_com_namespace_MyActivity_initAssetsManager(JNIEnv* env, jobject obj) {
AAssetManager* g_assetManager = nullptr;
g_assetManager = AAssetManager_fromJava(env, obj);
//log whatever operation ssucceeded or not.
}
Not sure if the way to do it is to #include <android_native_app_glue.h> in my source.cpp. The compiler don't recognize this header. I have to somehow add the android_native_app_glue lib to my cmakelists. I couldn't find an explanation how to do this. Google comes up only with examples using Android.mk.