Lee Brown <[EMAIL PROTECTED]> writes:
> What if the screen changes behind the cursor?  Say you have a cursor sitting
> there and then a line goes through it.  Now you have a line through
> the cursor.

no, you draw the line in memory first, but the mousecursor to the
screen directly.  the following functions all use
"function(dest,source)":

while (1) {
  draw_lines (memory, lines);
  draw_other_things (memory, lines);
  restore_screen_at_mouse_cursor (visual, mouse_memory);
  copy_memory_to_screen (visual, memory);
  draw_mouse_cursor (visual);
  save_mouse_cursor (mouse_memory, visual);  
}

if 'copy_memory_to_screen' blits the entire screen, there's no need to
call 'save_mouse_cursor' and 'restore_screen_at_mouse_cursor'; but
it's faster to have 'copy_memory_to_screen' only draw dirty
rectangles, and then you have to save and restore the mouse cursor,
which was what i tried to explain previously.

you have to mark the dirty rectangles during 'draw_lines' and
'draw_other_things' of course.  if you draw a lot of little objects it
may be better to not use dirty rectangles.

perhaps i'm completely off though, hope someone will correct me
quickly :-)  my previous post was indeed very unclear.

-- 
Tijs van Bakel, <[EMAIL PROTECTED]>

Reply via email to