www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/02/04/03:00:41

From: mert0407 AT sable DOT ox DOT ac DOT uk (George Foot)
Newsgroups: comp.os.msdos.djgpp
Subject: Re: Allegro mouse question.
Date: Tue, 04 Feb 1997 06:35:35 GMT
Organization: Oxford University
Lines: 35
Message-ID: <32f6d777.55341262@news.ox.ac.uk>
References: <Pine DOT SUN DOT 3 DOT 95 DOT 970203215920 DOT 4287A-100000 AT ernie DOT eecs DOT uic DOT edu>
NNTP-Posting-Host: mc31.merton.ox.ac.uk
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

On Tue, 4 Feb 1997 04:04:33 GMT, Andrew Deren <aderen AT eecs DOT uic DOT edu>
wrote:

>I am planning to  writea game that requires a mouse for pointing
>things, and I am having problems with that because in allegro (that's what
>i use and like) you have to hide and show mouse whenever you write to
>screen and I am updating the screen at about 20-30 fps and this causes the
>mouse to disapear and show. Is there some way to blit something to a sreen
>without hidding mouse pointer?
>Thanks in advance.

Presumably, if you're updating the screen that often, you're
synchronising your updates with the vertical retrace. If so, you can
hide the mouse while you update, then redraw it again, without the
user noticing at all. Just wait for the retrace, hide the mouse, then
do *all* the updating as quickly as possible, then show the mouse
again.

eg your main game loop could be:

while (not_finished) {
 game_logic_and_stuff();           /* No screen updates in here */
 vsync();                          /* Wait for the vertical retrace */
 show_mouse(NULL);                 /* Hide the mouse */
 draw_everything_thats_changed();  /* Draw everything that's moved */
 show_mouse(screen);               /* Show the mouse again */
}

Alternatively you might consider buffering the screen, so that your
game_logic_and_stuff() can update this buffer whenever it needs to,
and make draw_everything_thats_changed() just blit this buffer onto
the real screen.

George Foot

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019