Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

DirectDraw: tile based scrolling & Blt vs BltFast

83 views
Skip to first unread message

Daniele Benegiamo

unread,
Sep 3, 1996, 3:00:00 AM9/3/96
to

Hello,

someone is developing a tile based scrolling with DirectDraw?

I'm developing a multi-directional tile based scrolling in 640x480x8
but something go wrong:

My scrolling go to 12 FPS :((((. Foxbear go to 60 FPS with only
horizontal scrolling but with 3 parallax levels!

In my scrolling I use Blt method instead of BltFast method. Can be
this the problem? Else, what other problems can speed down my
scrolling?

Bye, Daniele Benegiamo (Underground Technologies). <bene...@aleph.it>


Mark Feldman

unread,
Sep 3, 1996, 3:00:00 AM9/3/96
to

Daniele Benegiamo wrote:
>
> Hello,
>
> someone is developing a tile based scrolling with DirectDraw?

No, but I might be able to help anyway.

> I'm developing a multi-directional tile based scrolling in 640x480x8
> but something go wrong:
>
> My scrolling go to 12 FPS :((((. Foxbear go to 60 FPS with only
> horizontal scrolling but with 3 parallax levels!
>
> In my scrolling I use Blt method instead of BltFast method. Can be
> this the problem?

Unlikely. According to the docs the software implementation of BltFast
is only 10% faster than Blt (no difference with hardware acceleration).

> Else, what other problems can speed down my scrolling?

You might have too many graphics. Sprites are typically stored in video
memory because they are faster to blt that way. Once you run out of
video ram DirectX has to store them in main memory and you start getting
slow downs.

If you're using the system timer for refresh then that might be the
culprit. Try rewriting your inner loop so that your refresh routine
gets called after each message is dispatched (regardless of whether
there are more messages in the queue or not). Just don't do a PostMessage
anywhere in your render code or the message queue will quickly fill up.

Good luck,

----------------------------------------------------------------------
Mark Feldman mailto: pc...@ix.netcom.com

Victor Putz

unread,
Sep 4, 1996, 3:00:00 AM9/4/96
to

>>My scrolling go to 12 FPS :((((. Foxbear go to 60 FPS with only
>>horizontal scrolling but with 3 parallax levels!

Well, first off: FoxBear cheats tremendously (grin), particularly
in its use of solid-color bitmaps, which it fills using hardware
blit-filling rather than block transfers. Don't let that fool
you, though-- 12 fps is ridiculous, so something is up.

I'm doing multilayer parallax scrolling in yakIcons 4.0 with
really bad overdraw (just about drawing the entire area three
times) in a 640x480 window in 1024x768 and getting over 20 fps.
With a single layer it goes to about 48-50 fps. However, I think
I know what the problem may be.

Check your startup code carefully. Before creating surfaces using
a DIRECTDRAWSURFACEDESC structure (ddsd), be sure to zero-fill
the structure before creating your surface. This is not documented
in the help or doc files, but it is necessary; failure to do so
results in most surfaces created in system memory and a dramatic
slowdown in frame rate. No, the sample programs usually don't
do it (at least in source), so I'm not sure what the deal is exactly,
but I made this modification with excellent results.

-->VPutz

ps: BltFast should only get a small increase in speed, using
software emulation only, ie hardware Blts should be unaffected
by BltFast-- and if Foxbear is getting ~60 fps, I'd say you're
using hardware acceleration.


Daniele Benegiamo

unread,
Sep 6, 1996, 3:00:00 AM9/6/96
to

bene...@aleph.it (Daniele Benegiamo) wrote:

> Hello,

>someone is developing a tile based scrolling with DirectDraw?

>I'm developing a multi-directional tile based scrolling in 640x480x8
>but something go wrong:

>My scrolling go to 12 FPS :((((. Foxbear go to 60 FPS with only


>horizontal scrolling but with 3 parallax levels!

>In my scrolling I use Blt method instead of BltFast method. Can be
>this the problem? Else, what other problems can speed down my
>scrolling?

>Bye, Daniele Benegiamo (Underground Technologies). <bene...@aleph.it>

Thanks to everybody for your help.

Well, I have discovered that hardware clipping is a BAD thing:

1) If a surface have a clipping object associated, BltFast can't be
used (it return DDERR_UNSUPPORTED error and other codes).

2) without it now I go to 28 fps (versus old 12). But it's too down:
under DOS I can go to 43 fps.

Thanks to Victor Putz about tha fact that Foxbear go to 60 fps because
a lot of his tiles are "empty tiles", that means that the blitter fill
them in hardware without perform any memory read.

But I go too slowly: I keep both primary and back surfaces into VRAM,
(for now) I keep also all tiles into VRAM, I don't use hardware
clipping and for tiles (for now) I don't use any color key.

BltFast method perform in my demo 12000 blits per second but I know
that it can go to 23000 bps but I dont' know because it don't do it
(with another demo I go so). It can be because with the second demo I
draw everytime the same offscreen surface, I will check it.

Have someone other suggestions?

0 new messages