Add screenshot generation

This commit is contained in:
Edwin Jakobs
2020-04-22 21:56:08 +02:00
parent 6a29853c71
commit 60a64806fc
66 changed files with 1316 additions and 84 deletions

View File

@@ -10,6 +10,7 @@ sourceSets {
dependencies {
demoImplementation("org.openrndr:openrndr-core:$openrndrVersion")
demoImplementation("org.openrndr:openrndr-extensions:$openrndrVersion")
demoRuntimeOnly("org.openrndr:openrndr-gl3:$openrndrVersion")
demoRuntimeOnly("org.openrndr:openrndr-gl3-natives-$openrndrOS:$openrndrVersion")
demoImplementation(sourceSets.getByName("main").output)

View File

@@ -1,4 +1,5 @@
import org.openrndr.application
import org.openrndr.extensions.SingleScreenshot
import org.openrndr.extra.timer.repeat
fun main() = application {
@@ -6,6 +7,11 @@ fun main() = application {
repeat(2.0) {
println("hello there $seconds" )
}
if (System.getProperty("takeScreenshot") == "true") {
extend(SingleScreenshot()) {
this.outputFile = System.getProperty("screenshotPath")
}
}
extend {
}

View File

@@ -1,6 +1,7 @@
import org.openrndr.application
import org.openrndr.color.ColorRGBa
import org.openrndr.events.Event
import org.openrndr.extensions.SingleScreenshot
import org.openrndr.extra.timer.repeat
/**
@@ -17,6 +18,11 @@ fun main() = application {
// -- we can not draw here, so we relay the repeat signal to the event
event.trigger(null)
}
if (System.getProperty("takeScreenshot") == "true") {
extend(SingleScreenshot()) {
this.outputFile = System.getProperty("screenshotPath")
}
}
extend {
drawer.background(ColorRGBa.PINK)
// -- by explicitly calling deliver we know that the drawing code in the listener will be

View File

@@ -1,8 +1,14 @@
import org.openrndr.application
import org.openrndr.extensions.SingleScreenshot
import org.openrndr.extra.timer.timeOut
fun main() = application {
program {
if (System.getProperty("takeScreenshot") == "true") {
extend(SingleScreenshot()) {
this.outputFile = System.getProperty("screenshotPath")
}
}
timeOut(2.0) {
println("hello there $seconds" )
}