so I implemented it myself but with this test application I am getting back
this location: /data/data/org.libsdl.app/files/
that doesn’t seem to be the resources directory and even if i add an assets
directory and put my files in there, they are not copied over to that
location.
How can I get the location of the assets directory through SDL on android?
as far as I understand the concept, “assets” are read-only files that are
bundled inside the app’s a.pk - i.e. they are not unpacked and thus the
assets do not form a “real” directory.
You can read assets in C via dedicated functions only, they cannot be
accessed via direct file IO. I don’t know whether SDL implements this
"special" Android behaviour for assets. If not, you can take a look at this
header file
#include<android/asset_manager.h>
in the Android NDK on how to open & read asset files.
so I implemented it myself but with this test application I am getting back
this location: ?/data/data/org.libsdl.app/files/
that doesn’t seem to be the resources directory and even if i add an assets
directory and put my files in there, they are not copied over to that
location.
worked out.On Mon, Aug 17, 2015 at 8:25 PM, hardcoredaniel wrote:
Hi,
as far as I understand the concept, “assets” are read-only files that are
bundled inside the app’s a.pk - i.e. they are not unpacked and thus the
assets do not form a “real” directory.
You can read assets in C via dedicated functions only, they cannot be
accessed via direct file IO. I don’t know whether SDL implements this
"special" Android behaviour for assets. If not, you can take a look at this
header file
#include <android/asset_manager.h>
in the Android NDK on how to open & read asset files.
so I implemented it myself but with this test application I am getting
back this location: /data/data/org.libsdl.app/files/
that doesn’t seem to be the resources directory and even if i add an
assets directory and put my files in there, they are not copied over to
that location.
How can I get the location of the assets directory through SDL on android?
On Mon, Aug 17, 2015 at 8:25 PM, hardcoredaniel wrote:
Hi,
as far as I understand the concept, “assets” are read-only files that are
bundled inside the app’s a.pk - i.e. they are not unpacked and thus the
assets do not form a “real” directory.
You can read assets in C via dedicated functions only, they cannot be
accessed via direct file IO. I don’t know whether SDL implements this
"special" Android behaviour for assets. If not, you can take a look at this
header file
#include <android/asset_manager.h>
in the Android NDK on how to open & read asset files.
so I implemented it myself but with this test application I am getting
back this location: /data/data/org.libsdl.app/files/
that doesn’t seem to be the resources directory and even if i add an
assets directory and put my files in there, they are not copied over to
that location.
How can I get the location of the assets directory through SDL on android?
On Mon, Aug 17, 2015 at 8:25 PM, hardcoredaniel <hardcoredaniel at seznam.cz wrote:
Hi,
as far as I understand the concept, “assets” are read-only files that
are bundled inside the app’s a.pk - i.e. they are not unpacked and thus
the assets do not form a “real” directory.
You can read assets in C via dedicated functions only, they cannot be
accessed via direct file IO. I don’t know whether SDL implements this
"special" Android behaviour for assets. If not, you can take a look at this
header file
#include <android/asset_manager.h>
in the Android NDK on how to open & read asset files.
so I implemented it myself but with this test application I am getting
back this location: /data/data/org.libsdl.app/files/
that doesn’t seem to be the resources directory and even if i add an
assets directory and put my files in there, they are not copied over to
that location.
How can I get the location of the assets directory through SDL on
android?
Well, you’d use SDL_RWFromFile(“file”), and if there’s a file in assets/
folder with that name, it will automagically open. Then you use it almost
as you would with stdio. The wiki page might have more info, but its really
a no brainer. Replace fopen/fclose/fread with SDL_RW* stuff and you’re set.
It is worth noticing that all SDL functions that open files (like
SDL_LoadBMP) use RWops by default, they should just work on android.
On Mon, Aug 17, 2015 at 8:25 PM, hardcoredaniel < hardcoredaniel at seznam.cz> wrote:
Hi,
as far as I understand the concept, “assets” are read-only files that
are bundled inside the app’s a.pk - i.e. they are not unpacked and
thus the assets do not form a “real” directory.
You can read assets in C via dedicated functions only, they cannot be
accessed via direct file IO. I don’t know whether SDL implements this
"special" Android behaviour for assets. If not, you can take a look at this
header file
#include <android/asset_manager.h>
in the Android NDK on how to open & read asset files.
so I implemented it myself but with this test application I am getting
back this location: /data/data/org.libsdl.app/files/
that doesn’t seem to be the resources directory and even if i add an
assets directory and put my files in there, they are not copied over to
that location.
How can I get the location of the assets directory through SDL on
android?
Also, the satellite libraries (SDL_image, SDL_ttf, etc.) load files via
SDL_RWops, so they work right on Android as well.
Jonny DOn Tue, Aug 18, 2015 at 1:34 AM, Leonardo Guilherme < leonardo.guilherme at gmail.com> wrote:
Well, you’d use SDL_RWFromFile(“file”), and if there’s a file in assets/
folder with that name, it will automagically open. Then you use it almost
as you would with stdio. The wiki page might have more info, but its really
a no brainer. Replace fopen/fclose/fread with SDL_RW* stuff and you’re set.
It is worth noticing that all SDL functions that open files (like
SDL_LoadBMP) use RWops by default, they should just work on android.
On Mon, Aug 17, 2015 at 8:25 PM, hardcoredaniel < hardcoredaniel at seznam.cz> wrote:
Hi,
as far as I understand the concept, “assets” are read-only files that
are bundled inside the app’s a.pk - i.e. they are not unpacked and
thus the assets do not form a “real” directory.
You can read assets in C via dedicated functions only, they cannot be
accessed via direct file IO. I don’t know whether SDL implements this
"special" Android behaviour for assets. If not, you can take a look at this
header file
#include <android/asset_manager.h>
in the Android NDK on how to open & read asset files.
so I implemented it myself but with this test application I am getting
back this location: /data/data/org.libsdl.app/files/
that doesn’t seem to be the resources directory and even if i add an
assets directory and put my files in there, they are not copied over to
that location.
How can I get the location of the assets directory through SDL on
android?