primaryd.inc 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112
  1. {
  2. Free Pascal port of the OpenPTC C++ library.
  3. Copyright (C) 2001-2003 Nikolay Nikolov ([email protected])
  4. Original C++ version by Glenn Fiedler ([email protected])
  5. This library is free software; you can redistribute it and/or
  6. modify it under the terms of the GNU Lesser General Public
  7. License as published by the Free Software Foundation; either
  8. version 2.1 of the License, or (at your option) any later version.
  9. This library is distributed in the hope that it will be useful,
  10. but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  12. Lesser General Public License for more details.
  13. You should have received a copy of the GNU Lesser General Public
  14. License along with this library; if not, write to the Free Software
  15. Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  16. }
  17. Type
  18. TDirectXPrimary = Class(TObject)
  19. Private
  20. Function pack(Const color : TPTCColor; Const _format : TPTCFormat) : int32;
  21. Procedure analyse(mask : int32; Var base, size : Integer);
  22. m_width : Integer;
  23. m_height : Integer;
  24. m_pages : Integer;
  25. m_area : TPTCArea;
  26. m_clip : TPTCArea;
  27. m_format : TPTCFormat;
  28. m_active : Boolean;
  29. m_blocking : Boolean;
  30. m_centering : Boolean;
  31. m_fullscreen : Boolean;
  32. m_synchronize : Boolean;
  33. m_clear : TPTCClear;
  34. m_window : TWin32Window;
  35. m_locked : Pointer;
  36. m_palette : TPTCPalette;
  37. m_primary_width : Integer;
  38. m_primary_height : Integer;
  39. m_secondary_width : Integer;
  40. m_secondary_height : Integer;
  41. m_lpDD2 : LPDIRECTDRAW2;
  42. m_lpDDS : LPDIRECTDRAWSURFACE;
  43. m_lpDDS_primary : LPDIRECTDRAWSURFACE;
  44. m_lpDDS_primary_back : LPDIRECTDRAWSURFACE;
  45. m_lpDDS_primary_page : Array[0..31] Of LPDIRECTDRAWSURFACE;
  46. m_lpDDS_secondary : LPDIRECTDRAWSURFACE;
  47. m_lpDDC : LPDIRECTDRAWCLIPPER;
  48. m_back, m_front : LPDIRECTDRAWSURFACE;
  49. Public
  50. Constructor Create;
  51. Destructor Destroy; Override;
  52. Procedure initialize(Window : TWin32Window; lpDD2 : LPDIRECTDRAW2);
  53. Procedure primary(_pages : Integer; video, fullscreen, _palette, complex : Boolean);
  54. Procedure secondary(_width, _height : Integer);
  55. Procedure synchronize(_update : Boolean);
  56. Procedure centering(center : Boolean);
  57. Procedure close;
  58. Procedure update;
  59. Function lock : Pointer;
  60. Procedure unlock;
  61. Procedure clear;
  62. Procedure clear(Const color : TPTCColor; Const _area : TPTCArea);
  63. Procedure palette(Const _palette : TPTCPalette);
  64. Function palette : TPTCPalette;
  65. Procedure clip(Const _area : TPTCArea);
  66. Function width : Integer;
  67. Function height : Integer;
  68. Function pages : Integer;
  69. Function pitch : Integer;
  70. Function area : TPTCArea;
  71. Function clip : TPTCArea;
  72. Function format : TPTCFormat;
  73. Function lpDDS : LPDIRECTDRAWSURFACE;
  74. Function lpDDS_primary : LPDIRECTDRAWSURFACE;
  75. Function lpDDS_secondary : LPDIRECTDRAWSURFACE;
  76. Procedure activate;
  77. Procedure deactivate;
  78. Function active : Boolean;
  79. Procedure block;
  80. Procedure save;
  81. Procedure restore;
  82. Procedure paint;
  83. Procedure blocking(_blocking : Boolean);
  84. End;