directxconsoled.inc 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160
  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. TDirectXConsole = Class(TPTCBaseConsole)
  19. Private
  20. { internal console management routines }
  21. Procedure internal_open(Const _title : String; window : HWND; Const mode : TPTCMode; _pages : Integer; exact : Boolean);
  22. Procedure internal_recycle(Const _title : String; window : HWND; Const mode : TPTCMode; _pages : Integer; exact : Boolean);
  23. Procedure internal_close;
  24. Procedure internal_shutdown;
  25. { internal console open management routines }
  26. Procedure internal_open_start(Const _title : String; window : HWND);
  27. Procedure internal_open_finish;
  28. Procedure internal_open_reset;
  29. { internal fullscreen open routines }
  30. Procedure internal_open_fullscreen_start(window : HWND; Const mode : TPTCMode; exact : Boolean);
  31. Procedure internal_open_fullscreen_change(Const mode : TPTCMode; exact : Boolean);
  32. Procedure internal_open_fullscreen_surface(Const mode : TPTCMode; _pages : Integer);
  33. Procedure internal_open_fullscreen_finish;
  34. { internal windowed open routines }
  35. Procedure internal_open_windowed_start(window : HWND; Const mode : TPTCMode; exact : Boolean);
  36. Procedure internal_open_windowed_change(Const mode : TPTCMode; exact : Boolean);
  37. Procedure internal_open_windowed_surface(Const mode : TPTCMode; _pages : Integer);
  38. Procedure internal_open_windowed_finish;
  39. { internal console open recycling routines }
  40. Procedure internal_recycle_fullscreen(Const _title : String; window : HWND; Const mode : TPTCMode; _pages : Integer; exact : Boolean);
  41. Procedure internal_recycle_windowed(Const _title : String; window : HWND; Const mode : TPTCMode; _pages : Integer; exact : Boolean);
  42. {$IFDEF DEBUG}
  43. { debug }
  44. Procedure CHECK_OPEN(msg : String);
  45. Procedure CHECK_LOCK(msg : String);
  46. {$ENDIF}
  47. { painting }
  48. Procedure paint;
  49. { cursor state }
  50. Procedure update_cursor;
  51. { title data }
  52. { m_title : Array[0..1023] Of Char;}
  53. m_title : AnsiString;
  54. { flags }
  55. m_open : Boolean;
  56. m_locked : Boolean;
  57. m_cursor : Boolean;
  58. { option data }
  59. m_frequency : Integer;
  60. m_default_width : Integer;
  61. m_default_height : Integer;
  62. m_default_pages : Integer;
  63. m_center_window : Boolean;
  64. m_synchronized_update : Boolean;
  65. m_default_format : TPTCFormat;
  66. m_output_mode : Integer; {Output}
  67. m_window_mode : Integer; {Window}
  68. m_primary_mode_windowed : Integer; {Primary}
  69. m_primary_mode_fullscreen : Integer; {Primary}
  70. m_nearest_mode : Integer; {Nearest}
  71. m_cursor_mode : Integer; {Cursor}
  72. { objects }
  73. m_copy : TPTCCopy;
  74. { Win32 objects }
  75. m_window : TWin32Window;
  76. m_keyboard : TWin32Keyboard;
  77. { DirectX objects }
  78. m_hook : TDirectXHook;
  79. m_library : TDirectXLibrary;
  80. m_display : TDirectXDisplay;
  81. m_primary : TDirectXPrimary;
  82. Protected
  83. Procedure internal_ReadKey(k : TPTCKey); Override;
  84. Function internal_PeekKey(k : TPTCKey) : Boolean; Override;
  85. Public
  86. Constructor Create;
  87. Destructor Destroy; Override;
  88. Procedure configure(Const _file : String); Override;
  89. Function option(Const _option : String) : Boolean; Override;
  90. Function modes : PPTCMode; Override;
  91. Procedure open(Const _title : String; _pages : Integer); Overload; Override;
  92. Procedure open(Const _title : String; Const _format : TPTCFormat;
  93. _pages : Integer); Overload; Override;
  94. Procedure open(Const _title : String; _width, _height : Integer;
  95. Const _format : TPTCFormat; _pages : Integer); Overload; Override;
  96. Procedure open(Const _title : String; Const _mode : TPTCMode;
  97. _pages : Integer); Overload; Override;
  98. Procedure close; Override;
  99. Procedure flush; Override;
  100. Procedure finish; Override;
  101. Procedure update; Override;
  102. Procedure update(Const _area : TPTCArea); Override;
  103. Procedure copy(Var surface : TPTCBaseSurface); Override;
  104. Procedure copy(Var surface : TPTCBaseSurface;
  105. Const source, destination : TPTCArea); Override;
  106. Function lock : Pointer; Override;
  107. Procedure unlock; Override;
  108. Procedure load(Const pixels : Pointer;
  109. _width, _height, _pitch : Integer;
  110. Const _format : TPTCFormat;
  111. Const _palette : TPTCPalette); Override;
  112. Procedure load(Const pixels : Pointer;
  113. _width, _height, _pitch : Integer;
  114. Const _format : TPTCFormat;
  115. Const _palette : TPTCPalette;
  116. Const source, destination : TPTCArea); Override;
  117. Procedure save(pixels : Pointer;
  118. _width, _height, _pitch : Integer;
  119. Const _format : TPTCFormat;
  120. Const _palette : TPTCPalette); Override;
  121. Procedure save(pixels : Pointer;
  122. _width, _height, _pitch : Integer;
  123. Const _format : TPTCFormat;
  124. Const _palette : TPTCPalette;
  125. Const source, destination : TPTCArea); Override;
  126. Procedure clear; Override;
  127. Procedure clear(Const color : TPTCColor); Override;
  128. Procedure clear(Const color : TPTCColor;
  129. Const _area : TPTCArea); Override;
  130. Procedure palette(Const _palette : TPTCPalette); Override;
  131. Function palette : TPTCPalette; Override;
  132. Procedure clip(Const _area : TPTCArea); Override;
  133. Function width : Integer; Override;
  134. Function height : Integer; Override;
  135. Function pitch : Integer; Override;
  136. Function pages : Integer; Override;
  137. Function area : TPTCArea; Override;
  138. Function clip : TPTCArea; Override;
  139. Function format : TPTCFormat; Override;
  140. Function name : String; Override;
  141. Function title : String; Override;
  142. Function information : String; Override;
  143. End;