From: "ken" Newsgroups: comp.os.msdos.djgpp References: <199811052246 DOT WAA05174 AT remus DOT clara DOT net> Subject: Re: Allegro vsync stuff Date: Sun, 8 Nov 1998 01:55:36 -1000 Lines: 34 X-Newsreader: Microsoft Outlook Express 4.72.3110.5 X-MimeOLE: Produced By Microsoft MimeOLE V4.72.3110.3 X-NNTP-Posting-Host: 204.210.109.117 Message-ID: <364419ac.0@news.hawaii.rr.com> X-NNTP-Posting-Host: 204.210.96.14 NNTP-Posting-Host: 204.210.96.14 X-Trace: 7 Nov 1998 01:55:12 -0800, 204.210.96.14 To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com It is kind of silly to update the screen too often. Simplest thing to do is hook to 18.2/sec bios interrupt and wait for retrace after that. Another method would be to draw things to ram, then dump it to video. If you do that, then you probably don't even have to wait for the retrace (assuming you only need to update 10-30 times a sec.) Arthur wrote in message <199811052246 DOT WAA05174 AT remus DOT clara DOT net>... >> At 300 fps, what you could do is check the vsync bit for each frame, >> and only redraw if the bit is set, else if 10 frames go by and you >> don't see the bit, redraw anyway. Or, use the vsync interrupt to set >> a flag that says "redraw this time" then reset the flag when you >> redraw. If you recalculate and the flag isn't set, just skip the >> redraw and recalculate again. > >I'd always used this method on the Atari ST, but had heard that the PC >didn't allow this technique due to hardware limitations. Can you tell me how >to do this in more detail please, or where to find information on it? > >Another method is to link it to a timer. For instance, if you know that your >monitor runs at 60Hz (that is, 60 retraces per second), then use a timer to >tell you when your monitor is nearly about to redraw (for instance at >59/60ths of a second - but fiddle with this value until you get the best >results) and then redraw followed by a vsync(). > >James Arthur >jaa AT arfa DOT clara DOT net >ICQ#15054819 > >