Has anyone got P5 to work with Spout?

I am interested in outputting the video created with P5 via Spout.
see: GitHub - jlai/Python-SpoutGL: Python wrapper for SpoutGL
I have this working with Pygame, but I would rather use P5
Any help greatly appreciated.

1 Like

Maybe I could help, but I am not sure what are you trying to do. Can you share some more information on it ?

1 Like

Pygame uses PyOpenGL.
In that environment, I create an off-screen surface (pygame surface), and a OpenGL texture.
I draw to the surface using Pygame methods, and once complete use surfaceToTexture() to provide access for SpoutGL to send the texture.

I am not well versed in OpenGL. I understand P5 uses another library.
Ideally, I would like to draw to an off-screen buffer and access it in OpenGL to send it via SpoutGL.

Not sure if that helps.

1 Like

Apologies for the late reply. I am not sure why I am not getting notifications from Discourse.

I think the new create graphics API in the experimental
skia renderer will help you with the offscreen rendering task.

You can access the surface and canvas of that offscreen buffer and use it.

Also the default sketch’s surface and canvas are directly accessible as well.

Take a look at SkiaSurface and SkiaCanvas in Skia’s docs to convert them into suitable format to send it further