On Sat, Feb 5, 2011 at 3:44 PM, Mathieu Bouchard matju@artengine.ca wrote:
On Tue, 25 Jan 2011, Rich E wrote:
Ah, understood. Thanks for the nice code explanation and references...
they both really help. I noticed that t_canvasenvironment remains privately defined, so it's difficult to use this struct. To get the dollarzero, I saw this works:
canvas_setcurrent(x_canvas); int dzero = canvas_getdollarzero();
That's an alias of pd_pushsym. You are supposed to use it with canvas_unsetcurrent (alias of pd_popsym), though I don't remember what can really go wrong if you don't unset/pop.
Lots of stuff goes wrong if you don't call canvas_unsetcurrent after setting it. :) I know because I was running into all sorts of EXC_BAD_ACCESS signals before doing it - specifically in some experiments in opening patches via x_canvas points. Thanks for the tip, Mathieu. I actually got a couple other questions now that I have figured out a bit more, but I'll save it for another thread..
Cheers, Rich