Posted: 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
Sponsor Sponsor
HellblazerX
Posted: Sat Jun 17, 2006 9:45 am Post subject: (No 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.
DIIST
Posted: Sat Jun 17, 2006 9:57 am Post subject: (No 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
Ninja
Posted: Sat Jun 17, 2006 10:23 am Post subject: (No 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 . Much appreciated as always
Reality Check
Posted: Sat Jun 17, 2006 12:35 pm Post subject: (No 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.