Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
29275 Discussions

How do I speed up visual fortran graphics

Deleted_U_Intel
Employee
385 Views
I have a grid with 600 cells, some of the cells are blue, some red, and others empty. My program changes the color of the cells upon each iteration. The writing of the grid to screen takes around 3 seconds and I would like it to be much faster. How can I increase this speed?
Currently, the grid is drawn using a subroutine that forms a large rectangle with 600 smaller rectangles included in it. The color is added to each small cell using the floodfill call. I am sure that printing to screen is slow because of the drawing of all 600 cells and then filling them each with a color.
I am using Digital Visual Fortran, which I think is now called Compaq Visual Fortran.
Thank you for your help.
0 Kudos
2 Replies
Jugoslav_Dujic
Valued Contributor II
385 Views

You can speed up things considerably if you replace FLOODFILL calls with RECTANGLE. Floodfill is hopelessly slow because it has to check whether any pixel should be drawn by testing whether a border is hit.

Further, unfortunately, QuickWin (DFLIB) implementation of graphic routines is seriously flawed in sense of efficiency. If you need still faster drawing, i'm affraid there's no other way than to rewrite it as a pure Win32 application from scratch. You can use one of XDblBuffer samples from my home pageas a starting point; they use my XFTGDI module, which wraps some of Win32 apis in a convenient manner, especially because they "look like" DFLIB routines. The samples should be compilable with DVF 5.0 (or require minor changes at worst) -- if not, please contact me (my e-mail address there). (Make sure to download the documentation as well).

Btw,have you upgraded to 5.0D ?

Jugoslav

0 Kudos
TimP
Honored Contributor III
385 Views
5.0D is a free upgrade from 5.0, and Jugoslav is suggesting you go at least that far. Further upgrades have a price, and I doubt there are any discounts or credits offered any longer.
0 Kudos
Reply