implement some stuff to make exaple SDL app run

NOTE: the main addition in this commit is WIP support for apps which
render on an EGL surface obtained using ANativeWindow_fromSurface

currently, this EGL surface is obtained by creating a 700x700 pixel
window with GLFW (the 700x700 size is hardcoded in several places)
and only Wayland is supported

ideally, we'd want to use a wayland subsurface to position the EGL
surface above the Surface widget it's associated with (and do
whatever for X11)
This commit is contained in:
Mis012
2022-10-26 18:39:04 +02:00
parent 3627f35bd5
commit b801f0fb3c
26 changed files with 1552 additions and 161 deletions

View File

@@ -3,10 +3,14 @@ package android.content;
import android.util.Log;
import android.content.pm.PackageManager;
import android.content.pm.ApplicationInfo;
import android.content.res.AssetManager;
import android.content.res.Configuration;
import android.content.res.Resources;
import android.content.res.TypedArray;
import android.content.Intent;
import android.content.BroadcastReceiver;
import android.util.AttributeSet;
import android.util.DisplayMetrics;
import android.content.SharedPreferences;
@@ -23,6 +27,8 @@ import android.app.KeyguardManager;
import android.telephony.TelephonyManager;
import android.media.AudioManager;
import android.app.ActivityManager;
import android.hardware.usb.UsbManager;
import android.os.Vibrator;
import java.io.File;
import java.io.FileInputStream;
@@ -55,6 +61,10 @@ public class Context extends Object {
System.out.println("new Context! this one is: " + this);
}
public ApplicationInfo getApplicationInfo () {
return new ApplicationInfo();
}
public Context getApplicationContext() {
return (Context)this_application;
}
@@ -81,12 +91,20 @@ public class Context extends Object {
return new AudioManager();
case "activity":
return new ActivityManager();
case "usb":
return new UsbManager();
case "vibrator":
return new Vibrator();
default:
System.out.println("!!!!!!! getSystemService: case >"+name+"< is not implemented yet");
return null;
}
}
public Intent registerReceiver(BroadcastReceiver receiver, IntentFilter filter) {
return new Intent();
}
public Looper getMainLooper() {
System.out.println("returning the main Looper, most definitely doing just that!");
return new Looper();