mirror of
https://github.com/love2d/love-android.git
synced 2026-08-19 12:14:49 +02:00
Allowing enabling and disabling of immersive mode via borderless setting and love.window.setMode()
This commit is contained in:
@@ -35,6 +35,20 @@ namespace love
|
||||
namespace android
|
||||
{
|
||||
|
||||
void setBorderless (bool borderless_active) {
|
||||
JNIEnv *env = (JNIEnv*) SDL_AndroidGetJNIEnv();
|
||||
|
||||
jobject activity = (jobject) SDL_AndroidGetActivity();
|
||||
|
||||
jclass clazz (env->GetObjectClass(activity));
|
||||
jmethodID method_id = env->GetMethodID (clazz, "setImmersiveMode", "(Z)V");
|
||||
|
||||
env->CallVoidMethod (activity, method_id, borderless_active);
|
||||
|
||||
env->DeleteLocalRef (activity);
|
||||
env->DeleteLocalRef (clazz);
|
||||
}
|
||||
|
||||
double getScreenScale()
|
||||
{
|
||||
static double result = -1.;
|
||||
|
||||
@@ -32,6 +32,8 @@ namespace love
|
||||
namespace android
|
||||
{
|
||||
|
||||
void setBorderless (bool borderless_active);
|
||||
|
||||
/**
|
||||
* Gets the scale factor of the window's screen, e.g. on Retina displays this
|
||||
* will return 2.0.
|
||||
|
||||
Reference in New Issue
Block a user