4
{***********************************************************************
5
* This is example shows how to use p96BestModeIDTagList()
7
* tabt (Mon Aug 28 14:07:40 1995)
8
***********************************************************************}
11
Translated to fpc pascal.
17
nils.sjoholm@mailbox.swipnet.se
20
uses exec, amigados, graphics, picasso96api, utility;
24
template : pchar = 'Width=W/N,Height=H/N,Depth=D/N';
25
vecarray : Array[0..2] of long = (0,0,0);
27
fmtstrings : Array [1..(Ord(RGBFB_MaxFormats)-2)] OF pchar = (
55
rda:=ReadArgs (template,Addr(vecarray),Nil);
56
If rda<>Nil Then Begin
57
If vecarray[0]<> 0 then width := long(@vecarray[0]);
58
If vecarray[1]<> 0 then height := long(@vecarray[1]);
59
If vecarray[2]<> 0 then depth := long(@vecarray[2]);
65
DisplayID:=p96BestModeIDTags([P96BIDTAG_NominalWidth, width,
66
P96BIDTAG_NominalHeight, height,
67
P96BIDTAG_Depth, depth,
68
P96BIDTAG_FormatsForbidden, (RGBFF_R5G5B5 or RGBFF_R5G5B5PC or RGBFF_B5G5R5PC),
70
If DisplayID>0 Then Begin
71
Writeln ('DisplayID: ', hexstr(DisplayID,8));
72
If DisplayID<>INVALID_ID Then Begin
73
Writeln ('Width: ', p96GetModeIDAttr(DisplayID, P96IDA_WIDTH));
74
Writeln ('Height: ', p96GetModeIDAttr(DisplayID, P96IDA_HEIGHT));
75
Writeln ('Depth: ', p96GetModeIDAttr(DisplayID, P96IDA_DEPTH));
76
Writeln ('BytesPerPixel: ', p96GetModeIDAttr(DisplayID, P96IDA_BYTESPERPIXEL));
77
Writeln ('BitsPerPixel: ', p96GetModeIDAttr(DisplayID, P96IDA_BITSPERPIXEL));
78
Writeln ('RGBFormat: ', fmtstrings[p96GetModeIDAttr(DisplayID,P96IDA_RGBFORMAT)+1]);
79
If p96GetModeIDAttr(DisplayID, P96IDA_ISP96)<>0 Then
80
Writeln ('Is P96: yes')
82
Writeln ('Is P96: no');
85
Writeln ('DisplayID is 0.');