Re: Help needed in designing a Game
From: Corey Murtagh (emonk_at_slingshot.no.uce)
Date: 05/10/04
- Next message: Nick Landsberg: "Re: When is a stack used in real life?"
- Previous message: Roger Willcocks: "Re: thoughts on an approach"
- In reply to: Gerry Quinn: "Re: Help needed in designing a Game"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Mon, 10 May 2004 12:41:13 +1200
Gerry Quinn wrote:
<snip>
> If you draw everything by erasing and redrawing the whole image, you
> will get flicker. There are ways to fix this, the simplest being to
> draw to an off-screen image, then copy it to the screen.
Well, simplest is to /not/ erase before redrawing. Can lead to
interesting screen tearing artifacts though.
Double Buffering is very useful, but can also be a touch slow. If you
have a largely static display with just a few sprites and some status
display being changed between frames, copying the whole frame to video
memory might be much more expensive than keeping track of the areas that
need updating (old and new positions of sprites, etc) and drawing those
directly.
Some GUI code I wrote recently was running a bit slow (about 12ms every
frame to completely redraw an 800x600 display) so I threw some
update-region code in and now it's running on average around .5ms per
frame for an 8% update (median update area for what I'm doing at the
moment). Not bad for a pure Windows GDI app, and no sign thus far of
flicker :>
I figure I could get that down a bit further if I really tried, but it'd
add an order of magnitude to the complexity of my drawing code, so maybe
I'll leave that 'til the rewrite.
Moral of the story though: there's more than one way to skin a CRT.
-- Corey Murtagh The Electric Monk "Quidquid latine dictum sit, altum viditur!"
- Next message: Nick Landsberg: "Re: When is a stack used in real life?"
- Previous message: Roger Willcocks: "Re: thoughts on an approach"
- In reply to: Gerry Quinn: "Re: Help needed in designing a Game"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]