Add screenshot generation
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -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 {
|
||||
|
||||
}
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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" )
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user