summaryrefslogtreecommitdiff
path: root/source/nanovg/android.h
diff options
context:
space:
mode:
authorMitya Selivanov <automainint@guattari.tech>2023-12-29 06:21:33 +0100
committerMitya Selivanov <automainint@guattari.tech>2023-12-29 06:21:33 +0100
commit2d6c8fec45b23a8a28668ecf3ef281139ab778a7 (patch)
tree75d2a8538992129a83c0c2b83688289443d697e5 /source/nanovg/android.h
parent820b171245f2f14766f3accdb0246a4e2c0d596a (diff)
downloadsaw-2d6c8fec45b23a8a28668ecf3ef281139ab778a7.zip
refactor dependencies; include dependencies source code
Diffstat (limited to 'source/nanovg/android.h')
-rw-r--r--source/nanovg/android.h26
1 files changed, 26 insertions, 0 deletions
diff --git a/source/nanovg/android.h b/source/nanovg/android.h
new file mode 100644
index 0000000..0bf20ce
--- /dev/null
+++ b/source/nanovg/android.h
@@ -0,0 +1,26 @@
+// See: http://www.50ply.com/blog/2013/01/19/loading-compressed-android-assets-with-file-pointer/
+
+#ifndef NANOVG_ANDROID_H_04F2956C_D65D_11EA_852A_07298A1173F1
+#define NANOVG_ANDROID_H_04F2956C_D65D_11EA_852A_07298A1173F1
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#if defined(__ANDROID__)
+
+#include <stdio.h>
+#include <android/asset_manager.h>
+
+void android_fopen_set_asset_manager(AAssetManager* manager);
+FILE* android_fopen(const char* fname, const char* mode);
+
+#define fopen(name, mode) android_fopen(name, mode)
+
+#endif
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif // NANOVG_ANDROID_H_04F2956C_D65D_11EA_852A_07298A1173F1