Computer Science Canada

PC freezing with Mouse.Where

Author:  Ninja [ Sat Jun 17, 2006 8:53 am ]
Post subject:  PC freezing with Mouse.Where

hey guys. im having a slight problem with my project. I have a process for mouse detection :

code:
process mouse
    loop
        Mouse.Where (x, y, b)
        if x > 7 and x < 164 and y < 456 and y > 433 and b = 1 then
            Pic.Draw (screen2, 0, 0, 0)
        end if
end loop
end mouse
fork mouse


Everytime i run my program, my whole pc freezes for 3 seconds when i click on a button to load another screen. Is there any other way i can do mouse detection at all times without having it as fork mouse, cause i know thats whats freezing the pc. Thanks Very Happy

Author:  HellblazerX [ Sat Jun 17, 2006 9:45 am ]
Post subject: 

Don't use processes. Didn't you read Cervante's reasons as why you shouldn't use process? You should put the Mouse.where in your main loop, not in a separate process.

Author:  DIIST [ Sat Jun 17, 2006 9:57 am ]
Post subject: 

Also on an added note, you might want to include a delay some where in the loop to slow down the fps. I noticed on some old computers when you dont delay and you draw stuff on the screen a hundred times while getting input, it seems to freeze! But hey it just may be a problem with my computer Rolling Eyes

Author:  Ninja [ Sat Jun 17, 2006 10:23 am ]
Post subject: 

HellblazerX wrote:
Don't use processes. Didn't you read Cervante's reasons as why you shouldn't use process? You should put the Mouse.where in your main loop, not in a separate process.


Dang i always forget to look under old posts lol. Sorry bro my bad. Well like u said i removed the process and just put in a main loop in my main program part, it works fine now. Thanks for the help Very Happy. Much appreciated as always

Author:  Reality Check [ Sat Jun 17, 2006 12:35 pm ]
Post subject: 

Yes don't use processes unless you ABSOLUTELY have to. Just stick the Mouse.Where in the top of your loop. The code of your entire program would help.


: