On Fri, 26 Jan 2001, Tijs van Bakel wrote:
> Lee Brown <[EMAIL PROTECTED]> writes:
Thanks for your input. I'm writing more or less 4 routines.
LoadCursor(vis, cursor); <-- loads a cursor, nuff said
ShowCursor(vis); <-- saves rectangle and draws cursor
HideCursor(vis); <-- replaces rectangle
MoveCursor(vis); <-- Hides at one spot and shows at another
That'll be the functionality of the four routines, whether its a hardware
cursor or a software cursor. This way the environment can keep track of
when it needs to refresh the cursor, the low level graphics doesn't care.
i.e. ggiDrawLine doesn't care if the cursor is there or not, that's up to the
windowing scheme.
Make sense?
I always like it when people respond back. It's so much more productive and fun.
Lee
> > 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]>
--
Lee Brown Jr.
[EMAIL PROTECTED]