Original Post
So yeah, this should be simple but idk it just isnt working, im stumped. Trying to get LastDrawnx and LastDrawny to smoothly follow Mousex,Mousey so when ondraw is called it draws it smoothly. (for drawing a line) The code below would be in a while loop with something like while(dis>1) so it loops till it gets close(incase of fast mouse movement causing effects to look weird.) mOffsetx=Mousex-LastDrawnx; mOffsety=Mousey-LastDrawny; float fx=(float)mOffsetx; float fy=(float)mOffsety; float legth =sqrt( (fx*fx) + (fy*fx) ); if(((int)legth)!=0) { mOffsetx/=(int)legth; mOffsety/=(int)legth; } LastDrawnx+=mOffsetx; LastDrawny+=mOffsety; CSurface::OnDraw(Surf_Display, Surf_Brush, LastDrawnx,LastDrawny); it sorta gets to the mouse....but it acts all random and doesnt follow a pattern to my mouse.