
-----------------------------------
Ninja
Sat Jun 17, 2006 8:53 am

PC freezing with Mouse.Where
-----------------------------------
hey guys. im having a slight problem with my project. I have a process for mouse detection : 

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 :-D

-----------------------------------
HellblazerX
Sat Jun 17, 2006 9:45 am


-----------------------------------
Don't use processes.  Didn't you read Cervante's [url=http://www.compsci.ca/v2/viewtopic.php?t=7842]reasons as why you shouldn't use process?  You should put the Mouse.where in your main loop, not in a separate process.

-----------------------------------
DIIST
Sat Jun 17, 2006 9:57 am


-----------------------------------
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 :roll:

-----------------------------------
Ninja
Sat Jun 17, 2006 10:23 am


-----------------------------------
Don't use processes.  Didn't you read Cervante's 

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 :-D. Much appreciated as always

-----------------------------------
Reality Check
Sat Jun 17, 2006 12:35 pm


-----------------------------------
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.
