gx.pp 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. Unit gx;
  2. {$MODE objfpc}
  3. { convention is cdecl for WinCE API}
  4. {$calling cdecl}
  5. Interface
  6. Uses
  7. Windows;
  8. Const
  9. GXDLL = 'gx.dll';
  10. Type
  11. GXDisplayProperties = Record
  12. cxWidth : DWord;
  13. cyHeight : DWord; // notice lack of 'th' in the word height.
  14. cbxPitch : LONG; // number of bytes to move right one x pixel - can be negative.
  15. cbyPitch : LONG; // number of bytes to move down one y pixel - can be negative.
  16. cBPP : LONG; // # of bits in each pixel
  17. ffFormat : DWord; // format flags.
  18. End;
  19. GXKeyList = Record
  20. vkUp : SHORT; // key for up
  21. ptUp : POINT; // x,y position of key/button. Not on screen but in screen coordinates.
  22. vkDown : SHORT;
  23. ptDown : POINT;
  24. vkLeft : SHORT;
  25. ptLeft : POINT;
  26. vkRight : SHORT;
  27. ptRight : POINT;
  28. vkA : SHORT;
  29. ptA : POINT;
  30. vkB : SHORT;
  31. ptB : POINT;
  32. vkC : SHORT;
  33. ptC : POINT;
  34. vkStart : SHORT;
  35. ptStart : POINT;
  36. End;
  37. Function GXOpenDisplay(AhWnd : HWND; dwFlags : DWORD) : Integer; External GXDLL Name '?GXOpenDisplay@@YAHPAUHWND__@@K@Z';
  38. Function GXCloseDisplay : Integer; External GXDLL Name '?GXCloseDisplay@@YAHXZ';
  39. Function GXBeginDraw : Pointer; External GXDLL Name '?GXBeginDraw@@YAPAXXZ';
  40. Function GXEndDraw : Integer; External GXDLL Name '?GXEndDraw@@YAHXZ';
  41. Function GXOpenInput : Integer; External GXDLL Name '?GXOpenInput@@YAHXZ';
  42. Function GXCloseInput : Integer; External GXDLL Name '?GXCloseInput@@YAHXZ';
  43. Function GXGetDisplayProperties : GXDisplayProperties; External GXDLL Name '?GXGetDisplayProperties@@YA?AUGXDisplayProperties@@XZ';
  44. Function GXGetDefaultKeys(iOptions : Integer) : GXKeyList; External GXDLL Name '?GXGetDefaultKeys@@YA?AUGXKeyList@@H@Z';
  45. Function GXSuspend : Integer; External GXDLL Name '?GXSuspend@@YAHXZ';
  46. Function GXResume : Integer; External GXDLL Name '?GXResume@@YAHXZ';
  47. Function GXSetViewport(dwTop, dwHeight, dwReserved1, dwReserved2 : DWORD) : Integer; External GXDLL Name '?GXSetViewport@@YAHKKKK@Z';
  48. Function GXIsDisplayDRAMBuffer : BOOL; External GXDLL Name '?GXIsDisplayDRAMBuffer@@YAHXZ';
  49. // Although these flags can be unrelated they still
  50. // have unique values.
  51. Const
  52. GX_FULLSCREEN = $01; // for OpenDisplay()
  53. GX_NORMALKEYS = $02;
  54. GX_LANDSCAPEKEYS = $03;
  55. kfLandscape = $8; // Screen is rotated 270 degrees
  56. kfPalette = $10; // Pixel values are indexes into a palette
  57. kfDirect = $20; // Pixel values contain actual level information
  58. kfDirect555 = $40; // 5 bits each for red, green and blue values in a pixel.
  59. kfDirect565 = $80; // 5 red bits, 6 green bits and 5 blue bits per pixel
  60. kfDirect888 = $100; // 8 bits each for red, green and blue values in a pixel.
  61. kfDirect444 = $200; // 4 red, 4 green, 4 blue
  62. kfDirectInverted = $400;
  63. GETRAWFRAMEBUFFER = $00020001;
  64. Type
  65. RawFrameBufferInfo = Record
  66. wFormat : WORD;
  67. wBPP : WORD;
  68. pFramePointer : Pointer;
  69. cxStride : Integer;
  70. cyStride : Integer;
  71. cxPixels : Integer;
  72. cyPixels : Integer;
  73. End;
  74. Const
  75. FORMAT_565 = 1;
  76. FORMAT_555 = 2;
  77. FORMAT_OTHER = 3;
  78. Implementation
  79. End.