aboutsummaryrefslogtreecommitdiff
path: root/src/main/kotlin/play/PlayProgram.kt
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/kotlin/play/PlayProgram.kt')
-rw-r--r--src/main/kotlin/play/PlayProgram.kt47
1 files changed, 47 insertions, 0 deletions
diff --git a/src/main/kotlin/play/PlayProgram.kt b/src/main/kotlin/play/PlayProgram.kt
new file mode 100644
index 0000000..0ec0133
--- /dev/null
+++ b/src/main/kotlin/play/PlayProgram.kt
@@ -0,0 +1,47 @@
+package play
+
+import java.io.File
+import org.openrndr.Program
+import org.openrndr.application
+import org.openrndr.draw.*
+import phenax.utils.*
+
+fun main() = application {
+ recordDuration(10.seconds())
+
+ configure {
+ width = 640
+ height = 480
+ windowResizable = false
+ }
+
+ oliveProgram {
+ val cs by liveComputeShader("play_shader")
+ // val image = loadImage("data/images/pm5544.png")
+ // val font = loadFont("data/fonts/default.otf", 64.0)
+
+ // val inputBuffer = colorBuffer(width, height, type = ColorType.UINT8)
+ val outputBuffer = colorBuffer(width, height, type = ColorType.UINT8)
+
+ extend {
+ // drawer.drawStyle.colorMatrix = tint(ColorRGBa.WHITE.shade(0.2))
+ // drawer.image(image)
+
+ // drawer.fill = ColorRGBa.PINK
+ // drawer.circle(
+ // cos(seconds) * width / 2.0 + width / 2.0,
+ // sin(0.5 * seconds) * height / 2.0 + height / 2.0,
+ // 140.0
+ // )
+
+ // drawer.fontMap = font
+ // drawer.fill = ColorRGBa.WHITE
+ // drawer.text("OPENRNDR", width / 2.0, height / 2.0)
+
+ cs.uniform("seconds", seconds)
+ cs.image("outputImg", 1, outputBuffer.imageBinding(0, ImageAccess.WRITE))
+ cs.execute(outputBuffer.width, outputBuffer.height, 1)
+ drawer.image(outputBuffer)
+ }
+ }
+}