On 4 May 2012 23:23, Martin Drautzburg <[email protected]> wrote:
> On Friday, 4. May 2012 18:01:47 Igor Stasenko wrote:
>
>> hard to say.. apparently every morph should be drawn only once per step.
>> probably you mixing stepping and drawing/updating?
>>
>> during stepping you should change some state, like advance the
>> counters, do some calculations etc..
>> and then _just_ invalidate morphs which need to be redrawn, but do not
>> draw them directly.
>
> Except for a few lines I don't draw anything myself. I just intercepted
> drawOn: in myMorphs so I could count the calls. Assuming each Morph is drawn
> once  per step, the counts I get are plausible and I see that don't get
> redraws for morphs which are invisible.
>
> I just don't know if 0.2 msec for drawing a single morph is as good as its
> gets. It is several hundred thousand CPU cycles per Morph. Even when you
> assume 100 pixels per Morph, it is still a few thousand clock cycles for a
> single pixel.
>

may i ask you, what is your plans?
say, you want to implement a particle system which can be animated at
decent frame rate,
or something more complex?
you know, there's always workarounds.. like in case of particles,
instead of creating separate
morphs for each of them, just use single morph and draw them in own
#drawOn: method
for morph which will represents your scene..

what i meant to say, that you don't have to stick with morphic , if
you there some heavy number-crunching,
or a lot of drawings per frame.

> I made another test, where I just move 100 Morphs inside a Rectangle around. I
> got comparable speed, i.e. morphic was not always able to catch up with the
> screen refresh rate. In this case the movement was a lot faster when there was
> nothing else on the screen, when it moved over a Browser it slowed down quite
> a bit, which is understandable. My scrolling thingy however does not move
> across the whole screen, so morphic should have a bit less work.
>
> Invalidating:
>
> Do I invalide the Morph itself or its parent? If a Morph moves, the space it
> occupied before the move has to be redrawn too. Or do I invalidate it before
> and after the move?
>

i think if you using right method's to change morph's position, it
should handle it automatically,
so you don't have to worry about it by yourself.
(see Morph>>position:)

> @Hilaire
>
>>And what about using PasteUpMorph with an unique step in the message
>>taking care of the update of the submorphs?
>
> What would be the advantage of doing this? Doesn't the "World" take care of
> updates well enough?
>
> --
> Martin
>



-- 
Best regards,
Igor Stasenko.

Reply via email to