Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 PC freezing with Mouse.Where
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
Ninja




PostPosted: 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
Sponsor
Sponsor
Sponsor
sponsor
HellblazerX




PostPosted: 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




PostPosted: 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 Rolling Eyes
Ninja




PostPosted: 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 Very Happy. Much appreciated as always
Reality Check




PostPosted: 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.
Display posts from previous:   
   Index -> Programming, Turing -> Turing Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 5 Posts ]
Jump to:   


Style:  
Search: