home *** CD-ROM | disk | FTP | other *** search
- Xref: sparky comp.sys.amiga.misc:18505 comp.sys.amiga.graphics:8022 swnet.sys.amiga:182 alt.sys.amiga.demos:1983 comp.sys.amiga.programmer:17330
- Newsgroups: comp.sys.amiga.misc,comp.sys.amiga.graphics,swnet.sys.amiga,alt.sys.amiga.demos,comp.sys.amiga.programmer
- Path: sparky!uunet!mcsun!sunic!news.lth.se!newsuser
- From: dat91lho@ludat.lth.se (Lars Holmgren)
- Subject: Double-buffering, Strange things going on! HELP ME!
- Message-ID: <1992Dec14.115926.7670@lth.se>
- Sender: newsuser@lth.se (LTH network news server)
- Organization: Dept. of Computer Science, Lund University, Sweden
- Date: Mon, 14 Dec 1992 11:59:26 GMT
- Lines: 45
-
- Gutten hute alle leute! :-)
-
- I'm having some problems with double-buffered
- graphics!
-
- Let's say that I'm doing some 3d-calculations and
- some plotting of stars (or vector-graphics.)
- The main loop would look something like this (pseudo):
-
- loop: swap_screens(1,2)->(2,1)
- show_screen(1)
- clear_screen(2)
-
- calculate_3d
- draw_on_screen(2)
-
- wait_for_Vertical_blanking
- go_to loop
-
- This works perfectly as long as everything runs in
- one frame (or is it field?), 1/50th s. in PAL. If
- the loop needs more time than that it should run
- smooth, but slower! (I know that it's not good, but
- that's not the point!) However, it looks terrible!
- Imagine that I just draw one star and put a delay
- to make the loop slow down enough. This will have
- the effect of seeing _TWO_ stars, one at the old
- position and one at the new! Even if I make the
- delay huge enough to make the loop run just once
- a sec. the star will seem double for 1/50th sec!
-
- HHEELLPP!!
-
- Have you met the same problem?
- Is there a solution?
- Is it my eyes? (And my friends!)
-
- PLEASE HELP!
-
- /Lars
-
- ---------------------------------------------
- Lars Holmgren - dat91lho@ludat.lth.se
- TopasvΣgen 32 (+46)(0)46- 70 99 02
- S-240 21 L÷ddek÷pinge
-