Syphon-Framework
Syphon-Framework copied to clipboard
IOSurface Syphon
PR #56 also contains a SyphonIOSurfaceServer, but SyphonServerBase + SyphonSubclassing.h is already enough to obtain a surface from the server, and to publish it (after drawing into it).
SyphonSubclassing could/should therefore be documented.
SyphonSubclassing.h is already documented. Further discussion of its usage is documented in Syphon.h
What more documentation would be helpful?
Well,
- http://syphon.v002.info/FrameworkDocumentation/ does not mention it,
- when trying to find a solution to use raw
IOSurfaceswith Syphon, I did not realise thatSyphonSubclassingalready provides this possibility (together withSyphonServerBase) and is actually easy to use. I do agree that readingSyphonSubclassing.hgives one the most important information. And - the naming
- copySurfaceForWidth:height:optionsis IMHO not helpful in understanding the appropriate use.
(Interestingly, https://github.com/Syphon/Syphon-Framework/blob/master/SyphonServerBase.m#L2 calls SyphonServerBase actually SyphonIOSurfaceServer.m ...)
Other that that, a developer probably wants to know the IOSurface is (currently) always 32-bit (ARGB) w/ premultiplied alpha.
(As using raw IOSurfaces with Syphon is AFAIUI not encouraged, probably no code sample of how to use it e.g. with a CGBitmapContext should be given (?).)
- yes we should update (or delete) the documentation website (move the content of Syphon.h into README.md maybe?)
- I'll try to improve visibility of documentation for the not-Metal, not-OpenGL options for custom servers and clients
- the name has to begin with 'new' or 'copy' to indicate via Objective C naming conventions that the surface is returned retained. Neither is perfect - perhaps 'new' is better than 'copy'.
I've corrected a couple of comments which had the old name for SyphonServerBase, and documented the surface format - 45ccfcd02b0cea37f20abe3cd5483fd5c313c95b and b147668b6dbbea1619bffa3b2ecb8bc24ade7de4.