From 5f41d4cded56121af66b18c232c7f557ab803f94 Mon Sep 17 00:00:00 2001 From: Akshay Nair Date: Sun, 27 Sep 2026 12:06:00 +0530 Subject: Add headless screenshot + fix scaling for antialiasing for vacation --- src/main/kotlin/phenax/utils/program.kt | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'src/main/kotlin/phenax/utils') diff --git a/src/main/kotlin/phenax/utils/program.kt b/src/main/kotlin/phenax/utils/program.kt index fe48351..cfbe9c9 100644 --- a/src/main/kotlin/phenax/utils/program.kt +++ b/src/main/kotlin/phenax/utils/program.kt @@ -19,7 +19,8 @@ fun recordDuration(millis: Int) { fun recordDuration(): Int? = System.getProperty("phenax.record.frameCount")?.toIntOrNull() -val recordingEnabled: Boolean by lazy { System.getenv("RECORD") != null } +val recordingEnabled: Boolean by lazy { System.getenv("PHENAX_RECORD") != null } +val screenshotEnabled: Boolean by lazy { System.getenv("PHENAX_SCREENSHOT") != null } // fun classDir(): String = // "src/main/kotlin/${stackRootClassName(sanitize = @@ -30,7 +31,7 @@ val recordingEnabled: Boolean by lazy { System.getenv("RECORD") != null } // Have to keep the same name (oliveProgram) to get update on save to work fun ApplicationBuilder.oliveProgram(init: Program.() -> Unit) { - if (recordingEnabled) { + if (recordingEnabled || screenshotEnabled) { program(init) } else { // TODO: Make watching shader files work @@ -88,7 +89,7 @@ fun Program.liveComputeShader(name: String): ReadOnlyProperty