I have shaders kept in assets folder. name of the shader (file name) : "vertex.vs" path : assets/shaders/vertex.vs
I want to access this file from a C++ file from NDK without calling Java or JNI whatever it is. From reading various resources I managed to understand that i have to use the header
#include <android/asset_manager.h>
After that I create pointers and open it.
const char* mPath = "shaders/vertex.vs";
AAssetManager* mAssetManager;
AAsset* mAsset;
mAsset = AAssetManager_open(mAssetManager, mPath,AASSET_MODE_UNKNOWN);
int foo = AAsset_getLength(mAsset);
LOGD( "This is a number: %d", foo );
AAsset_close(mAsset);
But it doesn't do anything. And what's with this read function.
AAsset_read(mAsset,pBuffer,bytesToRead);
Where is the data read? How to define the pBuffer ? Can someone share a simple example on how to read the data from a raw file and how to access it(Like showing it in logcat)?