Message-ID: From: Shawn Hargreaves To: djgpp AT delorie DOT com Subject: Re: Interrupt Handler Date: Tue, 14 Apr 1998 10:25:40 +0100 MIME-Version: 1.0 Content-Type: text/plain Precedence: bulk Robert Robbins writes: > I want to execute a function which uses putpixel while a sprite can > still be moved with the arrow keys. ALLEGRO's install_int function > only illustrates using a counter. Just because the Allegro timer example is a counter, that doesn't mean you are unable to replace this with different code of your own! The timer callback is just a C function, so you can easily insert whatever instructions you like inside it. Many internal parts of Allegro use timers for various things like this: look at the pointer display code in mouse.c, the music playback code in midi.c, or the double-click detection code in gui.c. I must advise against drawing to the screen from inside a timer interrupt, though. This will only work reliably if the main program doesn't ever touch the screen itself, because the SVGA bank switching code will get very confused if your timer code interrupts some other drawing operation. The Allegro graphics functions are in general not reentrant, so this is likely to cause you a lot of grief. Shawn Hargreaves.