Skip to content

Commit daf4fba

Browse files
committed
add Platform.EMBEDDED, #1079
1 parent f7c5d19 commit daf4fba

File tree

1 file changed

+10
-2
lines changed
  • fxgl-core/src/main/kotlin/com/almasb/fxgl/core/util

1 file changed

+10
-2
lines changed

fxgl-core/src/main/kotlin/com/almasb/fxgl/core/util/Platform.kt

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ package com.almasb.fxgl.core.util
1010
* @author Almas Baimagambetov ([email protected])
1111
*/
1212
enum class Platform {
13-
WINDOWS, MAC, LINUX, ANDROID, IOS, BROWSER;
13+
WINDOWS, MAC, LINUX, ANDROID, IOS, BROWSER, EMBEDDED;
1414

1515
val isBrowser: Boolean
1616
get() = this === BROWSER
@@ -34,7 +34,15 @@ enum class Platform {
3434
return ANDROID
3535
}
3636

37-
// if we got here then not running on mobile
37+
// check if running on embedded
38+
val monoclePlatformName = System.getProperty("monocle.platform", "")
39+
val glassPlatformName = System.getProperty("glass.platform", "")
40+
41+
if (monoclePlatformName == "EGL" && glassPlatformName == "Monocle") {
42+
return EMBEDDED
43+
}
44+
45+
// if we got here then not running on mobile or embedded
3846
val osName = System.getProperty("os.name")
3947

4048
if (osName.contains("mac", ignoreCase = true)) {

0 commit comments

Comments
 (0)