requestmodeid.pas 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. Program RequestModeID;
  2. { ***********************************************************************
  3. * This is example shows how to use p96RequestModeIDTagList()
  4. *
  5. * tabt (Sat Dec 28 03:44:35 1996)
  6. *********************************************************************** }
  7. {
  8. Translated to fpc pascal.
  9. 3 Mars 2001.
  10. Updated for fpc 1.0.7
  11. 08 Jan 2003.
  12. [email protected]
  13. }
  14. uses exec, amigados, agraphics, intuition, picasso96api, utility;
  15. Const
  16. template : pchar = 'Width=W/N,Height=H/N,Depth=D/N';
  17. vecarray : Array[0..2] of longint = (0,0,0);
  18. Var
  19. width,
  20. height,
  21. depth,
  22. DisplayID : longint;
  23. dim : tDimensionInfo;
  24. rda : pRDArgs;
  25. Begin
  26. width:=640;
  27. height:=480;
  28. depth:=15;
  29. rda:=ReadArgs (template,@vecarray,Nil);
  30. If rda<>Nil Then Begin
  31. If vecarray[0] <> 0 then width := long(@vecarray[0]);
  32. If vecarray[1] <> 0 then height := long(@vecarray[1]);
  33. If vecarray[2] <> 0 then depth := long(@vecarray[2]);
  34. FreeArgs(rda);
  35. End;
  36. DisplayID := p96RequestModeIDTags([P96MA_MinWidth, width,
  37. P96MA_MinHeight, height,
  38. P96MA_MinDepth, depth,
  39. P96MA_WindowTitle, 'RequestModeID Test',
  40. P96MA_FormatsAllowed, (RGBFF_CLUT or RGBFF_R5G6B5 or RGBFF_R8G8B8 or RGBFF_A8R8G8B8),
  41. TAG_DONE]);
  42. Writeln ('DisplayID:', hexstr(DisplayID,8));
  43. If DisplayID <> INVALID_ID Then Begin
  44. If GetDisplayInfoData(Nil, @dim ,SizeOf(tDimensionInfo),DTAG_DIMS,DisplayID) <> 0 Then
  45. Writeln('Dimensions: ',dim.Nominal.MaxX-dim.Nominal.MinX+1,'x',dim.Nominal.MaxY-dim.Nominal.MinY+1,'x',dim.MaxDepth)
  46. Else
  47. Writeln('No Dimensioninfo.');
  48. End Else Writeln('DisplayID invalid.');
  49. End.