On 29.11.2016 10:04 Daniele Lugli wrote:
> Using fltk I would like to display images coming asynchronously from a
> separate capture thread (c++11 std::thread, already coded and tested).
>
> At present I'm doing something similar with wxwidgets. The capture
> thread prepares an entry in a shared ring buffer, then queues a custom
> event which is processed by an event handling function by the main loop.
>
> What is the right way to do this with fltk?
Technically it's the same, but see Ian's post for much more good
information.
> Am I missing something more recent?
Likely not.
> Have the long discussions been frozen to an up-to-date manual page /
> example / tutorial?
Did you see/read the "Advanced FLTK" chapter in the FLTK docs?
http://www.fltk.org/doc-1.3/advanced.html
That would be a good start and should answer most of your questions. It
has been improved very much since the discussions mentioned by you. I
think you should particularly have a look at calling Fl::awake( ... )
with a callback which is the most reliable and recommended way to send
informations from a worker thread to the main (GUI) thread and have the
main thread (in the callback) do the display update.
> Any pointer / suggestion?
The long threads you mentioned above may give you some hints, but again,
while I was writing this (and was interrupted for a while) Ian posted a
long reply, and I think he said it all...