Client working!
This commit is contained in:
committed by
edwin
parent
31b79685eb
commit
4a1a4103c3
@@ -1,38 +1,20 @@
|
||||
import jsyphon.JSyphonClient
|
||||
import jsyphon.JSyphonImage
|
||||
import org.lwjgl.opengl.GL11C.GL_TEXTURE_2D
|
||||
import org.openrndr.application
|
||||
import org.openrndr.color.ColorRGBa
|
||||
import org.openrndr.draw.*
|
||||
import org.openrndr.internal.Driver
|
||||
import org.openrndr.internal.gl3.ColorBufferGL3
|
||||
import kotlin.math.sin
|
||||
|
||||
|
||||
fun main() = application {
|
||||
configure {
|
||||
width = 1000
|
||||
height = 1000
|
||||
height = 800
|
||||
}
|
||||
|
||||
program {
|
||||
val client = JSyphonClient()
|
||||
client.init()
|
||||
|
||||
val syphonClient = SyphonClient()
|
||||
|
||||
extend(syphonClient)
|
||||
extend {
|
||||
drawer.background(ColorRGBa.RED)
|
||||
|
||||
if (client.hasNewFrame()) {
|
||||
println("hasnewframe")
|
||||
val img = client.newFrameImageForContext()
|
||||
val buffer = ColorBufferGL3(GL_TEXTURE_2D, img.textureName(), img.textureWidth(), img.textureHeight(),
|
||||
1.0, ColorFormat.RGBa, ColorType.UINT8, 1, BufferMultisample.Disabled, Session.active)
|
||||
|
||||
|
||||
drawer.image(buffer)
|
||||
}
|
||||
|
||||
drawer.background(ColorRGBa.BLACK)
|
||||
drawer.image(syphonClient.buffer)
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user