Mail Archives: djgpp/2001/03/07/14:36:37
| From:  | aek AT digitalanime DOT com
 | 
| Newsgroups:  | comp.os.msdos.djgpp
 | 
| Subject:  | allegro mouse problem
 | 
| Date:  | Wed, 07 Mar 2001 19:34:17 GMT
 | 
| Message-ID:  | <3aa686a1.4801516@news.dingoblue.net.au>
 | 
| X-Newsreader:  | Forte Free Agent 1.21/32.243
 | 
| Lines:  | 42
 | 
| NNTP-Posting-Host:  | 198.142.75.188
 | 
| X-Trace:  | 983992837 news01.syd.optusnet.com.au 25469 198.142.75.188
 | 
| To:  | djgpp AT delorie DOT com
 | 
| DJ-Gateway:  | from newsgroup comp.os.msdos.djgpp
 | 
| Reply-To:  | djgpp AT delorie DOT com
 | 
hi, im having some problems with the code below
its purpose is to draw circles using mouse clicks
first it collects the starting (x1,y1) co-ordinates.. then the second
time mouse b1 is pressed it gets (x2,y2) then calculates the radius,
then draws the circle... but if i try reset the got_click flag all i
get is 'mouse droppings' when i press mouse b1. 
i think it might be the kb interupt butting in when it shouldnt..
i tried to use mouse_pos instead and didnt have any luck but im sure
im doing something wrong when using mouse_pos.
any help, suggestions, comments or flames are greatly appreciated :)
- - Josh
show_mouse(screen);
while (!keypressed())
{
    if (mouse_b & 1)
    {
        if (got_click)
        {
            x2 = mouse_x;
            y2 = mouse_y;
            radius = calc_radius(x1,y1,x2,y2);
            scare_mouse();
            circle(screen,x1,y1,radius,255);
            unscare_mouse();
            got_click = 0;  //commenting this out lets it work but im
                              //stuck with the same x1,y1 co-ordinates
        }
        else
        {    
             x1 = mouse_x;
             y1 = mouse_y;
             got_click = 1;
        }
    }
    vsync();
}
- Raw text -