[PD] [Gem] Using [text2d] in single buffer mode

Roman Haefeli reduzent at gmail.com
Thu Sep 15 17:58:03 CEST 2016


Hey all

I'm working on patch that displays a lot (30 lines, 76 chars per line)
of text in a Gem window using [text2d]. I observed that CPU usage
increases proportional to the string length sent to [text2d]. It
appears to me that [text2d] renders the given string for each frame.
The fact that frame rate and CPU usage are proportional, too, confirms
this assumption. 

Now, I'd like to make my patch less CPU hungry and thought about
switching to single buffer mode, since it would be sufficient to update
the gemwin only when the text changes, which is far less often than
running gemwin at any fixed frame rate. Now my real problem begins.
Whenever the text/string changes, I clear the buffer, send the string
to [text2d] and bang the [gemhead], so that the display is refreshed
(in this exact order). However, when I perform this steps in zero
logical time, I get a blank screen. Only when I delay the bang to
[gemhead] by a few milliseconds, I get text in the gemwin. 

I just noticed now that this is not related to [text2d] at all, but
seems an issue between [gemwin] and [gemhead]. [gemhead] can't render a
certain amount of time after [gemwin] has been cleared. Is there a way
to know when [gemhead] is ready to render (or when [gemwin] has
finished clearing)?

Roman

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 473 bytes
Desc: This is a digitally signed message part
URL: <http://lists.puredata.info/pipermail/pd-list/attachments/20160915/b06d5f3a/attachment.sig>


More information about the Pd-list mailing list