> > [1] If you *really* want to draw on-the-fly data into an existing
> widget, then you can call Fl_Window::make_current() to set up the
> drawing context, but this is *not* recommended. Read the comment
> on make_current() in the docs at
>
> http://www.fltk.org/doc-1.3/classFl__Window.html
>
> about what is called "incremental update".
>
>
> HTH
>
> Albrecht

I suppose for clarity and maybe just to elicit ideas on how you guys
would approach this kind of thing (with FLTK) here are a couple of
imaginary problems:

"AStar Pathfinding" :- Program determines shortest path across a tiled
'map' from point A to B, some of the tiles are 'Walls' and cannot be
walked on (so need to be shown different colour) the shortest path
once found is shown by colouring the relevant tiles in the route,
tiles represented by the coloured drawn rectangles in question!

"Conway Game Of Life"

Apply the game of life algorithm to a tiled 'cells' map representing
the 'world' live cells are coloured green, dead ones grey, with each
generation the cells are updated to live or dead depending on status.

I have done both these problems before using old fashioned 'drawing'
in the old 'direct to screen style as with turbo c BGI graphics, and
also using SDL graphics library image blitting, which i realise is
an easy option for FLTK but i would really like to learn about the
best way to use the drawing instead

thanks for any info!





_______________________________________________
fltk mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk

Reply via email to