fix android platform
This commit is contained in:
parent
7fd1b89d00
commit
7f0babcdd9
3 changed files with 11 additions and 4 deletions
|
@ -8,5 +8,4 @@ void android_init() {
|
|||
struct android_app *app;
|
||||
app = GetAndroidApp();
|
||||
asset_manager = app->activity->assetManager;
|
||||
internal_storage_path = app->activity->internalDataPath;
|
||||
}
|
||||
|
|
|
@ -7,12 +7,16 @@ package rl
|
|||
#include "raylib.h"
|
||||
#include <stdlib.h>
|
||||
#include <android/asset_manager.h>
|
||||
#include <android/native_activity.h>
|
||||
#include <android_native_app_glue.h>
|
||||
|
||||
extern void android_init();
|
||||
extern struct ANativeActivity *GetANativeActivity(void);
|
||||
|
||||
static AAssetManager* asset_manager;
|
||||
static const char* internal_storage_path;
|
||||
static const char* getInternalStoragePath(){
|
||||
return GetANativeActivity()->internalDataPath;
|
||||
}
|
||||
*/
|
||||
import "C"
|
||||
|
||||
|
@ -133,5 +137,5 @@ func (a *asset) Close() error {
|
|||
}
|
||||
|
||||
func getInternalStoragePath() string {
|
||||
return C.GoString(C.internal_storage_path)
|
||||
return C.GoString(C.getInternalStoragePath())
|
||||
}
|
||||
|
|
|
@ -50,7 +50,6 @@
|
|||
#include <android/window.h> // Required for: AWINDOW_FLAG_FULLSCREEN definition and others
|
||||
//#include <android/sensor.h> // Required for: Android sensors functions (accelerometer, gyroscope, light...)
|
||||
#include <jni.h> // Required for: JNIEnv and JavaVM [Used in OpenURL()]
|
||||
|
||||
#include <EGL/egl.h> // Native platform windowing system interface
|
||||
|
||||
//----------------------------------------------------------------------------------
|
||||
|
@ -134,6 +133,11 @@ struct android_app *GetAndroidApp(void)
|
|||
return platform.app;
|
||||
}
|
||||
|
||||
extern struct ANativeActivity *GetANativeActivity(void)
|
||||
{
|
||||
return platform.app->activity;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------------
|
||||
// Module Functions Definition: Window and Graphics Device
|
||||
//----------------------------------------------------------------------------------
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue