Skip to main content

Segment activation

3 replies [Last post]
rdecker
Offline
Joined: 2009-02-25
Points: 0

I have a grin app in which I programmatically activate an empty segment to clear the screen. It takes a bit for the empty segment to activate. I have called getCurrentSegment, waiting for the empty segment to be current. When it says the empty segment is now current,I call repaint in the component where the show was playing out to clear the screen. The features of the previous segment will sometimes still be present when the repaint occurs and the screen won't clear. Other times the repaint never occurs but I think this latter issue is in the underlying jvm.

I am not sure if this is the proper way to clear the screen. Is there a way to ensure a segment is fully active and that it is safe to repaint? Is there another way to clear the screen of features?

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
chihiro_saito
Offline
Joined: 2006-11-08
Points: 0

It sounds like you have other entities besides GRIN that are drawing on the screen.

Have you tried using RepaintDrawEngine as opposed to DirectDrawEngine?

Chihiro

rdecker
Offline
Joined: 2009-02-25
Points: 0

I've tried both engines. I use a check of the scene to see if it double buffered (which it is) so it using RepaintDrawEngine in this case.

There is a video layer beneath the show. I also have more than one show and am switching between them but they both use the same engine and buffer. I drop to an empty segment on one and initialize the other. I would think the one dropping to an empty segment would consider it's previous segment features damaged and repaint but it doesn't.

When it fails I get this message: (Model update ran long: 33ms.)

So it skips the frame that clears the buffer but in this case the frame is critical. I am doing some heavy work in the background. If I pause the engine and start it again after this work completes it may help to ensure the frame is not skipped.

What I really need is to ensure without doubt the empty segment not only activated but cleared the screen.

rdecker
Offline
Joined: 2009-02-25
Points: 0

If I use an InterpolatedModel to move feature around a screen on each move the previous position is still painted so that there is one feature per move.

I noticed that the bookmenu example was doing something similar where it would leave selections on the screen after they were chosen. I upgraded after the fix for z-order and redisplay and the bookmenu problem went away. But my code still has the issue.

This isn't really a z-order issue since the feature is the only thing on the screen and rather small compared to the screen size, which is the component size for the animation engine. It just seems to not mark the previous position as damaged.