[fpc-pascal]VESA modes in fpc for win32

Jonas Maebe jonas at zeus.rug.ac.be
Mon Jan 28 16:30:32 CET 2002

On zondag, januari 27, 2002, at 06:13 , Victor V. Shuvalov wrote:

> How do I initialize VESA graphics modes (like 101h) with fpc for win32? 
> The
> documentation says
>  If you need another mode, then set GraphDriver to a value different 
> from
>  zero and graphmode to the mode you wish (VESA modes where 640x480x256 
> is
>  101h etc.).

Is this in the current documentation? This information is completely 
outdated, please check the new documentation.

> but the program like
>  .........
>  GraphDriver:=1;
>  GraphMode:=$103;
>  InitGraph(GraphDriver,GraphMode,'');
>  .........
> which was working well with old version 0.99.12b (go32v2) is not working
> with version 1.0.4 (neither win32 nor go32v2). Please help if you can.

There are several reasons

a) the win32 graph unit only supports 640x480x16 colors. There is no way 
to directly set video modes from a win32 program based on the VESA 
specifications, you have to got through the win32 api or direct-x and 
this is not implemented yet in the graph unit
b) the graph mode setting has been completely reworked in the current 
versions of FPC. You would now use something like

graphdriver := d8bit;
graphmode := m640x480;
if graphresult <> grOK then
     error handling here

See the docs for more info. You can use the go32v2 version of the 
compiler to create (Dos) programs that switch into VESA modes (using the 
graph unit and the method described above), but keep in mind that 
WinNT/2000/XP do *NOT* support VESA modes for Dos programs (well, the OS 
may support it, but most video card drivers do not). It will work fine 
under Win9x and WinME though.


More information about the fpc-pascal mailing list