summaryrefslogtreecommitdiff
path: root/source/thirdparty/android.h
diff options
context:
space:
mode:
authorMitya Selivanov <automainint@guattari.tech>2023-09-25 20:02:08 +0200
committerMitya Selivanov <automainint@guattari.tech>2023-09-25 20:02:08 +0200
commit0d9781dafdfda9569a2373216ace013663f0d858 (patch)
tree14ebcf10eb0e32a02190ce4c80363979f9f7216d /source/thirdparty/android.h
parente747b343c332907110dad26e15c20daf3d7d7125 (diff)
downloadsaw-0d9781dafdfda9569a2373216ace013663f0d858.zip
Sokol and nanovg setup
Diffstat (limited to 'source/thirdparty/android.h')
-rw-r--r--source/thirdparty/android.h26
1 files changed, 26 insertions, 0 deletions
diff --git a/source/thirdparty/android.h b/source/thirdparty/android.h
new file mode 100644
index 0000000..0bf20ce
--- /dev/null
+++ b/source/thirdparty/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