no name
no name

Reputation: 47

[android ndk]How can I get absoulte path of files in asset folder?

I'm using ftgles library on android native app.

but i can't rendering a text.

this is my source code.

unsigned char* buff;
unsigned long size;

buff = GLManager::getInstance()->texture()->loadFontFromAssets("NanumGothic.ttf", &size);

font = new FTBufferFont(buff, size);

I think this code is wrong.

so I'm trying to

change this code

font = new FTBufferFont(buff, size);

to

font = new FTBufferFont("filePath");

but I don't know the absolute path of assets folder's file

could you teach me how to get assets folder's file absolute path?

Upvotes: 2

Views: 460

Answers (1)

Alex Cohn
Alex Cohn

Reputation: 57173

Assets are not files, and you cannot use fopen() for them, which FTBufferFont(const char*) does under the hood. But you can extract an asset to a regular file if you wish, especially if you need this for debugging your code.

Upvotes: 1

Related Questions