Hi,
I'm using the pd structs and drawpolygon and get nasty flickering when intersecting objects of different colors are redrawn periodically as they're always redrawn on top of each other. In order to prevent that I'd like to either
put an opaque canvas (maybe in a subpatcher) on top of it until all objects are redrawn and then clear the canvas.
have an option like "visible/invisible" for a canvas which has the "graph on parent" enabled.
use any other method making it possible to redraw off-screen and then throw the completed image on the screen.
The opaque canvas method doesn't seem to work as new objects even in a canvas below the opaque canvas will get redrawn on top of it.
The second method might work alsa by disabling/reenabling the "graph on parent" feature, but that seems a little dirty (and I don't really know how to access this).
Any ideas?
-- Orm
P.S.: Don't suggest to do it with gem. The overhead is tremendous and it wouldn't work realtime.
hi Orm,
your first method is quite easy to code within an external.
The code is quoted below, in case you would just preferred to add it to some stuff of yours. In case not, I have uploaded a simple, little 'tot' (hope German-speakers will not mind) external to
http://suita.chopin.edu.pl/~czaja/miXed/externs/toys.html
First create [tot <window-name>]. An argument, if given (without a 'pd-' prefix), refers to a patch/subpatch window, and if omitted, then it defaults to the patch window containing the 'tot' object.
Click on 'tot' to hide window contents, click again to bring it back. Or send it 'cover'/'uncover' messages.
Any new item drawn in a covered window is being hidden under the cover as well.
There is another feature that could be handy -- 'tot' accepts any valid tk widget command invoked on the main window's canvas, which means you may draw, paint, write text, animate...
See the included tot-test.pd.
Now, for the code -- it takes just a few lines to cover things:
sys_vgui("canvas .x%x.c.cover -width %d -height %d -bg white -bd 0\n", cv, cv->gl_screenx2 - cv->gl_screenx1, cv->gl_screeny2 - cv->gl_screeny1); sys_vgui("pack .x%x.c.cover\n", cv);
and one line to uncover:
sys_vgui("destroy .x%x.c.cover\n", cv);
where 'cv' might be the 'current-canvas' or any other canvas 'found-by-class'.
Krzysztof
Orm Finnendahl wrote: ...
- put an opaque canvas (maybe in a subpatcher) on top of it until all objects are redrawn and then clear the canvas.
...
The opaque canvas method doesn't seem to work as new objects even in a canvas below the opaque canvas will get redrawn on top of it.
Hallo, Krzysztof Czaja hat gesagt: // Krzysztof Czaja wrote:
The code is quoted below, in case you would just preferred to add it to some stuff of yours. In case not, I have uploaded a simple, little 'tot' (hope German-speakers will not mind) external to
Krzysztof, you're fantabulous! What a crazy external! And it isn't 'tot' at all: "Darling, it moves!"
Frank Barknecht _ ______footils.org__