However, since
it was decided to implement new mode and graphic driver constants, which are more independent of the specific platform the program runs on.
In this section we give a short explanation of the new mode system. the following drivers were defined:
D1bit = 11; D2bit = 12; D4bit = 13; D6bit = 14; { 64 colors Half-brite mode - Amiga } D8bit = 15; D12bit = 16; { 4096 color modes HAM mode - Amiga } D15bit = 17; D16bit = 18; D24bit = 19; { not yet supported } D32bit = 20; { not yet supported } D64bit = 21; { not yet supported } lowNewDriver = 11; highNewDriver = 21; |
The following modes have been defined:
detectMode = 30000; m320x200 = 30001; m320x256 = 30002; { amiga resolution (PAL) } m320x400 = 30003; { amiga/atari resolution } m512x384 = 30004; { mac resolution } m640x200 = 30005; { vga resolution } m640x256 = 30006; { amiga resolution (PAL) } m640x350 = 30007; { vga resolution } m640x400 = 30008; m640x480 = 30009; m800x600 = 30010; m832x624 = 30011; { mac resolution } m1024x768 = 30012; m1280x1024 = 30013; m1600x1200 = 30014; m2048x1536 = 30015; lowNewMode = 30001; highNewMode = 30015; |
The above constants can be used to set a certain color depth and resultion, as demonstrated in the following example:
Listing: graphex/inigraph1.pp
If other modes than the ones above are supported by the graphics card, you will not be able to select them with this mechanism.
For this reason, there is also a ’dynamic’ mode number, which is assigned at run-time. This number increases with increasing X resolution. It can be queried with the getmoderange call. This call will return the range of modes which are valid for a certain graphics driver. The numbers are guaranteed to be consecutive, and can be used to search for a certain resolution, as in the following example:
Listing: graphex/inigraph2.pp
Thus, the getmoderange function can be used to detect all available modes and drivers, as in the following example:
Listing: graphex/modrange.pp