You may want to run the canvas update off a timer instead.
Your version sucks up 100% of my CPU time. This version appears to idle between 8 and 16% on my computer.
Just a thought :-)
Strict Local MyWindow:Tgadget = CreateWindow("Canvas",200,200,800,600) Local MyCanvas:Tgadget = CreateCanvas(10,10,800,600, Mywindow) SetGraphics CanvasGraphics(MyCanvas) ActivateGadget(MyCanvas) ' enable the canvas gadget Local timer:TTimer = TTimer.Create(60) ' 60 FPS timer (or there abouts) Repeat WaitEvent() Select EventID() Case EVENT_TIMERTICK ' RedrawGadget(MyCanvas) Case EVENT_GADGETPAINT Cls ' draw stuff here Flip Case EVENT_KEYDOWN ' check for "gui" key down events If EventData() = KEY_ESCAPE Then End Case event_windowclose End End Select Flip Forever
Your version sucks up 100% of my CPU time. This version appears to idle between 8 and 16% on my computer.
Just a thought :-)