Browse Source

renamed setBorderless to setImmersive and linked it to the fullscreen mode

fysx 11 years ago
parent
commit
31cd05551e

+ 2 - 2
jni/love/src/common/android.cpp

@@ -35,7 +35,7 @@ namespace love
 namespace android
 {
 
-void setBorderless (bool borderless_active) {
+void setImmersive (bool immersive_active) {
 	JNIEnv *env = (JNIEnv*) SDL_AndroidGetJNIEnv();
 
 	jobject activity = (jobject) SDL_AndroidGetActivity();
@@ -43,7 +43,7 @@ void setBorderless (bool borderless_active) {
 	jclass clazz (env->GetObjectClass(activity));
 	jmethodID method_id = env->GetMethodID (clazz, "setImmersiveMode", "(Z)V");
 
-	env->CallVoidMethod (activity, method_id, borderless_active);
+	env->CallVoidMethod (activity, method_id, immersive_active);
 
 	env->DeleteLocalRef (activity);
 	env->DeleteLocalRef (clazz);

+ 1 - 1
jni/love/src/common/android.h

@@ -32,7 +32,7 @@ namespace love
 namespace android
 {
 
-void setBorderless (bool borderless_active);
+void setImmersive (bool immersive_active);
 
 /**
  * Gets the scale factor of the window's screen, e.g. on Retina displays this

+ 6 - 1
jni/love/src/modules/window/sdl/Window.cpp

@@ -95,6 +95,11 @@ bool Window::setWindow(int width, int height, WindowSettings *settings)
 
 	Uint32 sdlflags = SDL_WINDOW_OPENGL;
 
+	// On Android we always must have fullscreen type FULLSCREEN_TYPE_DESKTOP
+#ifdef LOVE_ANDROID
+	f.fstype = FULLSCREEN_TYPE_DESKTOP;
+#endif
+
 	if (f.fullscreen)
 	{
 		if (f.fstype == FULLSCREEN_TYPE_DESKTOP)
@@ -246,7 +251,7 @@ bool Window::setWindow(int width, int height, WindowSettings *settings)
 			showMessageBox("Could not set graphics mode", "Unsupported OpenGL version?", MESSAGEBOX_ERROR, true);
 
 #ifdef LOVE_ANDROID
-		love::android::setBorderless(f.borderless);
+		love::android::setImmersive(f.fullscreen);
 #endif
 	}