PocketMatrix forums

A read-only archive of the PocketMatrix forums (2001–2014). Posting and accounts are closed.

Screen Wipe

Hi!
I can not understand, how to use Wipe.
Do I have to put StartWipe(0) on OnInit,
and Wipe(destanation, source, EWIPE_SLIDELEFT,0, NULL, 0) on OnNextFrame?
I've tried different combinations but program always breaks with an error so I wondering what am I doing wrong.
Hi Ryumaster,

You need to call StartWipe() inside OnDisplayInit(), because the display isn't initialized in OnInit() yet.

I hope this helps.

BTW,
I've also added a solution for the hss.dll problem in the 3.10 version release topic.
Hi!
Error was because of my mistake, and now test program runs without error breaks. But there is no screen wipe I can see. Am I doing the right sequence?

1. I'm creating 3 different surfaces 240X320.
2. Then: StartWipe(1) on DisplayInit.
3. Then: display->Wipe(&srf2;, &srf1;, &srf3;,0,1,0,0) on OnNextFrame;
All I can see is the black screen. Maybe I have to use WipeScreenMap too, because I can not figure out what is that function for. Or maybe I have to update timer function manually somehow?
Hi Ryumaster,

For the wipe to work you need to set the fourth parameter to a time value between 0 and 65535.

The best way is to use a timer variable, and increase it every frame with the timedelta value you receive from OnNextFrame(). MapScreenWipe() is only needed for certain wipe types (EWIPE_BLOCKS and EWIPE_SCREEN).
Thank You, now I understand how this handy function works. By the way, what is StartWipe exactly for? Wipe works fine even if I comment it, like it does nothing.
Hi Ryumaster,

The StartWipe() function is only used for certain wipes. For example, when using EWIPE_BLOCKS, it will reset its internal state (it needs to know which blocks/pixels to draw for each frame).
Hi,

If we want to use wipe() API,
Can we use pixelate wipe type with "RGBA" surface?

If not, do you have suggestion if we strongly need to use alpha surface?

Thanks,
mamahow
Hi,

Do you need to wipe from RGBA to RGBA, or from RGBA to a normal RGB surface?
Hi,
Yes, We need both of these two operations.
Hi,

Unfortunately, the only way to achieve this with good performance is to program your own wipe. The pixelate wipe works like this:
- Divide the image into several blocks (depending on the wipe size)
- Use fillrect on each block with a certain color on the destination surface
- The color is retrieved from the center of the block in the original image
sunfred · 10 Nov 2008, 03:36 UTC — about wipe()
1. I'm creating 3 different surfaces 240X320.
2. Then: StartWipe(1) on DisplayInit.
3. Then: display->Wipe(&srf2;, &srf1;, &srf3;,1000,1,0,0) on OnNextFrame;

i followed the step,but i can not see the result.
Hi Sunfred,

Are you blitting the third surface to the backbuffer after step 3? It is needed, because only the backbuffer is shown onscreen, the other surfaces are invisible. In your example, it can be more efficient to only create the first two surfaces, and set the destination surface always to the backbuffer.

Also, instead of using the numer '1000' as the fourth parameter, use a timer variable (unsigned long). Set it to 0 at the start of the wipe, and add timedelta to it every frame. This makes the wipe animate.