# Share openRNDR window as Texture - Syphon Bridge

**URL:** <https://openrndr.discourse.group/t/share-openrndr-window-as-texture-syphon-bridge/38>\
**Category:** How to?\
**Created:** [December 31, 2019, 10:10am UTC](https://openrndr.discourse.group/t/share-openrndr-window-as-texture-syphon-bridge/38 "2019-12-31T10:10:48Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![Tom\_Peak](https://yyz2.discourse-cdn.com/free1/user_avatar/openrndr.discourse.group/tom_peak/32/37_2.png) [@Tom\_Peak](https://openrndr.discourse.group/u/Tom_Peak)\
**Post date:** [December 31, 2019, 10:10am UTC](https://openrndr.discourse.group/t/share-openrndr-window-as-texture-syphon-bridge/38/1 "2019-12-31T10:10:48Z")

</div>

Hello Girls and Boys, I do VJing in Vienna, mainly with audioreative patches to live input. I use VDMX, MadMapper and Processing as my basic setup. These components work together with Syphon. [http://syphon.v002.info/](http://syphon.v002.info/)

I like openRNDR and want to replace Processing, but don’t find implementation for Syphon which is the core of the live VJing concept to get Processing into VDMX or MadMapper and mix around with in- and outputs using different softwares.

Is there a way to follow a similar approach with openRNDR?

There is a JavaLibrary which should work as: [https://github.com/Syphon/Java/blob/master/JSyphon/src/jsyphon/test/ServerTest.java](https://github.com/Syphon/Java/blob/master/JSyphon/src/jsyphon/test/ServerTest.java)  
I’ve just tried to copy & paste the gl functions into the animation-001 Example after draw.circle  
The server is open in my client but GL throws:  
`tracking verteBuffer org.openrndr.internal.gl3.VertexBufferGL3`  
`org.openrndr.internal.gl3.GL3Exception: GL ERROR: GL_INVALID_ENUM null`

loses target? glGenVertexArray? GL\_VERTEX\_ARRAY / BUFFER ???  
I have no clue about openGL, I try to get into it, but … it’s hard 🙂 and there must be a proper way to do this with your API, I am on it and learned a lot about your concept … don’t see myself yet to get this thing done.

Please help!

best, Tom

---

<div class="post-metadata">

**Author:** ![kazik](https://yyz2.discourse-cdn.com/free1/user_avatar/openrndr.discourse.group/kazik/32/7_2.png) [@kazik](https://openrndr.discourse.group/u/kazik)\
**Post date:** [December 31, 2019, 12:19pm UTC](https://openrndr.discourse.group/t/share-openrndr-window-as-texture-syphon-bridge/38/2 "2019-12-31T12:19:07Z")

</div>

Seems like a great candidate for `orx` module. I would be interested in using it as well. These classes look like a good starting point:

> <https://github.com/openrndr/openrndr/blob/master/openrndr-ffmpeg/src/main/kotlin/org/openrndr/ffmpeg/ScreenRecorder.kt>

  

> <https://github.com/openrndr/openrndr/blob/master/openrndr-ffmpeg/src/main/kotlin/org/openrndr/ffmpeg/VideoWriter.kt>

Maybe something like this will work?

```auto
fun main() = application {
  configure {

  }
  program {
    val byteBuffer = BufferUtils.createByteBuffer(width * height * 4)
    val rt = renderTarget(width, height) {
        colorBuffer()
    }
    val buffer= rt.colorBuffer(0) as ColorBufferGL3
    extend {
      // draw on rt
      byteBuffer.rewind()
      byteBuffer.order(ByteOrder.nativeOrder())
      rt.colorBuffer(0).read(byteBuffer)
      byteBuffer.rewind()
      val intBuffer = byteBuffer.asIntBuffer()
      server.publishFrameTexture(intBuffer.get(0), buffer.texture, 0, 0, width, height, width, height, false);
    }
  }
}

```

---

<div class="post-metadata">

**Author:** ![Tom\_Peak](https://yyz2.discourse-cdn.com/free1/user_avatar/openrndr.discourse.group/tom_peak/32/37_2.png) [@Tom\_Peak](https://openrndr.discourse.group/u/Tom_Peak)\
**Post date:** [December 31, 2019, 4:25pm UTC](https://openrndr.discourse.group/t/share-openrndr-window-as-texture-syphon-bridge/38/3 "2019-12-31T16:25:28Z")

</div>

You meen:  
extend {  
movingCircle.updateAnimation()  
rt.bind()  
drawer.background(ColorRGBa.WHITE)  
drawer.fill = ColorRGBa.PINK  
drawer.stroke = null  
drawer.circle(Vector2(movingCircle.x, movingCircle.y), movingCircle.radius)  
rt.unbind()  
drawer.image(rt.colorBuffer(0))  
byteBuffer.rewind()  
byteBuffer.order(ByteOrder.nativeOrder())  
rt.colorBuffer(0).read(byteBuffer)  
byteBuffer.rewind()  
val intBuffer = byteBuffer.asIntBuffer()  
server.publishFrameTexture(intBuffer.get(0), buffer.texture, 0, 0, width, height, width, height, false);  
}

Still a black screen on [https://github.com/Syphon/Simple](https://github.com/Syphon/Simple)

 ![Screenshot 2019-12-31 at 17.20.59](https://global.discourse-cdn.com/free1/uploads/openrndr/original/1X/ffa20ac8aa91d71f32cf571a38e46c53f196dac6.png)  
The resolution should be displayed under “Simple Client” [–]

Honestly i was an this trace with no success, the GL3 things were missing in my chase. (gradle compile gl3) I hoped that this would work out, do you tested it?

---

<div class="post-metadata">

**Author:** ![Tom\_Peak](https://yyz2.discourse-cdn.com/free1/user_avatar/openrndr.discourse.group/tom_peak/32/37_2.png) [@Tom\_Peak](https://openrndr.discourse.group/u/Tom_Peak)\
**Post date:** [January 15, 2020, 4:58pm UTC](https://openrndr.discourse.group/t/share-openrndr-window-as-texture-syphon-bridge/38/4 "2020-01-15T16:58:15Z")

</div>

Holidays are over, let’s have a look at this [Array textures - OPENRNDR GUIDE](https://guide.openrndr.org/advancedDrawing/arrayTextures.html) next days… keep you uptodate.

---

<div class="post-metadata">

**Author:** ![Tom\_Peak](https://yyz2.discourse-cdn.com/free1/user_avatar/openrndr.discourse.group/tom_peak/32/37_2.png) [@Tom\_Peak](https://openrndr.discourse.group/u/Tom_Peak)\
**Post date:** [February 3, 2020, 4:12pm UTC](https://openrndr.discourse.group/t/share-openrndr-window-as-texture-syphon-bridge/38/5 "2020-02-03T16:12:45Z")

</div>

Good to have Magic Friends

```
       byteBuffer.rewind()
       byteBuffer.order(ByteOrder.nativeOrder())
        rt.colorBuffer(0).read(byteBuffer)
        byteBuffer.rewind()
        glBuffer.read(byteBuffer)

        server.publishFrameTexture(glBuffer.texture, glBuffer.target , 0, 0, width, height, width, height, false)

```

glBuffer is a ColorBufferGL

Thx @seclorum

---

<div class="post-metadata">

**Author:** ![edwin](https://avatars.discourse-cdn.com/v4/letter/e/73ab20/32.png) [@edwin](https://openrndr.discourse.group/u/edwin)\
**Post date:** [March 13, 2020, 12:52pm UTC](https://openrndr.discourse.group/t/share-openrndr-window-as-texture-syphon-bridge/38/6 "2020-03-13T12:52:25Z")

</div>

We have (somewhat) recently added `orx-syphon` which should make it super easy to both send and receive Syphon surfaces. [orx/orx-jvm/orx-syphon at master · openrndr/orx · GitHub](https://github.com/openrndr/orx/tree/master/orx-jvm/orx-syphon)

---

<div class="post-metadata">

**Author:** ![Tom\_Peak](https://yyz2.discourse-cdn.com/free1/user_avatar/openrndr.discourse.group/tom_peak/32/37_2.png) [@Tom\_Peak](https://openrndr.discourse.group/u/Tom_Peak)\
**Post date:** [May 5, 2020, 12:51pm UTC](https://openrndr.discourse.group/t/share-openrndr-window-as-texture-syphon-bridge/38/7 "2020-05-05T12:51:53Z")

</div>

WOW, thats great!

Thanx!

---

<div class="post-metadata">

**Author:** ![timesareweird](https://yyz2.discourse-cdn.com/free1/user_avatar/openrndr.discourse.group/timesareweird/32/311_2.png) [@timesareweird](https://openrndr.discourse.group/u/timesareweird)\
**Post date:** [November 22, 2022, 6:10pm UTC](https://openrndr.discourse.group/t/share-openrndr-window-as-texture-syphon-bridge/38/8 "2022-11-22T18:10:08Z")

</div>

Bring this topic back to life. Has anyone been able to get multiple Syphon Servers running? I would like to run multiple OpenRNDR projects and pull them all into Touch Designer. If I run a second project I get this:

TemplateProgramKt  
Warning: Running on macOS without -XstartOnFirstThread JVM argument. Restarting JVM with -XstartOnFirstThread.  
INFO [main] o.o.i.g.ApplicationGLFWGL3 ↘ 3.4.0 Cocoa NSGL Null EGL OSMesa monotonic dynamic  
INFO [main] o.o.Application ↘ no preload class found ‘org.openrndr.Preload’  
INFO [main] o.o.i.g.ApplicationGLFWGL3 ↘ OpenGL vendor: Apple  
INFO [main] o.o.i.g.ApplicationGLFWGL3 ↘ OpenGL renderer: Apple M1 Max  
INFO [main] o.o.i.g.ApplicationGLFWGL3 ↘ OpenGL version: 4.1 Metal - 83

---

<div class="post-metadata">

**Author:** ![abe](https://yyz2.discourse-cdn.com/free1/user_avatar/openrndr.discourse.group/abe/32/700_2.png) [@abe](https://openrndr.discourse.group/u/abe)\
**Post date:** [November 26, 2022, 3:59pm UTC](https://openrndr.discourse.group/t/share-openrndr-window-as-texture-syphon-bridge/38/9 "2022-11-26T15:59:35Z")

</div>

Hi! There is no error in your log message. What is the behavior you are seeing? Is the first texture transmitted but the second one not? Do any of the programs crash?

Here a screenshot showing how to fix that warning (the VM options part):

 ![](https://global.discourse-cdn.com/free1/uploads/openrndr/original/1X/0974099bbc2c1657c4ce1f937bf93f45d0ed2ca2.png)
