[orx-syphon] Move demos from test to demo, add OpenGL requirements

This commit is contained in:
Edwin Jakobs
2024-03-14 12:16:19 +01:00
parent fed97e673f
commit 82cf4e0a89
10 changed files with 102 additions and 77 deletions

View File

@@ -12,18 +12,21 @@ import org.openrndr.color.ColorRGBa
import kotlin.math.sin
fun main() = application {
configure {
width = 1000
height = 1000
}
fun main() {
System.setProperty("org.openrndr.gl3.gl_type", "gl")
application {
configure {
width = 1000
height = 1000
}
program {
extend(SyphonServer())
program {
extend(SyphonServer())
extend {
drawer.background(ColorRGBa.RED)
drawer.circle(width/2.0, height/2.0, sin(seconds) * width / 2.0)
extend {
drawer.background(ColorRGBa.RED)
drawer.circle(width / 2.0, height / 2.0, sin(seconds) * width / 2.0)
}
}
}
}
@@ -38,31 +41,34 @@ import org.openrndr.draw.renderTarget
import kotlin.math.*
fun main() = application {
configure {
width = 1000
height = 1000
}
program {
val rt = renderTarget(100, 100) {
colorBuffer()
fun main() {
System.setProperty("org.openrndr.gl3.gl_type", "gl")
application {
configure {
width = 1000
height = 1000
}
// You can give the server a different name
extend(SyphonServer("Test", rt))
extend {
/**
* This is what will be sent to Syphon, and drawn in a small corner of the screen
*/
drawer.isolatedWithTarget(rt) {
drawer.background(ColorRGBa(sin(seconds), cos(seconds / 2.0), 0.5, 1.0))
program {
val rt = renderTarget(100, 100) {
colorBuffer()
}
drawer.background(ColorRGBa.GRAY)
drawer.circle(width/2.0, height/2.0, sin(seconds) * width / 2.0)
drawer.image(rt.colorBuffer(0))
// You can give the server a different name
extend(SyphonServer("Test", rt))
extend {
/**
* This is what will be sent to Syphon, and drawn in a small corner of the screen
*/
drawer.isolatedWithTarget(rt) {
drawer.background(ColorRGBa(sin(seconds), cos(seconds / 2.0), 0.5, 1.0))
}
drawer.background(ColorRGBa.GRAY)
drawer.circle(width / 2.0, height / 2.0, sin(seconds) * width / 2.0)
drawer.image(rt.colorBuffer(0))
}
}
}
}