Added the option to choose a specific server server / application to SyphonClient

Also updated the preview gif to the right colors and added orx-syphon to the README
This commit is contained in:
Rein van der Woerd
2020-02-26 13:29:11 +01:00
parent 8d2b622cbb
commit ff442da068
6 changed files with 43 additions and 6 deletions

View File

@@ -10,7 +10,7 @@ import org.openrndr.draw.*
import org.openrndr.internal.gl3.ColorBufferGL3
class SyphonClient: Extension {
class SyphonClient(private val appName: String? = null, private val serverName: String? = null): Extension {
override var enabled = true
private val client = JSyphonClient()
@@ -18,7 +18,12 @@ class SyphonClient: Extension {
override fun setup(program: Program) {
buffer = colorBuffer(program.width, program.height)
client.init()
// Choosing a different server
if (appName != null) client.setApplicationName(appName)
if (serverName != null) client.setServerName(serverName)
}
override fun beforeDraw(drawer: Drawer, program: Program) {
@@ -43,6 +48,10 @@ class SyphonClient: Extension {
rectBuffer.copyTo(buffer)
}
}
override fun shutdown(program: Program) {
client.stop()
}
}