Difference between revisions of "Unit GraphicsConsole"

From Ultibo.org
Jump to: navigation, search
 
(22 intermediate revisions by the same user not shown)
Line 4: Line 4:
 
=== Description ===
 
=== Description ===
 
----
 
----
 +
 +
'''Ultibo Graphics Console Interface unit'''
  
 
The Graphics console unit provides access to the underlying framebuffer device as a pixel interface that allows putting blocks (or rectangles) of pixel data on to the screen or getting rectangles of pixel data from the screen. Functions are also included to copy a rectangle from one part of the screen to another and to put text (with a specified font) on to the screen.
 
The Graphics console unit provides access to the underlying framebuffer device as a pixel interface that allows putting blocks (or rectangles) of pixel data on to the screen or getting rectangles of pixel data from the screen. Functions are also included to copy a rectangle from one part of the screen to another and to put text (with a specified font) on to the screen.
Line 13: Line 15:
 
Many graphics libraries do image manipulation, rendering and compositing to a memory buffer in a form that is compatible with the functions in this unit so a complex image can be constructed in memory and then transferred to the screen in a single operation. This is sometimes referred to as a bit block transfer or BitBlt and is a very standard technique for rendering both text and images to a framebuffer device.
 
Many graphics libraries do image manipulation, rendering and compositing to a memory buffer in a form that is compatible with the functions in this unit so a complex image can be constructed in memory and then transferred to the screen in a single operation. This is sometimes referred to as a bit block transfer or BitBlt and is a very standard technique for rendering both text and images to a framebuffer device.
 
   
 
   
This unit extends the console unit by creating a new type of console window (WINDOW_MODE_GRAPHICS) and therefore allows both text console windows and graphics console windows to co-exist on the screen at once.
+
This unit extends the console unit by creating a new type of console window (WINDOW_MODE_GRAPHICS) and therefore allows both text console windows and graphics console windows to co-exist on the screen at once.
 
   
 
   
 
The functions in this unit cannot be used to draw on a text console window (WINDOW_MODE_TEXT) and vice versa the functions in the console unit cannot be used to draw on a graphics console window.
 
The functions in this unit cannot be used to draw on a text console window (WINDOW_MODE_TEXT) and vice versa the functions in the console unit cannot be used to draw on a graphics console window.
 
   
 
   
Like the console unit, the graphics console supports setting a viewport for a specified window to allow masking the area to be written to. However the graphics console does not support a tracking a cursor X and Y position. Setting a window as the default is also not supported since that functionality is purely intended to support the RTL functions for text output.
+
Like the console unit, the graphics console supports setting a viewport for a specified window to allow masking the area to be written to. However the graphics console does not support tracking a cursor X and Y position. Setting a window as the default is also not supported since that functionality is purely intended to support the RTL functions for text output.
 
   
 
   
 
Graphics windows can only be created on console devices which have a mode of CONSOLE_MODE_PIXEL.
 
Graphics windows can only be created on console devices which have a mode of CONSOLE_MODE_PIXEL.
Line 26: Line 28:
 
----
 
----
  
''To be documented''
+
''None defined''
  
 
=== Type definitions ===
 
=== Type definitions ===
 
----
 
----
  
''To be documented''
+
 
 +
'''Graphics window enumeration callback'''
 +
 
 +
{| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;"
 +
|-
 +
| <code>TGraphicsWindowEnumerate = TConsoleWindowEnumerate;</code>
 +
| style="width: 40%;"|
 +
|-
 +
|}
 +
 
 +
'''Graphics window types'''
 +
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial;">
 +
<code>PGraphicsWindow = ^TGraphicsWindow;</code>
 +
 
 +
<code>TGraphicsWindow = TConsoleWindow;</code>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
| &nbsp;
 +
| style="width: 50%;"|&nbsp;
 +
|-
 +
|}
 +
</div></div>
 +
<br />
 +
 
 +
=== Class definitions ===
 +
----
 +
 
 +
 
 +
'''Graphics console specific classes'''
 +
 
 +
{| class="wikitable" style="font-size: 14px; text-align: left; width: 100%; height: 50px;"
 +
|-
 +
| [[TGraphicImage|<code>TGraphicImage = class(TObject)</code>]]
 +
|-
 +
|}
 +
<br />
  
 
=== Public variables ===
 
=== Public variables ===
 
----
 
----
  
''To be documented''
+
''None defined''
  
 
=== Function declarations ===
 
=== Function declarations ===
 
----
 
----
<br />
+
 
 +
 
 
'''Initialization functions'''
 
'''Initialization functions'''
  
 
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;">
 
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;">
 
<pre style="border: 0; padding-bottom:0px;">procedure GraphicsConsoleInit;</pre>
 
<pre style="border: 0; padding-bottom:0px;">procedure GraphicsConsoleInit;</pre>
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' To be documented</div>
+
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Initialize the GraphicsConsole unit</div>
 
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Note'''
+
! Note
| To be documented
+
| Called only during system startup
 
|-
 
|-
 
|}
 
|}
Line 64: Line 104:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Console'''
+
! Console
 
| The console device to create the new window on
 
| The console device to create the new window on
 
|-
 
|-
! '''Position'''
+
! Position
 
| The console position to create the new window at (eg CONSOLE_POSITION_FULL)
 
| The console position to create the new window at (eg CONSOLE_POSITION_FULL)
 
|-
 
|-
! '''Return'''
+
! Return
 
| Handle to new Graphics window or INVALID_HANDLE_VALUE if the window could not be created
 
| Handle to new Graphics window or INVALID_HANDLE_VALUE if the window could not be created
 
|-
 
|-
Line 82: Line 122:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Console'''
+
! Console
 
| The console device to create the new window on
 
| The console device to create the new window on
 
|-
 
|-
! '''Font'''
+
! Font
 
| The handle of the default font for the new console window
 
| The handle of the default font for the new console window
 
|-
 
|-
! '''Size'''
+
! Size
 
| The size in bytes to allocate for the new window entry (Defaults to SizeOf(TGraphicsWindow))
 
| The size in bytes to allocate for the new window entry (Defaults to SizeOf(TGraphicsWindow))
 
|-
 
|-
! '''State'''
+
! State
 
| The state of the new console window (WINDOW_STATE_VISIBLE or WINDOW_STATE_INVISIBLE)
 
| The state of the new console window (WINDOW_STATE_VISIBLE or WINDOW_STATE_INVISIBLE)
 
|-
 
|-
! '''Mode'''
+
! Mode
 
| The mode of the new console window (Normally WINDOW_MODE_GRAPHICS)
 
| The mode of the new console window (Normally WINDOW_MODE_GRAPHICS)
 
|-
 
|-
! '''Position'''
+
! Position
 
| The console position to create the new window at (eg CONSOLE_POSITION_FULL)
 
| The console position to create the new window at (eg CONSOLE_POSITION_FULL)
 
|-
 
|-
! '''Return'''
+
! Return
 
| Handle to new Graphics window or INVALID_HANDLE_VALUE if the window could not be created
 
| Handle to new Graphics window or INVALID_HANDLE_VALUE if the window could not be created
 
|-
 
|-
Line 112: Line 152:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Handle'''
+
! Handle
 
| The handle of the window to destroy
 
| The handle of the window to destroy
 
|-
 
|-
! '''Return'''
+
! Return
 
| ERROR_SUCCESS if completed or another error code on failure
 
| ERROR_SUCCESS if completed or another error code on failure
 
|-
 
|-
Line 127: Line 167:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Handle'''
+
! Handle
 
| The handle of the window to show
 
| The handle of the window to show
 
|-
 
|-
! '''Return'''
+
! Return
 
| ERROR_SUCCESS if completed or another error code on failure
 
| ERROR_SUCCESS if completed or another error code on failure
 
|-
 
|-
Line 142: Line 182:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Handle'''
+
! Handle
 
| The handle of the window to hide
 
| The handle of the window to hide
 
|-
 
|-
! '''Return'''
+
! Return
 +
| ERROR_SUCCESS if completed or another error code on failure
 +
|-
 +
|}
 +
</div></div>
 +
<br />
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;">
 +
<pre style="border: 0; padding-bottom:0px;">function GraphicsWindowActivate(Handle:TWindowHandle):LongWord; inline;</pre>
 +
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Make an existing console window the active window</div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
! Handle
 +
| The handle of the window to activate
 +
|-
 +
! Return
 +
| ERROR_SUCCESS if completed or another error code on failure
 +
|-
 +
|}
 +
</div></div>
 +
<br />
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;">
 +
<pre style="border: 0; padding-bottom:0px;">function GraphicsWindowDeactivate(Handle:TWindowHandle):LongWord; inline;</pre>
 +
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Make an existing console window inactive</div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
! Handle
 +
| The handle of the window to deactivate
 +
|-
 +
! Return
 +
| ERROR_SUCCESS if completed or another error code on failure
 +
|-
 +
! Note
 +
| On success there will be no active window set
 +
|-
 +
|}
 +
</div></div>
 +
<br />
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;">
 +
<pre style="border: 0; padding-bottom:0px;">function GraphicsWindowNext(Console:PConsoleDevice; Visible:Boolean):TWindowHandle; inline;</pre>
 +
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Get the next console window starting with the active window</div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
! Console
 +
| The console device to change the active window on
 +
|-
 +
! Visible
 +
| If true only return windows that are visible
 +
|-
 +
! Return
 +
| ERROR_SUCCESS if completed or another error code on failure
 +
|-
 +
|}
 +
</div></div>
 +
<br />
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;">
 +
<pre style="border: 0; padding-bottom:0px;">function GraphicsWindowPrevious(Console:PConsoleDevice; Visible:Boolean):TWindowHandle; inline;</pre>
 +
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Get the previous console window starting with the active window</div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
! Console
 +
| The console device to change the active window on
 +
|-
 +
! Visible
 +
| If true only return windows that are visible
 +
|-
 +
! Return
 +
| ERROR_SUCCESS if completed or another error code on failure
 +
|-
 +
|}
 +
</div></div>
 +
<br />
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;">
 +
<pre style="border: 0; padding-bottom:0px;">function GraphicsWindowAt(Console:PConsoleDevice; X,Y:LongWord; Visible:Boolean):TWindowHandle; inline;</pre>
 +
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Find the console window that X and Y coordinates are within</div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
! Console
 +
| The console device to find the window on
 +
|-
 +
! X
 +
| The X coordinate to find the window for
 +
|-
 +
! Y
 +
| The Y coordinate to find the window for
 +
|-
 +
! Visible
 +
| If true only return windows that are visible
 +
|-
 +
! Return
 
| ERROR_SUCCESS if completed or another error code on failure
 
| ERROR_SUCCESS if completed or another error code on failure
 
|-
 
|-
Line 157: Line 290:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Console'''
+
! Console
 
| The console device to find the window on
 
| The console device to find the window on
 
|-
 
|-
! '''Position'''
+
! Position
 
| The window position to find (eg CONSOLE_POSITION_FULL)
 
| The window position to find (eg CONSOLE_POSITION_FULL)
 
|-
 
|-
! '''Return'''
+
! Return
 
| The handle of the existing window or INVALID_HANDLE_VALUE if not found
 
| The handle of the existing window or INVALID_HANDLE_VALUE if not found
 
|-
 
|-
Line 175: Line 308:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Console'''
+
! Console
 
| The console device to enumerate windows for
 
| The console device to enumerate windows for
 
|-
 
|-
! '''Callback'''
+
! Callback
 
| The function to call for each window enumerated
 
| The function to call for each window enumerated
 
|-
 
|-
! '''Data'''
+
! Data
| A pointer to private data to be passed to the callback (Optional
+
| A pointer to private data to be passed to the callback (Optional)
 
|-
 
|-
! '''Return'''
+
! Return
 
| ERROR_SUCCESS if completed or another error code on failure
 
| ERROR_SUCCESS if completed or another error code on failure
 
|-
 
|-
Line 196: Line 329:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Handle'''
+
! Handle
 
| The handle of the window to check
 
| The handle of the window to check
 
|-
 
|-
! '''Flag'''
+
! Flag
 
| The window flag to check for (eg WINDOW_FLAG_LINE_WRAP)
 
| The window flag to check for (eg WINDOW_FLAG_LINE_WRAP)
 
|-
 
|-
! '''Return'''
+
! Return
| True if the flag is set, False if not set
+
| True if the flag is set, False if not set.
 +
|-
 +
|}
 +
</div></div>
 +
<br />
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;">
 +
<pre style="border: 0; padding-bottom:0px;">function GraphicsWindowUpdateFlag(Handle:TWindowHandle; Flag:LongWord; Clear:Boolean):LongWord; inline;</pre>
 +
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Set or clear a flag on an existing console window</div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
! Handle
 +
| The handle of the window to set or clear the flag on
 +
|-
 +
! Flag
 +
| The window flag to set or clear (eg WINDOW_FLAG_LINE_WRAP)
 +
|-
 +
! Clear
 +
| If true clear the flag, else set it.
 +
|-
 +
! Return
 +
| ERROR_SUCCESS if completed or another error code on failure
 
|-
 
|-
 
|}
 
|}
Line 214: Line 368:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Handle'''
+
! Handle
 
| The handle of the window to get the mode for
 
| The handle of the window to get the mode for
 
|-
 
|-
! '''Return'''
+
! Return
 
| The window mode (eg WINDOW_MODE_GRAPHICS)
 
| The window mode (eg WINDOW_MODE_GRAPHICS)
 
|-
 
|-
Line 229: Line 383:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Handle'''
+
! Handle
 
| The handle of the window to get the state for
 
| The handle of the window to get the state for
 
|-
 
|-
! '''Return'''
+
! Return
 
| The window state (eg WINDOW_STATE_INVISIBLE)
 
| The window state (eg WINDOW_STATE_INVISIBLE)
 
|-
 
|-
Line 244: Line 398:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Handle'''
+
! Handle
 
| The handle of the window to get the position for
 
| The handle of the window to get the position for
 
|-
 
|-
! '''Return'''
+
! Return
 
| The window position (eg CONSOLE_POSITION_FULL)
 
| The window position (eg CONSOLE_POSITION_FULL)
 
|-
 
|-
Line 259: Line 413:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Handle'''
+
! Handle
 
| The handle of the window to set the position for
 
| The handle of the window to set the position for
 
|-
 
|-
! '''Position'''
+
! Position
 
| The new window position to set
 
| The new window position to set
 
|-
 
|-
! '''Return'''
+
! Return
 
| ERROR_SUCCESS if completed or another error code on failure
 
| ERROR_SUCCESS if completed or another error code on failure
 
|-
 
|-
! '''Note'''
+
! Note
 
| The function will return ERROR_INVALID_PARAMETER if another window exists at the position
 
| The function will return ERROR_INVALID_PARAMETER if another window exists at the position
 +
|-
 +
|}
 +
</div></div>
 +
<br />
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;">
 +
<pre style="border: 0; padding-bottom:0px;">function GraphicsWindowGetProperties(Handle:TWindowHandle; Properties:PWindowProperties):LongWord; inline;</pre>
 +
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Get the properties for the specified console window</div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
! Handle
 +
| The handle of the window to get the properties from
 +
|-
 +
! Properties
 +
| Pointer to a TWindowProperties structure to fill in
 +
|-
 +
! Return
 +
| ERROR_SUCCESS if completed or another error code on failure
 
|-
 
|-
 
|}
 
|}
Line 280: Line 452:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Handle'''
+
! Handle
 
| The handle of the window to get MinX for
 
| The handle of the window to get MinX for
 
|-
 
|-
! '''Return'''
+
! Return
 
| The minimum X value for the current window viewport
 
| The minimum X value for the current window viewport
 
|-
 
|-
! '''Note'''
+
! Note
| For Graphics Console functions, X is based on screen pixels not characters
+
| For Graphics Console functions, X is based on screen pixels not characters.
 
|-
 
|-
 
|}
 
|}
Line 298: Line 470:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Handle'''
+
! Handle
 
| The handle of the window to get MinY for
 
| The handle of the window to get MinY for
 
|-
 
|-
! '''Return'''
+
! Return
 
| The minimum Y value for the current window viewport
 
| The minimum Y value for the current window viewport
 
|-
 
|-
! '''Note'''
+
! Note
| For Graphics Console functions, Y is based on screen pixels not characters
+
| For Graphics Console functions, Y is based on screen pixels not characters.
 
|-
 
|-
 
|}
 
|}
Line 316: Line 488:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Handle'''
+
! Handle
 
| The handle of the window to get MaxX for
 
| The handle of the window to get MaxX for
 
|-
 
|-
! '''Return'''
+
! Return
 
| The maximum X value for the current window viewport
 
| The maximum X value for the current window viewport
 
|-
 
|-
! '''Note'''
+
! Note
| For Graphics Console functions, X is based on screen pixels not characters
+
| For Graphics Console functions, X is based on screen pixels not characters.
 
|-
 
|-
 
|}
 
|}
Line 334: Line 506:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Handle'''
+
! Handle
 
| The handle of the window to get MaxY for
 
| The handle of the window to get MaxY for
 
|-
 
|-
! '''Return'''
+
! Return
 
| The maximum Y value for the current window viewport
 
| The maximum Y value for the current window viewport
 
|-
 
|-
! '''Note'''
+
! Note
| For Graphics Console functions, Y is based on screen pixels not characters
+
| For Graphics Console functions, Y is based on screen pixels not characters.
 
|-
 
|-
 
|}
 
|}
Line 352: Line 524:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Handle'''
+
! Handle
 
| The handle of the window to get the rectangle for
 
| The handle of the window to get the rectangle for
 
|-
 
|-
! '''Return'''
+
! Return
 
| The rectangle of the current window viewport
 
| The rectangle of the current window viewport
 
|-
 
|-
! '''Note'''
+
! Note
| For Graphics Console functions, Rect is based on screen pixels not characters
+
| For Graphics Console functions, Rect is based on screen pixels not characters.
 
|-
 
|-
 
|}
 
|}
Line 370: Line 542:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Handle'''
+
! Handle
 
| The handle of the window to set the rectangle for
 
| The handle of the window to set the rectangle for
 
|-
 
|-
! '''Rect'''
+
! Rect
 
| The rectangle to set for the window viewport
 
| The rectangle to set for the window viewport
 
|-
 
|-
! '''Return'''
+
! Return
 
| ERROR_SUCCESS if completed or another error code on failure
 
| ERROR_SUCCESS if completed or another error code on failure
 
|-
 
|-
! '''Note'''
+
! Note
| For Graphics Console functions, Rect is based on screen pixels not characters
+
| For Graphics Console functions, Rect is based on screen pixels not characters.
 
|-
 
|-
 
|}
 
|}
Line 391: Line 563:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Handle'''
+
! Handle
 
| The handle of the window to reset the viewport for
 
| The handle of the window to reset the viewport for
 
|-
 
|-
! '''Return'''
+
! Return
 
| ERROR_SUCCESS if completed or another error code on failure
 
| ERROR_SUCCESS if completed or another error code on failure
 
|-
 
|-
Line 406: Line 578:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Handle'''
+
! Handle
 
| The handle of the window to get the viewport for
 
| The handle of the window to get the viewport for
 
|-
 
|-
! '''X1'''
+
! X1
 
| The left edge of the current viewport
 
| The left edge of the current viewport
 
|-
 
|-
! '''Y1'''
+
! Y1
 
| The top edge of the current viewport
 
| The top edge of the current viewport
 
|-
 
|-
! '''X2'''
+
! X2
 
| The right edge of the current viewport
 
| The right edge of the current viewport
 
|-
 
|-
! '''Y2'''
+
! Y2
 
| The bottom edge of the current viewport
 
| The bottom edge of the current viewport
 
|-
 
|-
! '''Return'''
+
! Return
 
| ERROR_SUCCESS if completed or another error code on failure
 
| ERROR_SUCCESS if completed or another error code on failure
 
|-
 
|-
! '''Note'''
+
! Note
| For Graphics Console functions, Viewport is based on screen pixels not characters
+
| For Graphics Console functions, Viewport is based on screen pixels not characters.
|-
+
|}
+
</div></div>
+
<br />
+
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;">
+
<pre style="border: 0; padding-bottom:0px;">function GraphicsWindowResetViewport(Handle:TWindowHandle):LongWord;</pre>
+
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Reset the window viewport for an existing console window to the maximum size</div>
+
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
+
{| class="wikitable" style="font-size: 14px; background: white;"
+
|-
+
! '''Handle'''
+
| The handle of the window to reset the viewport for
+
|-
+
! '''Return'''
+
| ERROR_SUCCESS if completed or another error code on failure
+
 
|-
 
|-
 
|}
 
|}
Line 451: Line 608:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Handle'''
+
! Handle
 
| The handle of the window to get the viewport for
 
| The handle of the window to get the viewport for
 
|-
 
|-
! '''X1'''
+
! X1
 
| The left edge of the window viewport
 
| The left edge of the window viewport
 
|-
 
|-
! '''Y1'''
+
! Y1
 
| The top edge of the window viewport
 
| The top edge of the window viewport
 
|-
 
|-
! '''X2'''
+
! X2
 
| The right edge of the window viewport
 
| The right edge of the window viewport
 
|-
 
|-
! '''Y2'''
+
! Y2
 
| The bottom edge of the window viewport
 
| The bottom edge of the window viewport
 
|-
 
|-
! '''Return'''
+
! Return
 
| ERROR_SUCCESS if completed or another error code on failure
 
| ERROR_SUCCESS if completed or another error code on failure
 
|-
 
|-
! '''Note'''
+
! Note
| For Graphics Console functions, Viewport is based on screen pixels not characters
+
| For Graphics Console functions, Viewport is based on screen pixels not characters.
 
|-
 
|-
 
|}
 
|}
Line 476: Line 633:
 
<br />
 
<br />
 
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;">
 
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;">
<pre style="border: 0; padding-bottom:0px;">function GraphicsWindowResetRect(Handle:TWindowHandle):LongWord; inline;</pre>
+
<pre style="border: 0; padding-bottom:0px;">function GraphicsWindowResetViewport(Handle:TWindowHandle):LongWord;</pre>
 
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Reset the window viewport for an existing console window to the maximum size</div>
 
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Reset the window viewport for an existing console window to the maximum size</div>
 
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Handle'''
+
! Handle
 
| The handle of the window to reset the viewport for
 
| The handle of the window to reset the viewport for
 
|-
 
|-
! '''Return'''
+
! Return
 
| ERROR_SUCCESS if completed or another error code on failure
 
| ERROR_SUCCESS if completed or another error code on failure
 
|-
 
|-
Line 496: Line 653:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Handle'''
+
! Handle
 
| The handle of the window to get columns for
 
| The handle of the window to get columns for
 
|-
 
|-
! '''Return'''
+
! Return
 
| The columns value for the current window viewport
 
| The columns value for the current window viewport
 
|-
 
|-
! '''Note'''
+
! Note
| For Graphics Console functions, Columns is based on screen pixels not characters
+
| For Graphics Console functions, Columns is based on screen pixels not characters.
 
|-
 
|-
 
|}
 
|}
Line 514: Line 671:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Handle'''
+
! Handle
 
| The handle of the window to get rows for
 
| The handle of the window to get rows for
 
|-
 
|-
! '''Return'''
+
! Return
 
| The rows value for the current window viewport
 
| The rows value for the current window viewport
 
|-
 
|-
! '''Note'''
+
! Note
| For Graphics Console functions, Rows is based on screen pixels not characters
+
| For Graphics Console functions, Rows is based on screen pixels not characters.
 
|-
 
|-
 
|}
 
|}
Line 532: Line 689:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Handle'''
+
! Handle
 
| The handle of the window to get the width for
 
| The handle of the window to get the width for
 
|-
 
|-
! '''Return'''
+
! Return
 
| The absolute width of the window
 
| The absolute width of the window
 
|-
 
|-
! '''Note'''
+
! Note
| For Graphics Console functions, Width is based on screen pixels not characters
+
| For Graphics Console functions, Width is based on screen pixels not characters.
 
|-
 
|-
 
|}
 
|}
Line 550: Line 707:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Handle'''
+
! Handle
 
| The handle of the window to get the height for
 
| The handle of the window to get the height for
 
|-
 
|-
! '''Return'''
+
! Return
 
| The absolute height of the window
 
| The absolute height of the window
 
|-
 
|-
! '''Note'''
+
! Note
| For Graphics Console functions, Height is based on screen pixels not characters
+
| For Graphics Console functions, Height is based on screen pixels not characters.
 
|-
 
|-
 
|}
 
|}
Line 568: Line 725:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Handle'''
+
! Handle
 
| The handle of the window to get the format for
 
| The handle of the window to get the format for
 
|-
 
|-
! '''Return'''
+
! Return
 
| The color format of the window (eg COLOR_FORMAT_ARGB32)
 
| The color format of the window (eg COLOR_FORMAT_ARGB32)
 
|-
 
|-
Line 583: Line 740:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Handle'''
+
! Handle
 
| The handle of the window to get the foreground color for
 
| The handle of the window to get the foreground color for
 
|-
 
|-
! '''Return'''
+
! Return
 
| The foreground color of the window (eg COLOR_WHITE)
 
| The foreground color of the window (eg COLOR_WHITE)
 
|-
 
|-
Line 598: Line 755:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Handle'''
+
! Handle
 
| The handle of the window to set the foreground color for
 
| The handle of the window to set the foreground color for
 
|-
 
|-
! '''Color'''
+
! Color
 
| The foreground color to set (eg COLOR_WHITE)
 
| The foreground color to set (eg COLOR_WHITE)
 
|-
 
|-
! '''Return'''
+
! Return
 
| ERROR_SUCCESS if completed or another error code on failure
 
| ERROR_SUCCESS if completed or another error code on failure
 
|-
 
|-
Line 616: Line 773:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Handle'''
+
! Handle
 
| The handle of the window to get the background color for
 
| The handle of the window to get the background color for
 
|-
 
|-
! '''Return'''
+
! Return
 
| The background color of the window (eg COLOR_BLACK)
 
| The background color of the window (eg COLOR_BLACK)
 
|-
 
|-
Line 631: Line 788:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Handle'''
+
! Handle
 
| The handle of the window to set the background color for
 
| The handle of the window to set the background color for
 
|-
 
|-
! '''Color'''
+
! Color
 
| The background color to set (eg COLOR_BLACK)
 
| The background color to set (eg COLOR_BLACK)
 
|-
 
|-
! '''Return'''
+
! Return
 
| ERROR_SUCCESS if completed or another error code on failure
 
| ERROR_SUCCESS if completed or another error code on failure
 
|-
 
|-
Line 649: Line 806:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Handle'''
+
! Handle
 
| The handle of the window to get the default font for
 
| The handle of the window to get the default font for
 
|-
 
|-
! '''Return'''
+
! Return
 
| The font handle of the default font or INVALID_HANDLE_VALUE on error
 
| The font handle of the default font or INVALID_HANDLE_VALUE on error
 
|-
 
|-
Line 664: Line 821:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Handle'''
+
! Handle
 
| The handle of the window to set the default font for
 
| The handle of the window to set the default font for
 
|-
 
|-
! '''Font'''
+
! Font
 
| The font handle of the default font to set
 
| The font handle of the default font to set
 
|-
 
|-
! '''Return'''
+
! Return
 +
| ERROR_SUCCESS if completed or another error code on failure
 +
|-
 +
|}
 +
</div></div>
 +
<br />
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;">
 +
<pre style="border: 0; padding-bottom:0px;">function GraphicsWindowGetCursorXY(Handle:TWindowHandle; var X,Y:LongWord):LongWord; inline;</pre>
 +
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Get the current cursor X and Y positions of an existing console window</div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
! Handle
 +
| The handle of the window to get cursor X and Y for
 +
|-
 +
! X
 +
| The returned cursor X value
 +
|-
 +
! Y
 +
| The returned cursor Y value
 +
|-
 +
! Return
 +
| ERROR_SUCCESS if completed or another error code on failure
 +
|-
 +
! Note
 +
| For Graphics Console functions, cursor X and Y are based on screen pixels not characters.
 +
|-
 +
|}
 +
</div></div>
 +
<br />
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;">
 +
<pre style="border: 0; padding-bottom:0px;">function GraphicsWindowSetCursorXY(Handle:TWindowHandle; X,Y:LongWord):LongWord;</pre>
 +
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Set the current cursor X and Y positions of an existing console window</div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
! Handle
 +
| The handle of the window to set cursor X and Y for
 +
|-
 +
! X
 +
| The new cursor X value
 +
|-
 +
! Y
 +
| The new cursor Y value
 +
|-
 +
! Return
 +
| ERROR_SUCCESS if completed or another error code on failure
 +
|-
 +
! Note
 +
| For Graphics Console functions, cursor X and Y are based on screen pixels not characters.
 +
|-
 +
|}
 +
</div></div>
 +
<br />
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;">
 +
<pre style="border: 0; padding-bottom:0px;">function GraphicsWindowGetCursorMode(Handle:TWindowHandle):TCursorMode; inline;</pre>
 +
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Get the current cursor mode of an existing console window</div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
! Handle
 +
| The handle of the window to get the mode for
 +
|-
 +
! Return
 +
| The current cursor mode (eg CURSOR_MODE_INSERT)
 +
|-
 +
|}
 +
</div></div>
 +
<br />
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;">
 +
<pre style="border: 0; padding-bottom:0px;">function GraphicsWindowSetCursorMode(Handle:TWindowHandle; CursorMode:TCursorMode):LongWord; inline;</pre>
 +
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Set the current cursor mode of an existing console window</div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
! Handle
 +
| The handle of the window to set the mode for
 +
|-
 +
! CursorMode
 +
| The cursor mode to set (eg CURSOR_MODE_INSERT)
 +
|-
 +
! Return
 +
| ERROR_SUCCESS if completed or another error code on failure}
 +
|-
 +
|}
 +
</div></div>
 +
<br />
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;">
 +
<pre style="border: 0; padding-bottom:0px;">function GraphicsWindowGetCursorBlink(Handle:TWindowHandle):Boolean; inline;</pre>
 +
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Get the current cursor blink state of an existing console window</div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
! Handle
 +
| The handle of the window to get blink state for
 +
|-
 +
! Return
 +
| True if blink is enabled, False if not or on error.
 +
|-
 +
|}
 +
</div></div>
 +
<br />
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;">
 +
<pre style="border: 0; padding-bottom:0px;">function GraphicsWindowSetCursorBlink(Handle:TWindowHandle; CursorBlink:Boolean):LongWord; inline;</pre>
 +
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Set the current cursor blink state of an existing console window</div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
! Handle
 +
| The handle of the window to set the blink state for
 +
|-
 +
! CursorBlink
 +
| True to enable blink, False to disable
 +
|-
 +
! Return
 +
| ERROR_SUCCESS if completed or another error code on failure
 +
|-
 +
|}
 +
</div></div>
 +
<br />
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;">
 +
<pre style="border: 0; padding-bottom:0px;">function GraphicsWindowGetCursorState(Handle:TWindowHandle):TCursorState; inline;</pre>
 +
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Get the current cursor state of an existing console window</div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
! Handle
 +
| The handle of the window to get the state for
 +
|-
 +
! Return
 +
| The current cursor state (eg CURSOR_STATE_ON)
 +
|-
 +
|}
 +
</div></div>
 +
<br />
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;">
 +
<pre style="border: 0; padding-bottom:0px;">function GraphicsWindowSetCursorState(Handle:TWindowHandle; CursorState:TCursorState):LongWord; inline;</pre>
 +
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Set the current cursor state of an existing console window</div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
! Handle
 +
| The handle of the window to set the state for
 +
|-
 +
! CursorState
 +
| The cursor state to set (eg CURSOR_STATE_ON)
 +
|-
 +
! Return
 +
| ERROR_SUCCESS if completed or another error code on failure
 +
|-
 +
|}
 +
</div></div>
 +
<br />
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;">
 +
<pre style="border: 0; padding-bottom:0px;">function GraphicsWindowGetCursorShape(Handle:TWindowHandle):TCursorShape; inline;</pre>
 +
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Get the current cursor shape of an existing console window</div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
! Handle
 +
| The handle of the window to get the shape for
 +
|-
 +
! Return
 +
| The current cursor shape (eg CURSORLINE)
 +
|-
 +
|}
 +
</div></div>
 +
<br />
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;">
 +
<pre style="border: 0; padding-bottom:0px;">function GraphicsWindowSetCursorShape(Handle:TWindowHandle; CursorShape:TCursorShape):LongWord; inline;</pre>
 +
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Set the current cursor shape of an existing console window</div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
! Handle
 +
| The handle of the window to set the shape for
 +
|-
 +
! CursorShape
 +
| The cursor shape to set (eg CURSORLINE)
 +
|-
 +
! Return
 +
| ERROR_SUCCESS if completed or another error code on failure
 +
|-
 +
|}
 +
</div></div>
 +
<br />
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;">
 +
<pre style="border: 0; padding-bottom:0px;">function GraphicsWindowCursorOn(Handle:TWindowHandle):LongWord; inline;</pre>
 +
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Enable the cursor on an existing console window</div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
! Handle
 +
| The handle of the window to enable the cursor for
 +
|-
 +
! Return
 +
| ERROR_SUCCESS if completed or another error code on failure
 +
|-
 +
|}
 +
</div></div>
 +
<br />
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;">
 +
<pre style="border: 0; padding-bottom:0px;">function GraphicsWindowCursorOff(Handle:TWindowHandle):LongWord; inline;</pre>
 +
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Disable the cursor on an existing console window</div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
! Handle
 +
| The handle of the window to disable the cursor for
 +
|-
 +
! Return
 +
| ERROR_SUCCESS if completed or another error code on failure
 +
|-
 +
|}
 +
</div></div>
 +
<br />
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;">
 +
<pre style="border: 0; padding-bottom:0px;">function GraphicsWindowCursorLine(Handle:TWindowHandle):LongWord; inline;</pre>
 +
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Change the cursor to a vertical line on an existing console window</div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
! Handle
 +
| The handle of the window to change the cursor for
 +
|-
 +
! Return
 +
| ERROR_SUCCESS if completed or another error code on failure
 +
|-
 +
|}
 +
</div></div>
 +
<br />
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;">
 +
<pre style="border: 0; padding-bottom:0px;">function GraphicsWindowCursorBar(Handle:TWindowHandle):LongWord; inline;</pre>
 +
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Change the cursor to a horizontal bar on an existing console window</div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
! Handle
 +
| The handle of the window to change the cursor for
 +
|-
 +
! Return
 +
| ERROR_SUCCESS if completed or another error code on failure
 +
|-
 +
|}
 +
</div></div>
 +
<br />
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;">
 +
<pre style="border: 0; padding-bottom:0px;">function GraphicsWindowCursorBlock(Handle:TWindowHandle):LongWord; inline;</pre>
 +
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Change the cursor to a solid block on an existing console window</div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
! Handle
 +
| The handle of the window to change the cursor for
 +
|-
 +
! Return
 +
| ERROR_SUCCESS if completed or another error code on failure
 +
|-
 +
|}
 +
</div></div>
 +
<br />
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;">
 +
<pre style="border: 0; padding-bottom:0px;">function GraphicsWindowCursorMove(Handle:TWindowHandle; X,Y:LongWord):LongWord;</pre>
 +
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Move the cursor on an existing console window</div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
! Handle
 +
| The handle of the window to move the cursor for
 +
|-
 +
! X
 +
| The column to move the cursor to
 +
|-
 +
! Y
 +
| The row to move the cursor to
 +
|-
 +
! Return
 +
| ERROR_SUCCESS if completed or another error code on failure
 +
|-
 +
! Note
 +
| For Graphics Console functions, X and Y are based on screen pixels not characters.
 +
|-
 +
|}
 +
</div></div>
 +
<br />
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;">
 +
<pre style="border: 0; padding-bottom:0px;">function GraphicsWindowCursorBlink(Handle:TWindowHandle; Enabled:Boolean):LongWord; inline;</pre>
 +
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Set the blink state of the cursor on an existing console window</div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
! Handle
 +
| The handle of the window to set the blink state for
 +
|-
 +
! Enabled
 +
| True if the cursor is blinking, False if not
 +
|-
 +
! Return
 
| ERROR_SUCCESS if completed or another error code on failure
 
| ERROR_SUCCESS if completed or another error code on failure
 
|-
 
|-
Line 682: Line 1,136:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Handle'''
+
! Handle
 
| The handle of the window to clear
 
| The handle of the window to clear
 
|-
 
|-
! '''Return'''
+
! Return
 
| ERROR_SUCCESS if completed or another error code on failure
 
| ERROR_SUCCESS if completed or another error code on failure
 
|-
 
|-
Line 697: Line 1,151:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Handle'''
+
! Handle
 
| The handle of the window to clear
 
| The handle of the window to clear
 
|-
 
|-
! '''X1'''
+
! X1
 
| The left edge of the area to clear (relative to current viewport)
 
| The left edge of the area to clear (relative to current viewport)
 
|-
 
|-
! '''Y1'''
+
! Y1
 
| The top edge of the area to clear (relative to current viewport)
 
| The top edge of the area to clear (relative to current viewport)
 
|-
 
|-
! '''X2'''
+
! X2
 
| The right edge of the area to clear (relative to current viewport)
 
| The right edge of the area to clear (relative to current viewport)
 
|-
 
|-
! '''Y2'''
+
! Y2
 
| The bottom edge of the area to clear (relative to current viewport)
 
| The bottom edge of the area to clear (relative to current viewport)
 
|-
 
|-
! '''Color'''
+
! Color
 
| The fill color for the area to clear (eg COLOR_WHITE)
 
| The fill color for the area to clear (eg COLOR_WHITE)
 
|-
 
|-
! '''Return'''
+
! Return
 
| ERROR_SUCCESS if completed or another error code on failure
 
| ERROR_SUCCESS if completed or another error code on failure
 
|-
 
|-
! '''Note'''
+
! Note
| For Graphics Console functions, Viewport is based on screen pixels not characters
+
| For Graphics Console functions, Viewport is based on screen pixels not characters.
 
|-
 
|-
 
|}
 
|}
Line 730: Line 1,184:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Handle'''
+
! Handle
 
| The handle of the window to draw on
 
| The handle of the window to draw on
 
|-
 
|-
! '''X1'''
+
! X1
 
| The left edge of the box (relative to current viewport)
 
| The left edge of the box (relative to current viewport)
 
|-
 
|-
! '''Y1'''
+
! Y1
 
| The top edge of the box (relative to current viewport)
 
| The top edge of the box (relative to current viewport)
 
|-
 
|-
! '''X2'''
+
! X2
 
| The right edge of the box (relative to current viewport)
 
| The right edge of the box (relative to current viewport)
 
|-
 
|-
! '''Y2'''
+
! Y2
 
| The bottom edge of the box (relative to current viewport)
 
| The bottom edge of the box (relative to current viewport)
 
|-
 
|-
! '''Color'''
+
! Color
 
| The color to draw with (eg COLOR_WHITE)
 
| The color to draw with (eg COLOR_WHITE)
 
|-
 
|-
! '''Width'''
+
! Width
 
| The width of the box outline
 
| The width of the box outline
 
|-
 
|-
! '''Return'''
+
! Return
 
| ERROR_SUCCESS if completed or another error code on failure
 
| ERROR_SUCCESS if completed or another error code on failure
 
|-
 
|-
! '''Note'''
+
! Note
| For Graphics Console functions, Viewport is based on screen pixels not characters
+
| For Graphics Console functions, Viewport is based on screen pixels not characters.
 
|-
 
|-
 
|}
 
|}
Line 766: Line 1,220:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Handle'''
+
! Handle
 
| The handle of the window to draw on
 
| The handle of the window to draw on
 
|-
 
|-
! '''X1'''
+
! X1
 
| The left starting point of the line (relative to current viewport)
 
| The left starting point of the line (relative to current viewport)
 
|-
 
|-
! '''Y1'''
+
! Y1
| The top starting point of the box (relative to current viewport)
+
| The top starting point of the line (relative to current viewport)
 
|-
 
|-
! '''X2'''
+
! X2
| The right ending point of the box (relative to current viewport)
+
| The right ending point of the line (relative to current viewport)
 
|-
 
|-
! '''Y2'''
+
! Y2
| The bottom ending point of the box (relative to current viewport)
+
| The bottom ending point of the line (relative to current viewport)
 
|-
 
|-
! '''Color'''
+
! Color
 
| The color to draw with (eg COLOR_WHITE)
 
| The color to draw with (eg COLOR_WHITE)
 
|-
 
|-
! '''Width'''
+
! Width
 
| The width of the line
 
| The width of the line
 
|-
 
|-
! '''Return'''
+
! Return
 
| ERROR_SUCCESS if completed or another error code on failure
 
| ERROR_SUCCESS if completed or another error code on failure
 
|-
 
|-
! '''Note'''
+
! Note
| For Graphics Console functions, Viewport is based on screen pixels not characters
+
| For Graphics Console functions, Viewport is based on screen pixels not characters.
 
|-
 
|-
 
|}
 
|}
Line 802: Line 1,256:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Handle'''
+
! Handle
 
| The handle of the window to draw on
 
| The handle of the window to draw on
 
|-
 
|-
! '''X1'''
+
! X1
 
| The left edge of the block (relative to current viewport)
 
| The left edge of the block (relative to current viewport)
 
|-
 
|-
! '''Y1'''
+
! Y1
 
| The top edge of the block (relative to current viewport)
 
| The top edge of the block (relative to current viewport)
 
|-
 
|-
! '''X2'''
+
! X2
 
| The right edge of the block (relative to current viewport)
 
| The right edge of the block (relative to current viewport)
 
|-
 
|-
! '''Y2'''
+
! Y2
 
| The bottom edge of the block (relative to current viewport)
 
| The bottom edge of the block (relative to current viewport)
 
|-
 
|-
! '''Color'''
+
! Color
 
| The color to draw with (eg COLOR_WHITE)
 
| The color to draw with (eg COLOR_WHITE)
 
|-
 
|-
! '''Return'''
+
! Return
 
| ERROR_SUCCESS if completed or another error code on failure
 
| ERROR_SUCCESS if completed or another error code on failure
 
|-
 
|-
! '''Note'''
+
! Note
| For Graphics Console functions, Viewport is based on screen pixels not characters
+
| For Graphics Console functions, Viewport is based on screen pixels not characters.
 +
|-
 +
|}
 +
</div></div>
 +
<br />
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;">
 +
<pre style="border: 0; padding-bottom:0px;">function GraphicsWindowDrawCircle(Handle:TWindowHandle; X,Y,Color,Width,Radius:LongWord):LongWord;</pre>
 +
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Draw a circle on an existing console window</div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
! Handle
 +
| The handle of the window to draw on
 +
|-
 +
! X
 +
| The left starting point of the circle (relative to current viewport)
 +
|-
 +
! Y
 +
| The top starting point of the circle (relative to current viewport)
 +
|-
 +
! Color
 +
| The color to draw with (eg COLOR_WHITE)
 +
|-
 +
! Width
 +
| The width of the circle outline
 +
|-
 +
! Radius
 +
| The radius of the circle
 +
|-
 +
! Return
 +
| ERROR_SUCCESS if completed or another error code on failure
 +
|-
 +
! Note
 +
| For Graphics Console functions, Viewport is based on screen pixels not characters.
 
|-
 
|-
 
|}
 
|}
Line 835: Line 1,322:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Handle'''
+
! Handle
 
| The handle of the window to draw on
 
| The handle of the window to draw on
 
|-
 
|-
! '''Ch'''
+
! Ch
 
| The character to draw
 
| The character to draw
 
|-
 
|-
! '''X'''
+
! X
 
| The left starting point of the character (relative to current viewport)
 
| The left starting point of the character (relative to current viewport)
 
|-
 
|-
! '''Y'''
+
! Y
 
| The top starting point of the character (relative to current viewport)
 
| The top starting point of the character (relative to current viewport)
 
|-
 
|-
! '''Return'''
+
! Return
 
| ERROR_SUCCESS if completed or another error code on failure
 
| ERROR_SUCCESS if completed or another error code on failure
 
|-
 
|-
! '''Note'''
+
! Note
| For Graphics Console functions, Viewport is based on screen pixels not characters
+
| For Graphics Console functions, Viewport is based on screen pixels not characters.
 
|-
 
|-
 
|}
 
|}
Line 862: Line 1,349:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Handle'''
+
! Handle
 
| The handle of the window to draw on
 
| The handle of the window to draw on
 
|-
 
|-
! '''Font'''
+
! Font
 
| The handle of the font to draw the character with
 
| The handle of the font to draw the character with
 
|-
 
|-
! '''Ch'''
+
! Ch
 
| The character to draw
 
| The character to draw
 
|-
 
|-
! '''X'''
+
! X
 
| The left starting point of the character (relative to current viewport)
 
| The left starting point of the character (relative to current viewport)
 
|-
 
|-
! '''Y'''
+
! Y
 
| The top starting point of the character (relative to current viewport)
 
| The top starting point of the character (relative to current viewport)
 
|-
 
|-
! '''Forecolor'''
+
! Forecolor
 
| The foreground color for the character (eg COLOR_WHITE)
 
| The foreground color for the character (eg COLOR_WHITE)
 
|-
 
|-
! '''Backcolor'''
+
! Backcolor
 
| The background color for the character (eg COLOR_BLACK)
 
| The background color for the character (eg COLOR_BLACK)
 
|-
 
|-
! '''Return'''
+
! Return
 
| ERROR_SUCCESS if completed or another error code on failure
 
| ERROR_SUCCESS if completed or another error code on failure
 
|-
 
|-
! '''Note'''
+
! Note
| For Graphics Console functions, Viewport is based on screen pixels not characters
+
| For Graphics Console functions, Viewport is based on screen pixels not characters.
 
|-
 
|-
 
|}
 
|}
Line 898: Line 1,385:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Handle'''
+
! Handle
 
| The handle of the window to draw on
 
| The handle of the window to draw on
 
|-
 
|-
! '''Text'''
+
! Text
 
| The text to draw
 
| The text to draw
 
|-
 
|-
! '''X'''
+
! X
 
| The left starting point of the text (relative to current viewport)
 
| The left starting point of the text (relative to current viewport)
 
|-
 
|-
! '''Y'''
+
! Y
 
| The top starting point of the text (relative to current viewport)
 
| The top starting point of the text (relative to current viewport)
 
|-
 
|-
! '''Return'''
+
! Return
 
| ERROR_SUCCESS if completed or another error code on failure
 
| ERROR_SUCCESS if completed or another error code on failure
 
|-
 
|-
! '''Note'''
+
! Note
| For Graphics Console functions, Viewport is based on screen pixels not characters
+
| For Graphics Console functions, Viewport is based on screen pixels not characters.
 
|-
 
|-
 
|}
 
|}
Line 925: Line 1,412:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Handle'''
+
! Handle
 
| The handle of the window to draw on
 
| The handle of the window to draw on
 
|-
 
|-
! '''Font'''
+
! Font
 
| The handle of the font to draw the text with
 
| The handle of the font to draw the text with
 
|-
 
|-
! '''Text'''
+
! Text
 
| The text to draw
 
| The text to draw
 
|-
 
|-
! '''X'''
+
! X
 
| The left starting point of the text (relative to current viewport)
 
| The left starting point of the text (relative to current viewport)
 
|-
 
|-
! '''Y'''
+
! Y
 
| The top starting point of the text (relative to current viewport)
 
| The top starting point of the text (relative to current viewport)
 
|-
 
|-
! '''Forecolor'''
+
! Forecolor
 
| The foreground color for the text (eg COLOR_WHITE)
 
| The foreground color for the text (eg COLOR_WHITE)
 
|-
 
|-
! '''Backcolor'''
+
! Backcolor
 
| The background color for the text (eg COLOR_BLACK)
 
| The background color for the text (eg COLOR_BLACK)
 
|-
 
|-
! '''Return'''
+
! Return
 
| ERROR_SUCCESS if completed or another error code on failure
 
| ERROR_SUCCESS if completed or another error code on failure
 
|-
 
|-
! '''Note'''
+
! Note
| For Graphics Console functions, Viewport is based on screen pixels not characters
+
| For Graphics Console functions, Viewport is based on screen pixels not characters.
 
|-
 
|-
 
|}
 
|}
Line 961: Line 1,448:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Handle'''
+
! Handle
 
| The handle of the window to draw on
 
| The handle of the window to draw on
 
|-
 
|-
! '''X'''
+
! X
 
| The column for the pixel (relative to current viewport)
 
| The column for the pixel (relative to current viewport)
 
|-
 
|-
! '''Y'''
+
! Y
 
| The row for the pixel (relative to current viewport)
 
| The row for the pixel (relative to current viewport)
 
|-
 
|-
! '''Color'''
+
! Color
 
| The color for the pixel (eg COLOR_WHITE)
 
| The color for the pixel (eg COLOR_WHITE)
 
|-
 
|-
! '''Return'''
+
! Return
 
| ERROR_SUCCESS if completed or another error code on failure
 
| ERROR_SUCCESS if completed or another error code on failure
 
|-
 
|-
! '''Note'''
+
! Note
| For Graphics Console functions, Viewport is based on screen pixels not characters
+
| For Graphics Console functions, Viewport is based on screen pixels not characters.
 
|-
 
|-
 
|}
 
|}
Line 988: Line 1,475:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Handle'''
+
! Handle
 
| The handle of the window to draw on
 
| The handle of the window to draw on
 
|-
 
|-
! '''X'''
+
! X
 
| The left starting point of the image (relative to current viewport)
 
| The left starting point of the image (relative to current viewport)
 
|-
 
|-
! '''Y'''
+
! Y
 
| The top starting point of the image (relative to current viewport)
 
| The top starting point of the image (relative to current viewport)
 
|-
 
|-
! '''Image'''
+
! Image
 
| Pointer to the image data in a contiguous block of pixel rows
 
| Pointer to the image data in a contiguous block of pixel rows
 
|-
 
|-
! '''Width'''
+
! Width
 
| The width in pixels of a row in the image data
 
| The width in pixels of a row in the image data
 
|-
 
|-
! '''Height'''
+
! Height
 
| The height in pixels of all rows in the image data
 
| The height in pixels of all rows in the image data
 
|-
 
|-
! '''Format'''
+
! Format
 
| The color format of the image data (eg COLOR_FORMAT_ARGB32) Pass COLOR_FORMAT_UNKNOWN to use the window format
 
| The color format of the image data (eg COLOR_FORMAT_ARGB32) Pass COLOR_FORMAT_UNKNOWN to use the window format
 
|-
 
|-
! '''Return'''
+
! Return
 
| ERROR_SUCCESS if completed or another error code on failure
 
| ERROR_SUCCESS if completed or another error code on failure
 
|-
 
|-
! '''Note'''
+
! Note
| For Graphics Console functions, Viewport is based on screen pixels not characters
+
| For Graphics Console functions, Viewport is based on screen pixels not characters.
 
|-
 
|-
 
|}
 
|}
Line 1,024: Line 1,511:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Handle'''
+
! Handle
 
| The handle of the window to get from
 
| The handle of the window to get from
 
|-
 
|-
! '''X'''
+
! X
 
| The column of the pixel (relative to current viewport)
 
| The column of the pixel (relative to current viewport)
 
|-
 
|-
! '''Y'''
+
! Y
 
| The row of the pixel (relative to current viewport)
 
| The row of the pixel (relative to current viewport)
 
|-
 
|-
! '''Return'''
+
! Return
 
| The color of the pixel at X,Y (eg COLOR_WHITE)
 
| The color of the pixel at X,Y (eg COLOR_WHITE)
 
|-
 
|-
! '''Note'''
+
! Note
| For Graphics Console functions, Viewport is based on screen pixels not characters
+
| For Graphics Console functions, Viewport is based on screen pixels not characters.
 
|-
 
|-
 
|}
 
|}
Line 1,048: Line 1,535:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Handle'''
+
! Handle
 
| The handle of the window to get from
 
| The handle of the window to get from
 
|-
 
|-
! '''X'''
+
! X
 
| The left starting point of the image (relative to current viewport)
 
| The left starting point of the image (relative to current viewport)
 
|-
 
|-
! '''Y'''
+
! Y
 
| The top starting point of the image (relative to current viewport)
 
| The top starting point of the image (relative to current viewport)
 
|-
 
|-
! '''Image'''
+
! Image
 
| Pointer to a block of memory large enough to hold the image in a contiguous block of pixel rows
 
| Pointer to a block of memory large enough to hold the image in a contiguous block of pixel rows
 
|-
 
|-
! '''Width'''
+
! Width
 
| The width in pixels of a row of the image
 
| The width in pixels of a row of the image
 
|-
 
|-
! '''Height'''
+
! Height
 
| The height in pixels of all rows of the image
 
| The height in pixels of all rows of the image
 
|-
 
|-
! '''Format'''
+
! Format
 
| The color format to store in the image data (eg COLOR_FORMAT_ARGB32) Pass COLOR_FORMAT_UNKNOWN to use the window format
 
| The color format to store in the image data (eg COLOR_FORMAT_ARGB32) Pass COLOR_FORMAT_UNKNOWN to use the window format
 
|-
 
|-
! '''Return'''
+
! Return
 
| ERROR_SUCCESS if completed or another error code on failure
 
| ERROR_SUCCESS if completed or another error code on failure
 
|-
 
|-
! '''Note'''
+
! Note
| For Graphics Console functions, Viewport is based on screen pixels not characters
+
| For Graphics Console functions, Viewport is based on screen pixels not characters.
 
|-
 
|-
 
|}
 
|}
Line 1,080: Line 1,567:
 
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;">
 
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;">
 
<pre style="border: 0; padding-bottom:0px;">function GraphicsWindowCopyImage(Handle:TWindowHandle; const Source,Dest:TConsolePoint; Width,Height:LongWord):LongWord; inline;</pre>
 
<pre style="border: 0; padding-bottom:0px;">function GraphicsWindowCopyImage(Handle:TWindowHandle; const Source,Dest:TConsolePoint; Width,Height:LongWord):LongWord; inline;</pre>
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Copy an image from one place to another in a existing console window</div>
+
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Copy an image from one place to another in an existing console window</div>
 
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Handle'''
+
! Handle
 
| The handle of the window to copy from and to
 
| The handle of the window to copy from and to
 
|-
 
|-
! '''Source'''
+
! Source
 
| The starting point (X,Y) to copy the image from
 
| The starting point (X,Y) to copy the image from
 
|-
 
|-
! '''Dest'''
+
! Dest
 
| The starting point (X,Y) to copy the image to
 
| The starting point (X,Y) to copy the image to
 
|-
 
|-
! '''Width'''
+
! Width
 
| The width in pixels of each row of the image
 
| The width in pixels of each row of the image
 
|-
 
|-
! '''Height'''
+
! Height
 
| The height in pixels of all rows of the image
 
| The height in pixels of all rows of the image
 
|-
 
|-
! '''Return'''
+
! Return
 
| ERROR_SUCCESS if completed or another error code on failure
 
| ERROR_SUCCESS if completed or another error code on failure
 
|-
 
|-
! '''Note'''
+
! Note
| For Graphics Console functions, Viewport is based on screen pixels not characters
+
| For Graphics Console functions, Viewport is based on screen pixels not characters.
 
|-
 
|-
 
|}
 
|}
Line 1,110: Line 1,597:
 
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;">
 
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;">
 
<pre style="border: 0; padding-bottom:0px;">function GraphicsWindowMoveImage(Handle:TWindowHandle; const Source,Dest:TConsolePoint; Width,Height,Fillcolor:LongWord):LongWord;</pre>
 
<pre style="border: 0; padding-bottom:0px;">function GraphicsWindowMoveImage(Handle:TWindowHandle; const Source,Dest:TConsolePoint; Width,Height,Fillcolor:LongWord):LongWord;</pre>
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Move an image from one place to another in a existing console window</div>
+
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Move an image from one place to another in an existing console window</div>
 
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Handle'''
+
! Handle
 
| The handle of the window to copy from and to
 
| The handle of the window to copy from and to
 
|-
 
|-
! '''Source'''
+
! Source
 
| The starting point (X,Y) to copy the image from
 
| The starting point (X,Y) to copy the image from
 
|-
 
|-
! '''Dest'''
+
! Dest
 
| The starting point (X,Y) to copy the image to
 
| The starting point (X,Y) to copy the image to
 
|-
 
|-
! '''Width'''
+
! Width
 
| The width in pixels of each row of the image
 
| The width in pixels of each row of the image
 
|-
 
|-
! '''Height'''
+
! Height
 
| The height in pixels of all rows of the image
 
| The height in pixels of all rows of the image
 
|-
 
|-
! '''Fillcolor'''
+
! Fillcolor
 
| The color to fill the area where the image was moved from (COLOR_NONE for no fill, same as copy)
 
| The color to fill the area where the image was moved from (COLOR_NONE for no fill, same as copy)
 
|-
 
|-
! '''Return'''
+
! Return
 
| ERROR_SUCCESS if completed or another error code on failure
 
| ERROR_SUCCESS if completed or another error code on failure
 
|-
 
|-
! '''Note'''
+
! Note
| For Graphics Console functions, Viewport is based on screen pixels not characters
+
| For Graphics Console functions, Viewport is based on screen pixels not characters.
 
|-
 
|-
 
|}
 
|}
Line 1,142: Line 1,629:
 
<br />
 
<br />
 
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;">
 
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;">
<pre style="border: 0; padding-bottom:0px;">function GraphicsWindowImageSize(Handle:TWindowHandle; Width,Height,Format:LongWord):LongWord;</pre>
+
<pre style="border: 0; padding-bottom:0px;">function GraphicsWindowImageSize(Handle:TWindowHandle; Width,Height,Format,Stride:LongWord):LongWord;</pre>
 
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Calculate the size in bytes of an image that is Width by Height in the color format specified</div>
 
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Calculate the size in bytes of an image that is Width by Height in the color format specified</div>
 
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Handle'''
+
! Handle
 
| The handle of the window for the image
 
| The handle of the window for the image
 
|-
 
|-
! '''Width'''
+
! Width
 
| The width of the image in pixels
 
| The width of the image in pixels
 
|-
 
|-
! '''Height'''
+
! Height
 
| The height of the image in pixels
 
| The height of the image in pixels
 
|-
 
|-
! '''Format'''
+
! Format
 
| The color format to use for the calculation (eg COLOR_FORMAT_ARGB32) Pass COLOR_FORMAT_UNKNOWN to use the window format
 
| The color format to use for the calculation (eg COLOR_FORMAT_ARGB32) Pass COLOR_FORMAT_UNKNOWN to use the window format
 
|-
 
|-
! '''Return'''
+
! Stride
 +
| The distance in bytes between each row of pixels (Optional)
 +
|-
 +
! Return
 
| The size in bytes for an image of the specified size and format or 0 on error
 
| The size in bytes for an image of the specified size and format or 0 on error
 
|-
 
|-
Line 1,166: Line 1,656:
 
<br />
 
<br />
 
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;">
 
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;">
<pre style="border: 0; padding-bottom:0px;">function GraphicsWindowImageFromStream(Handle:TWindowHandle; X,Y:LongWord; Stream:TStream; Width,Height,Format:LongWord):LongWord;</pre>
+
<pre style="border: 0; padding-bottom:0px;">function GraphicsWindowImageFromStream(Handle:TWindowHandle; X,Y:LongWord; Stream:TStream; Width,Height,Format,Stride:LongWord; Invert:Boolean):LongWord;</pre>
 
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Draw an image to an existing console window from a supplied stream</div>
 
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Draw an image to an existing console window from a supplied stream</div>
 
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Handle'''
+
! Handle
 
| The handle of the window to draw on
 
| The handle of the window to draw on
 
|-
 
|-
! '''X'''
+
! X
 
| The left starting point of the image (relative to current viewport)
 
| The left starting point of the image (relative to current viewport)
 
|-
 
|-
! '''Y'''
+
! Y
 
| The top starting point of the image (relative to current viewport)
 
| The top starting point of the image (relative to current viewport)
 
|-
 
|-
! '''Stream'''
+
! Stream
 
| A stream containing the image data in a contiguous block of pixel rows
 
| A stream containing the image data in a contiguous block of pixel rows
 
|-
 
|-
! '''Width'''
+
! Width
 
| The width in pixels of a row in the image data
 
| The width in pixels of a row in the image data
 
|-
 
|-
! '''Height'''
+
! Height
 
| The height in pixels of all rows in the image data
 
| The height in pixels of all rows in the image data
 
|-
 
|-
! '''Format'''
+
! Format
 
| The color format of the image data (eg COLOR_FORMAT_ARGB32) Pass COLOR_FORMAT_UNKNOWN to use the window format
 
| The color format of the image data (eg COLOR_FORMAT_ARGB32) Pass COLOR_FORMAT_UNKNOWN to use the window format
 
|-
 
|-
! '''Return'''
+
! Stride
 +
| The distance in bytes between each row of pixels (Optional)
 +
|-
 +
! Invert
 +
| If True invert the image so the first row is the bottom and the last row is the top
 +
|-
 +
! Return
 
| ERROR_SUCCESS if completed or another error code on failure
 
| ERROR_SUCCESS if completed or another error code on failure
 
|-
 
|-
! '''Note'''
+
! Note
| For Graphics Console functions, Viewport is based on screen pixels not characters
+
| For Graphics Console functions, Viewport is based on screen pixels not characters.
 
|-
 
|-
 
|}
 
|}
Line 1,202: Line 1,698:
 
<br />
 
<br />
 
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;">
 
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;">
<pre style="border: 0; padding-bottom:0px;">function GraphicsWindowImageToStream(Handle:TWindowHandle; X,Y:LongWord; Stream:TStream; Width,Height,Format:LongWord):LongWord;</pre>
+
<pre style="border: 0; padding-bottom:0px;">function GraphicsWindowImageToStream(Handle:TWindowHandle; X,Y:LongWord; Stream:TStream; Width,Height,Format,Stride:LongWord; Invert:Boolean):LongWord;</pre>
 
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Get an image from an existing console window to a supplied stream</div>
 
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Get an image from an existing console window to a supplied stream</div>
 
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Handle'''
+
! Handle
 
| The handle of the window to get from
 
| The handle of the window to get from
 
|-
 
|-
! '''X'''
+
! X
 
| The left starting point of the image (relative to current viewport)
 
| The left starting point of the image (relative to current viewport)
 
|-
 
|-
! '''Y'''
+
! Y
 
| The top starting point of the image (relative to current viewport)
 
| The top starting point of the image (relative to current viewport)
 
|-
 
|-
! '''Stream'''
+
! Stream
 
| A stream large enough to hold the image in a contiguous block of pixel rows
 
| A stream large enough to hold the image in a contiguous block of pixel rows
 
|-
 
|-
! '''Width'''
+
! Width
 
| The width in pixels of a row of the image
 
| The width in pixels of a row of the image
 
|-
 
|-
! '''Height'''
+
! Height
 
| The height in pixels of all rows of the image
 
| The height in pixels of all rows of the image
 
|-
 
|-
! '''Format'''
+
! Format
 
| The color format to store in the image data (eg COLOR_FORMAT_ARGB32) Pass COLOR_FORMAT_UNKNOWN to use the window format
 
| The color format to store in the image data (eg COLOR_FORMAT_ARGB32) Pass COLOR_FORMAT_UNKNOWN to use the window format
 
|-
 
|-
! '''Return'''
+
! Stride
 +
| The distance in bytes between each row of pixels (Optional)
 +
|-
 +
! Invert
 +
| If True invert the image so the first row is the bottom and the last row is the top
 +
|-
 +
! Return
 
| ERROR_SUCCESS if completed or another error code on failure
 
| ERROR_SUCCESS if completed or another error code on failure
 
|-
 
|-
! '''Note'''
+
! Note
| For Graphics Console functions, Viewport is based on screen pixels not characters
+
| For Graphics Console functions, Viewport is based on screen pixels not characters.
 
|-
 
|-
 
|}
 
|}
Line 1,246: Line 1,748:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Console'''
+
! Console
 
| The console device to get the window count for
 
| The console device to get the window count for
 
|-
 
|-
! '''Return'''
+
! Return
 
| The current number of console windows on the specified console device
 
| The current number of console windows on the specified console device
 +
|-
 +
|}
 +
</div></div>
 +
<br />
 +
<div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;">
 +
<pre style="border: 0; padding-bottom:0px;">function GraphicsWindowGetActive(Console:PConsoleDevice):TWindowHandle; inline;</pre>
 +
<div style="font-size: 14px; padding-left: 12px;">'''Description:''' Get the current console active window</div>
 +
<div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;">
 +
{| class="wikitable" style="font-size: 14px; background: white;"
 +
|-
 +
! Console
 +
| The console device to get the active window for
 +
|-
 +
! Return
 +
| The window handle of the current active window or INVALID_HANDLE_VALUE on failure
 
|-
 
|-
 
|}
 
|}
Line 1,261: Line 1,778:
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
{| class="wikitable" style="font-size: 14px; background: white;"
 
|-
 
|-
! '''Console'''
+
! Console
 
| The console device to search for the window
 
| The console device to search for the window
 
|-
 
|-
! '''Window'''
+
! Window
 
| The window entry to check for validity
 
| The window entry to check for validity
 
|-
 
|-
! '''Return'''
+
! Return
 
| The supplied window if successful or nil on failure
 
| The supplied window if successful or nil on failure
 
|-
 
|-

Latest revision as of 04:50, 10 October 2023

Return to Unit Reference


Description


Ultibo Graphics Console Interface unit

The Graphics console unit provides access to the underlying framebuffer device as a pixel interface that allows putting blocks (or rectangles) of pixel data on to the screen or getting rectangles of pixel data from the screen. Functions are also included to copy a rectangle from one part of the screen to another and to put text (with a specified font) on to the screen.

Most image formats either consist of, or can be decoded to, a block of data that is a number of horizontal rows each with a number of pixels (columns) with each pixel containing color information in a certain bit size (8/16/24/32) and format (RGB/BGR/RGBA etc).

If the data exists in memory as a single contiguous block with each row following directly after the previous row then that can be passed directly to the functions in this unit (eg GraphicsWindowDrawImage) to be drawn on the screen.

Many graphics libraries do image manipulation, rendering and compositing to a memory buffer in a form that is compatible with the functions in this unit so a complex image can be constructed in memory and then transferred to the screen in a single operation. This is sometimes referred to as a bit block transfer or BitBlt and is a very standard technique for rendering both text and images to a framebuffer device.

This unit extends the console unit by creating a new type of console window (WINDOW_MODE_GRAPHICS) and therefore allows both text console windows and graphics console windows to co-exist on the screen at once.

The functions in this unit cannot be used to draw on a text console window (WINDOW_MODE_TEXT) and vice versa the functions in the console unit cannot be used to draw on a graphics console window.

Like the console unit, the graphics console supports setting a viewport for a specified window to allow masking the area to be written to. However the graphics console does not support tracking a cursor X and Y position. Setting a window as the default is also not supported since that functionality is purely intended to support the RTL functions for text output.

Graphics windows can only be created on console devices which have a mode of CONSOLE_MODE_PIXEL.

Notes: Unlike the Console unit, Graphics console coordinates are always based on pixels not characters. Graphics console coordinates begin at 0,0 and extend to Width - 1, Height - 1. Graphics Window coordinates X,Y are always based on pixels, beginning at 0,0 and extending to Cols - 1, Rows - 1.

Constants


None defined

Type definitions



Graphics window enumeration callback

TGraphicsWindowEnumerate = TConsoleWindowEnumerate;

Graphics window types

PGraphicsWindow = ^TGraphicsWindow;

TGraphicsWindow = TConsoleWindow;

   


Class definitions



Graphics console specific classes

TGraphicImage = class(TObject)


Public variables


None defined

Function declarations



Initialization functions

procedure GraphicsConsoleInit;
Description: Initialize the GraphicsConsole unit
Note Called only during system startup


Graphics console functions

function GraphicsWindowCreate(Console:PConsoleDevice; Position:LongWord):TWindowHandle;
Description: Create a new Graphics window
Console The console device to create the new window on
Position The console position to create the new window at (eg CONSOLE_POSITION_FULL)
Return Handle to new Graphics window or INVALID_HANDLE_VALUE if the window could not be created


function GraphicsWindowCreateEx(Console:PConsoleDevice; Font:TFontHandle; Size,State,Mode,Position:LongWord):TWindowHandle;
Description: Create a new Graphics window
Console The console device to create the new window on
Font The handle of the default font for the new console window
Size The size in bytes to allocate for the new window entry (Defaults to SizeOf(TGraphicsWindow))
State The state of the new console window (WINDOW_STATE_VISIBLE or WINDOW_STATE_INVISIBLE)
Mode The mode of the new console window (Normally WINDOW_MODE_GRAPHICS)
Position The console position to create the new window at (eg CONSOLE_POSITION_FULL)
Return Handle to new Graphics window or INVALID_HANDLE_VALUE if the window could not be created


function GraphicsWindowDestroy(Handle:TWindowHandle):LongWord; inline;
Description: Close and Destroy an existing console window
Handle The handle of the window to destroy
Return ERROR_SUCCESS if completed or another error code on failure


function GraphicsWindowShow(Handle:TWindowHandle):LongWord; inline;
Description: Make an existing console window visible and show it on screen
Handle The handle of the window to show
Return ERROR_SUCCESS if completed or another error code on failure


function GraphicsWindowHide(Handle:TWindowHandle):LongWord; inline;
Description: Make an existing console window invisible and hide it on screen
Handle The handle of the window to hide
Return ERROR_SUCCESS if completed or another error code on failure


function GraphicsWindowActivate(Handle:TWindowHandle):LongWord; inline;
Description: Make an existing console window the active window
Handle The handle of the window to activate
Return ERROR_SUCCESS if completed or another error code on failure


function GraphicsWindowDeactivate(Handle:TWindowHandle):LongWord; inline;
Description: Make an existing console window inactive
Handle The handle of the window to deactivate
Return ERROR_SUCCESS if completed or another error code on failure
Note On success there will be no active window set


function GraphicsWindowNext(Console:PConsoleDevice; Visible:Boolean):TWindowHandle; inline;
Description: Get the next console window starting with the active window
Console The console device to change the active window on
Visible If true only return windows that are visible
Return ERROR_SUCCESS if completed or another error code on failure


function GraphicsWindowPrevious(Console:PConsoleDevice; Visible:Boolean):TWindowHandle; inline;
Description: Get the previous console window starting with the active window
Console The console device to change the active window on
Visible If true only return windows that are visible
Return ERROR_SUCCESS if completed or another error code on failure


function GraphicsWindowAt(Console:PConsoleDevice; X,Y:LongWord; Visible:Boolean):TWindowHandle; inline;
Description: Find the console window that X and Y coordinates are within
Console The console device to find the window on
X The X coordinate to find the window for
Y The Y coordinate to find the window for
Visible If true only return windows that are visible
Return ERROR_SUCCESS if completed or another error code on failure


function GraphicsWindowFind(Console:PConsoleDevice; Position:LongWord):TWindowHandle; inline;
Description: Find an existing console window in the position specified
Console The console device to find the window on
Position The window position to find (eg CONSOLE_POSITION_FULL)
Return The handle of the existing window or INVALID_HANDLE_VALUE if not found


function GraphicsWindowEnumerate(Console:PConsoleDevice; Callback:TGraphicsWindowEnumerate; Data:Pointer):LongWord; inline;
Description: Enumerate existing console windows on the specified console device
Console The console device to enumerate windows for
Callback The function to call for each window enumerated
Data A pointer to private data to be passed to the callback (Optional)
Return ERROR_SUCCESS if completed or another error code on failure


function GraphicsWindowCheckFlag(Handle:TWindowHandle; Flag:LongWord):Boolean; inline;
Description: Check an existing console window to determine if a flag is set or not
Handle The handle of the window to check
Flag The window flag to check for (eg WINDOW_FLAG_LINE_WRAP)
Return True if the flag is set, False if not set.


function GraphicsWindowUpdateFlag(Handle:TWindowHandle; Flag:LongWord; Clear:Boolean):LongWord; inline;
Description: Set or clear a flag on an existing console window
Handle The handle of the window to set or clear the flag on
Flag The window flag to set or clear (eg WINDOW_FLAG_LINE_WRAP)
Clear If true clear the flag, else set it.
Return ERROR_SUCCESS if completed or another error code on failure


function GraphicsWindowGetMode(Handle:TWindowHandle):LongWord; inline;
Description: Get the window mode of an existing console window
Handle The handle of the window to get the mode for
Return The window mode (eg WINDOW_MODE_GRAPHICS)


function GraphicsWindowGetState(Handle:TWindowHandle):LongWord; inline;
Description: Get the window state of an existing console window
Handle The handle of the window to get the state for
Return The window state (eg WINDOW_STATE_INVISIBLE)


function GraphicsWindowGetPosition(Handle:TWindowHandle):LongWord; inline;
Description: Get the position of an existing console window
Handle The handle of the window to get the position for
Return The window position (eg CONSOLE_POSITION_FULL)


function GraphicsWindowSetPosition(Handle:TWindowHandle; Position:LongWord):LongWord;
Description: Set the position of an existing console window
Handle The handle of the window to set the position for
Position The new window position to set
Return ERROR_SUCCESS if completed or another error code on failure
Note The function will return ERROR_INVALID_PARAMETER if another window exists at the position


function GraphicsWindowGetProperties(Handle:TWindowHandle; Properties:PWindowProperties):LongWord; inline;
Description: Get the properties for the specified console window
Handle The handle of the window to get the properties from
Properties Pointer to a TWindowProperties structure to fill in
Return ERROR_SUCCESS if completed or another error code on failure


function GraphicsWindowGetMinX(Handle:TWindowHandle):LongWord;
Description: Get the current minimum X of the window viewport for an existing console window
Handle The handle of the window to get MinX for
Return The minimum X value for the current window viewport
Note For Graphics Console functions, X is based on screen pixels not characters.


function GraphicsWindowGetMinY(Handle:TWindowHandle):LongWord;
Description: Get the current minimum Y of the window viewport for an existing console window
Handle The handle of the window to get MinY for
Return The minimum Y value for the current window viewport
Note For Graphics Console functions, Y is based on screen pixels not characters.


function GraphicsWindowGetMaxX(Handle:TWindowHandle):LongWord;
Description: Get the current maximum X of the window viewport for an existing console window
Handle The handle of the window to get MaxX for
Return The maximum X value for the current window viewport
Note For Graphics Console functions, X is based on screen pixels not characters.


function GraphicsWindowGetMaxY(Handle:TWindowHandle):LongWord;
Description: Get the current maximum Y of the window viewport for an existing console window
Handle The handle of the window to get MaxY for
Return The maximum Y value for the current window viewport
Note For Graphics Console functions, Y is based on screen pixels not characters.


function GraphicsWindowGetRect(Handle:TWindowHandle):TConsoleRect; inline;
Description: Get the rectangle X1,Y1,X2,Y2 of the window viewport for an existing console window
Handle The handle of the window to get the rectangle for
Return The rectangle of the current window viewport
Note For Graphics Console functions, Rect is based on screen pixels not characters.


function GraphicsWindowSetRect(Handle:TWindowHandle; const ARect:TConsoleRect):LongWord; inline;
Description: Set the rectangle X1,Y1,X2,Y2 of the window viewport for an existing console window
Handle The handle of the window to set the rectangle for
Rect The rectangle to set for the window viewport
Return ERROR_SUCCESS if completed or another error code on failure
Note For Graphics Console functions, Rect is based on screen pixels not characters.


function GraphicsWindowResetRect(Handle:TWindowHandle):LongWord; inline;
Description: Reset the window viewport for an existing console window to the maximum size
Handle The handle of the window to reset the viewport for
Return ERROR_SUCCESS if completed or another error code on failure


function GraphicsWindowGetViewport(Handle:TWindowHandle; var X1,Y1,X2,Y2:LongWord):LongWord;
Description: Get the X1,Y1,X2,Y2 of the window viewport for an existing console window
Handle The handle of the window to get the viewport for
X1 The left edge of the current viewport
Y1 The top edge of the current viewport
X2 The right edge of the current viewport
Y2 The bottom edge of the current viewport
Return ERROR_SUCCESS if completed or another error code on failure
Note For Graphics Console functions, Viewport is based on screen pixels not characters.


function GraphicsWindowSetViewport(Handle:TWindowHandle; X1,Y1,X2,Y2:LongWord):LongWord;
Description: Set the X1,Y1,X2,Y2 of the window viewport for an existing console window
Handle The handle of the window to get the viewport for
X1 The left edge of the window viewport
Y1 The top edge of the window viewport
X2 The right edge of the window viewport
Y2 The bottom edge of the window viewport
Return ERROR_SUCCESS if completed or another error code on failure
Note For Graphics Console functions, Viewport is based on screen pixels not characters.


function GraphicsWindowResetViewport(Handle:TWindowHandle):LongWord;
Description: Reset the window viewport for an existing console window to the maximum size
Handle The handle of the window to reset the viewport for
Return ERROR_SUCCESS if completed or another error code on failure


function GraphicsWindowGetCols(Handle:TWindowHandle):LongWord;
Description: Get the current columns of the window viewport for an existing console window
Handle The handle of the window to get columns for
Return The columns value for the current window viewport
Note For Graphics Console functions, Columns is based on screen pixels not characters.


function GraphicsWindowGetRows(Handle:TWindowHandle):LongWord;
Description: Get the current rows of the window viewport for an existing console window
Handle The handle of the window to get rows for
Return The rows value for the current window viewport
Note For Graphics Console functions, Rows is based on screen pixels not characters.


function GraphicsWindowGetWidth(Handle:TWindowHandle):LongWord;
Description: Get the absolute width of an existing console window
Handle The handle of the window to get the width for
Return The absolute width of the window
Note For Graphics Console functions, Width is based on screen pixels not characters.


function GraphicsWindowGetHeight(Handle:TWindowHandle):LongWord;
Description: Get the absolute height of an existing console window
Handle The handle of the window to get the height for
Return The absolute height of the window
Note For Graphics Console functions, Height is based on screen pixels not characters.


function GraphicsWindowGetFormat(Handle:TWindowHandle):LongWord;
Description: Get the color format of an existing console window
Handle The handle of the window to get the format for
Return The color format of the window (eg COLOR_FORMAT_ARGB32)


function GraphicsWindowGetForecolor(Handle:TWindowHandle):LongWord;
Description: Get the current foreground color of an existing console window
Handle The handle of the window to get the foreground color for
Return The foreground color of the window (eg COLOR_WHITE)


function GraphicsWindowSetForecolor(Handle:TWindowHandle; Color:LongWord):LongWord;
Description: Set the current foreground color of an existing console window
Handle The handle of the window to set the foreground color for
Color The foreground color to set (eg COLOR_WHITE)
Return ERROR_SUCCESS if completed or another error code on failure


function GraphicsWindowGetBackcolor(Handle:TWindowHandle):LongWord;
Description: Get the current background color of an existing console window
Handle The handle of the window to get the background color for
Return The background color of the window (eg COLOR_BLACK)


function GraphicsWindowSetBackcolor(Handle:TWindowHandle; Color:LongWord):LongWord;
Description: Set the current background color of an existing console window
Handle The handle of the window to set the background color for
Color The background color to set (eg COLOR_BLACK)
Return ERROR_SUCCESS if completed or another error code on failure


function GraphicsWindowGetFont(Handle:TWindowHandle):TFontHandle;
Description: Get the default font of an existing console window
Handle The handle of the window to get the default font for
Return The font handle of the default font or INVALID_HANDLE_VALUE on error


function GraphicsWindowSetFont(Handle:TWindowHandle; Font:TFontHandle):LongWord;
Description: Set the default font of an existing console window
Handle The handle of the window to set the default font for
Font The font handle of the default font to set
Return ERROR_SUCCESS if completed or another error code on failure


function GraphicsWindowGetCursorXY(Handle:TWindowHandle; var X,Y:LongWord):LongWord; inline;
Description: Get the current cursor X and Y positions of an existing console window
Handle The handle of the window to get cursor X and Y for
X The returned cursor X value
Y The returned cursor Y value
Return ERROR_SUCCESS if completed or another error code on failure
Note For Graphics Console functions, cursor X and Y are based on screen pixels not characters.


function GraphicsWindowSetCursorXY(Handle:TWindowHandle; X,Y:LongWord):LongWord;
Description: Set the current cursor X and Y positions of an existing console window
Handle The handle of the window to set cursor X and Y for
X The new cursor X value
Y The new cursor Y value
Return ERROR_SUCCESS if completed or another error code on failure
Note For Graphics Console functions, cursor X and Y are based on screen pixels not characters.


function GraphicsWindowGetCursorMode(Handle:TWindowHandle):TCursorMode; inline;
Description: Get the current cursor mode of an existing console window
Handle The handle of the window to get the mode for
Return The current cursor mode (eg CURSOR_MODE_INSERT)


function GraphicsWindowSetCursorMode(Handle:TWindowHandle; CursorMode:TCursorMode):LongWord; inline;
Description: Set the current cursor mode of an existing console window
Handle The handle of the window to set the mode for
CursorMode The cursor mode to set (eg CURSOR_MODE_INSERT)
Return ERROR_SUCCESS if completed or another error code on failure}


function GraphicsWindowGetCursorBlink(Handle:TWindowHandle):Boolean; inline;
Description: Get the current cursor blink state of an existing console window
Handle The handle of the window to get blink state for
Return True if blink is enabled, False if not or on error.


function GraphicsWindowSetCursorBlink(Handle:TWindowHandle; CursorBlink:Boolean):LongWord; inline;
Description: Set the current cursor blink state of an existing console window
Handle The handle of the window to set the blink state for
CursorBlink True to enable blink, False to disable
Return ERROR_SUCCESS if completed or another error code on failure


function GraphicsWindowGetCursorState(Handle:TWindowHandle):TCursorState; inline;
Description: Get the current cursor state of an existing console window
Handle The handle of the window to get the state for
Return The current cursor state (eg CURSOR_STATE_ON)


function GraphicsWindowSetCursorState(Handle:TWindowHandle; CursorState:TCursorState):LongWord; inline;
Description: Set the current cursor state of an existing console window
Handle The handle of the window to set the state for
CursorState The cursor state to set (eg CURSOR_STATE_ON)
Return ERROR_SUCCESS if completed or another error code on failure


function GraphicsWindowGetCursorShape(Handle:TWindowHandle):TCursorShape; inline;
Description: Get the current cursor shape of an existing console window
Handle The handle of the window to get the shape for
Return The current cursor shape (eg CURSORLINE)


function GraphicsWindowSetCursorShape(Handle:TWindowHandle; CursorShape:TCursorShape):LongWord; inline;
Description: Set the current cursor shape of an existing console window
Handle The handle of the window to set the shape for
CursorShape The cursor shape to set (eg CURSORLINE)
Return ERROR_SUCCESS if completed or another error code on failure


function GraphicsWindowCursorOn(Handle:TWindowHandle):LongWord; inline;
Description: Enable the cursor on an existing console window
Handle The handle of the window to enable the cursor for
Return ERROR_SUCCESS if completed or another error code on failure


function GraphicsWindowCursorOff(Handle:TWindowHandle):LongWord; inline;
Description: Disable the cursor on an existing console window
Handle The handle of the window to disable the cursor for
Return ERROR_SUCCESS if completed or another error code on failure


function GraphicsWindowCursorLine(Handle:TWindowHandle):LongWord; inline;
Description: Change the cursor to a vertical line on an existing console window
Handle The handle of the window to change the cursor for
Return ERROR_SUCCESS if completed or another error code on failure


function GraphicsWindowCursorBar(Handle:TWindowHandle):LongWord; inline;
Description: Change the cursor to a horizontal bar on an existing console window
Handle The handle of the window to change the cursor for
Return ERROR_SUCCESS if completed or another error code on failure


function GraphicsWindowCursorBlock(Handle:TWindowHandle):LongWord; inline;
Description: Change the cursor to a solid block on an existing console window
Handle The handle of the window to change the cursor for
Return ERROR_SUCCESS if completed or another error code on failure


function GraphicsWindowCursorMove(Handle:TWindowHandle; X,Y:LongWord):LongWord;
Description: Move the cursor on an existing console window
Handle The handle of the window to move the cursor for
X The column to move the cursor to
Y The row to move the cursor to
Return ERROR_SUCCESS if completed or another error code on failure
Note For Graphics Console functions, X and Y are based on screen pixels not characters.


function GraphicsWindowCursorBlink(Handle:TWindowHandle; Enabled:Boolean):LongWord; inline;
Description: Set the blink state of the cursor on an existing console window
Handle The handle of the window to set the blink state for
Enabled True if the cursor is blinking, False if not
Return ERROR_SUCCESS if completed or another error code on failure


function GraphicsWindowClear(Handle:TWindowHandle):LongWord;
Description: Clear the current viewport of an existing console window
Handle The handle of the window to clear
Return ERROR_SUCCESS if completed or another error code on failure


function GraphicsWindowClearEx(Handle:TWindowHandle; X1,Y1,X2,Y2,Color:LongWord):LongWord;
Description: Clear part of the the current viewport of an existing console window
Handle The handle of the window to clear
X1 The left edge of the area to clear (relative to current viewport)
Y1 The top edge of the area to clear (relative to current viewport)
X2 The right edge of the area to clear (relative to current viewport)
Y2 The bottom edge of the area to clear (relative to current viewport)
Color The fill color for the area to clear (eg COLOR_WHITE)
Return ERROR_SUCCESS if completed or another error code on failure
Note For Graphics Console functions, Viewport is based on screen pixels not characters.


function GraphicsWindowDrawBox(Handle:TWindowHandle; X1,Y1,X2,Y2,Color,Width:LongWord):LongWord;
Description: Draw a rectangular box outline on an existing console window
Handle The handle of the window to draw on
X1 The left edge of the box (relative to current viewport)
Y1 The top edge of the box (relative to current viewport)
X2 The right edge of the box (relative to current viewport)
Y2 The bottom edge of the box (relative to current viewport)
Color The color to draw with (eg COLOR_WHITE)
Width The width of the box outline
Return ERROR_SUCCESS if completed or another error code on failure
Note For Graphics Console functions, Viewport is based on screen pixels not characters.


function GraphicsWindowDrawLine(Handle:TWindowHandle; X1,Y1,X2,Y2,Color,Width:LongWord):LongWord;
Description: Draw a line on an existing console window
Handle The handle of the window to draw on
X1 The left starting point of the line (relative to current viewport)
Y1 The top starting point of the line (relative to current viewport)
X2 The right ending point of the line (relative to current viewport)
Y2 The bottom ending point of the line (relative to current viewport)
Color The color to draw with (eg COLOR_WHITE)
Width The width of the line
Return ERROR_SUCCESS if completed or another error code on failure
Note For Graphics Console functions, Viewport is based on screen pixels not characters.


function GraphicsWindowDrawBlock(Handle:TWindowHandle; X1,Y1,X2,Y2,Color:LongWord):LongWord;
Description: Draw a rectangular filled block on an existing console window
Handle The handle of the window to draw on
X1 The left edge of the block (relative to current viewport)
Y1 The top edge of the block (relative to current viewport)
X2 The right edge of the block (relative to current viewport)
Y2 The bottom edge of the block (relative to current viewport)
Color The color to draw with (eg COLOR_WHITE)
Return ERROR_SUCCESS if completed or another error code on failure
Note For Graphics Console functions, Viewport is based on screen pixels not characters.


function GraphicsWindowDrawCircle(Handle:TWindowHandle; X,Y,Color,Width,Radius:LongWord):LongWord;
Description: Draw a circle on an existing console window
Handle The handle of the window to draw on
X The left starting point of the circle (relative to current viewport)
Y The top starting point of the circle (relative to current viewport)
Color The color to draw with (eg COLOR_WHITE)
Width The width of the circle outline
Radius The radius of the circle
Return ERROR_SUCCESS if completed or another error code on failure
Note For Graphics Console functions, Viewport is based on screen pixels not characters.


function GraphicsWindowDrawChar(Handle:TWindowHandle; Ch:Char; X,Y:LongWord):LongWord;
Description: Draw a character on an existing console window
Handle The handle of the window to draw on
Ch The character to draw
X The left starting point of the character (relative to current viewport)
Y The top starting point of the character (relative to current viewport)
Return ERROR_SUCCESS if completed or another error code on failure
Note For Graphics Console functions, Viewport is based on screen pixels not characters.


function GraphicsWindowDrawCharEx(Handle:TWindowHandle; Font:TFontHandle; Ch:Char; X,Y,Forecolor,Backcolor:LongWord):LongWord;
Description: Draw a character on an existing console window
Handle The handle of the window to draw on
Font The handle of the font to draw the character with
Ch The character to draw
X The left starting point of the character (relative to current viewport)
Y The top starting point of the character (relative to current viewport)
Forecolor The foreground color for the character (eg COLOR_WHITE)
Backcolor The background color for the character (eg COLOR_BLACK)
Return ERROR_SUCCESS if completed or another error code on failure
Note For Graphics Console functions, Viewport is based on screen pixels not characters.


function GraphicsWindowDrawText(Handle:TWindowHandle; const Text:String; X,Y:LongWord):LongWord;
Description: Draw a text string on an existing console window
Handle The handle of the window to draw on
Text The text to draw
X The left starting point of the text (relative to current viewport)
Y The top starting point of the text (relative to current viewport)
Return ERROR_SUCCESS if completed or another error code on failure
Note For Graphics Console functions, Viewport is based on screen pixels not characters.


function GraphicsWindowDrawTextEx(Handle:TWindowHandle; Font:TFontHandle; const Text:String; X,Y,Forecolor,Backcolor:LongWord):LongWord;
Description: Draw a text string on an existing console window
Handle The handle of the window to draw on
Font The handle of the font to draw the text with
Text The text to draw
X The left starting point of the text (relative to current viewport)
Y The top starting point of the text (relative to current viewport)
Forecolor The foreground color for the text (eg COLOR_WHITE)
Backcolor The background color for the text (eg COLOR_BLACK)
Return ERROR_SUCCESS if completed or another error code on failure
Note For Graphics Console functions, Viewport is based on screen pixels not characters.


function GraphicsWindowDrawPixel(Handle:TWindowHandle; X,Y,Color:LongWord):LongWord;
Description: Draw a single pixel on an existing console window
Handle The handle of the window to draw on
X The column for the pixel (relative to current viewport)
Y The row for the pixel (relative to current viewport)
Color The color for the pixel (eg COLOR_WHITE)
Return ERROR_SUCCESS if completed or another error code on failure
Note For Graphics Console functions, Viewport is based on screen pixels not characters.


function GraphicsWindowDrawImage(Handle:TWindowHandle; X,Y:LongWord; Image:Pointer; Width,Height,Format:LongWord):LongWord;
Description: Draw an image on an existing console window
Handle The handle of the window to draw on
X The left starting point of the image (relative to current viewport)
Y The top starting point of the image (relative to current viewport)
Image Pointer to the image data in a contiguous block of pixel rows
Width The width in pixels of a row in the image data
Height The height in pixels of all rows in the image data
Format The color format of the image data (eg COLOR_FORMAT_ARGB32) Pass COLOR_FORMAT_UNKNOWN to use the window format
Return ERROR_SUCCESS if completed or another error code on failure
Note For Graphics Console functions, Viewport is based on screen pixels not characters.


function GraphicsWindowGetPixel(Handle:TWindowHandle; X,Y:LongWord):LongWord;
Description: Get a single pixel from an existing console window
Handle The handle of the window to get from
X The column of the pixel (relative to current viewport)
Y The row of the pixel (relative to current viewport)
Return The color of the pixel at X,Y (eg COLOR_WHITE)
Note For Graphics Console functions, Viewport is based on screen pixels not characters.


function GraphicsWindowGetImage(Handle:TWindowHandle; X,Y:LongWord; Image:Pointer; Width,Height,Format:LongWord):LongWord;
Description: Get an image from an existing console window
Handle The handle of the window to get from
X The left starting point of the image (relative to current viewport)
Y The top starting point of the image (relative to current viewport)
Image Pointer to a block of memory large enough to hold the image in a contiguous block of pixel rows
Width The width in pixels of a row of the image
Height The height in pixels of all rows of the image
Format The color format to store in the image data (eg COLOR_FORMAT_ARGB32) Pass COLOR_FORMAT_UNKNOWN to use the window format
Return ERROR_SUCCESS if completed or another error code on failure
Note For Graphics Console functions, Viewport is based on screen pixels not characters.


function GraphicsWindowCopyImage(Handle:TWindowHandle; const Source,Dest:TConsolePoint; Width,Height:LongWord):LongWord; inline;
Description: Copy an image from one place to another in an existing console window
Handle The handle of the window to copy from and to
Source The starting point (X,Y) to copy the image from
Dest The starting point (X,Y) to copy the image to
Width The width in pixels of each row of the image
Height The height in pixels of all rows of the image
Return ERROR_SUCCESS if completed or another error code on failure
Note For Graphics Console functions, Viewport is based on screen pixels not characters.


function GraphicsWindowMoveImage(Handle:TWindowHandle; const Source,Dest:TConsolePoint; Width,Height,Fillcolor:LongWord):LongWord;
Description: Move an image from one place to another in an existing console window
Handle The handle of the window to copy from and to
Source The starting point (X,Y) to copy the image from
Dest The starting point (X,Y) to copy the image to
Width The width in pixels of each row of the image
Height The height in pixels of all rows of the image
Fillcolor The color to fill the area where the image was moved from (COLOR_NONE for no fill, same as copy)
Return ERROR_SUCCESS if completed or another error code on failure
Note For Graphics Console functions, Viewport is based on screen pixels not characters.


function GraphicsWindowImageSize(Handle:TWindowHandle; Width,Height,Format,Stride:LongWord):LongWord;
Description: Calculate the size in bytes of an image that is Width by Height in the color format specified
Handle The handle of the window for the image
Width The width of the image in pixels
Height The height of the image in pixels
Format The color format to use for the calculation (eg COLOR_FORMAT_ARGB32) Pass COLOR_FORMAT_UNKNOWN to use the window format
Stride The distance in bytes between each row of pixels (Optional)
Return The size in bytes for an image of the specified size and format or 0 on error


function GraphicsWindowImageFromStream(Handle:TWindowHandle; X,Y:LongWord; Stream:TStream; Width,Height,Format,Stride:LongWord; Invert:Boolean):LongWord;
Description: Draw an image to an existing console window from a supplied stream
Handle The handle of the window to draw on
X The left starting point of the image (relative to current viewport)
Y The top starting point of the image (relative to current viewport)
Stream A stream containing the image data in a contiguous block of pixel rows
Width The width in pixels of a row in the image data
Height The height in pixels of all rows in the image data
Format The color format of the image data (eg COLOR_FORMAT_ARGB32) Pass COLOR_FORMAT_UNKNOWN to use the window format
Stride The distance in bytes between each row of pixels (Optional)
Invert If True invert the image so the first row is the bottom and the last row is the top
Return ERROR_SUCCESS if completed or another error code on failure
Note For Graphics Console functions, Viewport is based on screen pixels not characters.


function GraphicsWindowImageToStream(Handle:TWindowHandle; X,Y:LongWord; Stream:TStream; Width,Height,Format,Stride:LongWord; Invert:Boolean):LongWord;
Description: Get an image from an existing console window to a supplied stream
Handle The handle of the window to get from
X The left starting point of the image (relative to current viewport)
Y The top starting point of the image (relative to current viewport)
Stream A stream large enough to hold the image in a contiguous block of pixel rows
Width The width in pixels of a row of the image
Height The height in pixels of all rows of the image
Format The color format to store in the image data (eg COLOR_FORMAT_ARGB32) Pass COLOR_FORMAT_UNKNOWN to use the window format
Stride The distance in bytes between each row of pixels (Optional)
Invert If True invert the image so the first row is the bottom and the last row is the top
Return ERROR_SUCCESS if completed or another error code on failure
Note For Graphics Console functions, Viewport is based on screen pixels not characters.


Graphics console helper functions

function GraphicsWindowGetCount(Console:PConsoleDevice):LongWord; inline;
Description: Get the current console window count
Console The console device to get the window count for
Return The current number of console windows on the specified console device


function GraphicsWindowGetActive(Console:PConsoleDevice):TWindowHandle; inline;
Description: Get the current console active window
Console The console device to get the active window for
Return The window handle of the current active window or INVALID_HANDLE_VALUE on failure


function GraphicsWindowCheck(Console:PConsoleDevice; Window:PGraphicsWindow):PGraphicsWindow; inline;
Description: Check if a console window entry is valid
Console The console device to search for the window
Window The window entry to check for validity
Return The supplied window if successful or nil on failure


Return to Unit Reference