Following on from Dan's example of painting a %pl region, I thought I would give comparative examples of painting a %pl and %gr region (outside the Native %pl thread).
These examples show:
the comparative time for painting %pl vs %gr
problems with the colour for painting %pl
My preferred approach is to create an integer*4 colour array and use draw_line_between, rather than direct manipulation of the graphics surface (which should be better) or multiple calls to update each pixel. I have found problems when mixing direct manipulation with user_resize and full_mouse_input, so resorted to the approach I have posted.
The advantage of the approach I have posted is that for many updates of the graphics screen (eg with hidden line removal), this approach has a single final paint to the graphics device. There is a separation of the stages of preparing the graphics and painting. This example also demonstrates the relative timing for generation and painting ( which is a problem with this approach for %pl ) They work in 32 and /64, although /64 %gr exits badly ?
Any suggestions are welcomed, especially if there are better approaches to the apparent problem when painting %pl region.
John
https://www.dropbox.com/s/qepaf5ka2vwp4hm/gr_plot2.f95?dl=0 https://www.dropbox.com/s/ar8h8h5i24mb19v/pl_plot.f95?dl=0