Le 14/11/2011 03:58, T.D. Telford a écrit :
I appreciate the test programs with grx, since the gpc documentation is not great.
Using grx, it appears that there is a flush problem, since the last item to be displayed is not displayed. If a dummy item to be displayed is executed, then the previous item is displayed. This seems to be true for both text and graphical shapes. This is for bgi calls.
??? could you provide an example ?
My console programs use black text on a light yellow background. When I run the bgi type programs, I get a graphics window and a console window, with the latter having a black background and a light gray text, which is not easy to read. Any suggestions?
grx works mainly on the graphics window. It can simply restore the focus on the console window with RestoreCrtMode. To have full control of the console window you should use the crt unit. Please experiment with the attached testBGI program which uses both graph and crt. Parameters are for a mingw compiler, but it works also on DJGPP and on Linux X11 Basically it writes equivalents things with corresponding foreground and background colors, first in the graphics window, then in the console window. If you uncomment the RestoreCrtMode instruction in the middle, the window switches between graphics and console. Otherwise both windows are simultaneously visible. Please note the differences in writing the displayed parameters, using equivalent functions in both units. In addition: - Colors are prefixed with graph. and crt. to disambiguate, because both exist with the same name in both units. - In the console window background color turns from yellow to brown because the crt background color is limited to the first eight colors: this is to reproduce original BP BGI behavior.
Maurice