Path: utzoo!utgpu!water!watmath!dalcs!garfield!john13 From: john13@garfield.UUCP (John Russell) Newsgroups: comp.sys.amiga Subject: Dealing with lots of messages Keywords: messages IDCMP MOUSEMOVE Message-ID: <4346@garfield.UUCP> Date: 5 Jan 88 23:52:07 GMT Distribution: na Organization: CS Dept., Memorial U. of Newfoundland, St. John's Lines: 35 None of the messages on dealing with many messages (esp. mousemove) from one or more ports has mentioned a very simple technique that can speed up response time greatly. It goes something like this (this is from memory): msg = GetMsg(window->UserPort); class = msg->Class; x = msg->MouseX , y = msg->MouseY; ReplyMsg(msg); switch(class) { case MOUSEMOVE: if (window->MouseX != x || window->MouseY != y) /* user has moved the mouse since this message so I will ignore it */ break; else } By doing this you can minimize the number of redraws (say when rubberbanding a line). It gives a really great speedup when applied to a time-consuming interactive operation, eg dragging a DPaint-style curve around the screen. If you try to process all movement messages for that, you can easily move the mouse enough so that it will take >10 seconds for the drawing to catch up. John -- "I hate to be the one to tell you this, Bryce, but there's more to life than interactive systems analysis." "I know. It also involves number crunching!" -- Max Headroom