Ultibo API
C/C++ API for Ultibo Core
Loading...
Searching...
No Matches
graphicsconsole.h File Reference

Go to the source code of this file.

Typedefs

typedef console_window_enumerate_cb graphics_window_enumerate_cb
typedef CONSOLE_WINDOW GRAPHICS_WINDOW

Functions

WINDOW_HANDLE STDCALL graphics_window_create (CONSOLE_DEVICE *console, uint32_t position)
 Create a new Graphics window.
WINDOW_HANDLE STDCALL graphics_window_create_ex (CONSOLE_DEVICE *console, FONT_HANDLE font, uint32_t size, uint32_t state, uint32_t mode, uint32_t position)
 Create a new Graphics window.
uint32_t STDCALL graphics_window_destroy (WINDOW_HANDLE handle)
 Close and Destroy an existing console window.
uint32_t STDCALL graphics_window_show (WINDOW_HANDLE handle)
 Make an existing console window visible and show it on screen.
uint32_t STDCALL graphics_window_hide (WINDOW_HANDLE handle)
 Make an existing console window invisible and hide it on screen.
uint32_t STDCALL graphics_window_activate (WINDOW_HANDLE handle)
 Make an existing console window the active window.
uint32_t STDCALL graphics_window_deactivate (WINDOW_HANDLE handle)
 Make an existing console window inactive.
WINDOW_HANDLE STDCALL graphics_window_next (CONSOLE_DEVICE *console, BOOL visible)
 Get the next console window starting with the active window.
WINDOW_HANDLE STDCALL graphics_window_previous (CONSOLE_DEVICE *console, BOOL visible)
 Get the previous console window starting with the active window.
WINDOW_HANDLE STDCALL graphics_window_at (CONSOLE_DEVICE *console, uint32_t x, uint32_t y, BOOL visible)
 Find the console window that X and Y coordinates are within.
WINDOW_HANDLE STDCALL graphics_window_find (CONSOLE_DEVICE *console, uint32_t position)
 Find an existing console window in the position specified.
uint32_t STDCALL graphics_window_enumerate (CONSOLE_DEVICE *console, graphics_window_enumerate_cb callback, void *data)
 Enumerate existing console windows on the specified console device.
BOOL STDCALL graphics_window_check_flag (WINDOW_HANDLE handle, uint32_t flag)
 Check an existing console window to determine if a flag is set or not.
uint32_t STDCALL graphics_window_update_flag (WINDOW_HANDLE handle, uint32_t flag, BOOL clear)
 Set or clear a flag on an existing console window.
uint32_t STDCALL graphics_window_get_mode (WINDOW_HANDLE handle)
 Get the window mode of an existing console window.
uint32_t STDCALL graphics_window_get_state (WINDOW_HANDLE handle)
 Get the window state of an existing console window.
uint32_t STDCALL graphics_window_get_position (WINDOW_HANDLE handle)
 Get the position of an existing console window.
uint32_t STDCALL graphics_window_set_position (WINDOW_HANDLE handle, uint32_t position)
 Set the position of an existing console window.
uint32_t STDCALL graphics_window_get_properties (WINDOW_HANDLE handle, WINDOW_PROPERTIES *properties)
 Get the properties for the specified console window.
uint32_t STDCALL graphics_window_get_min_x (WINDOW_HANDLE handle)
 Get the current minimum X of the window viewport for an existing console window.
uint32_t STDCALL graphics_window_get_min_y (WINDOW_HANDLE handle)
 Get the current minimum Y of the window viewport for an existing console window.
uint32_t STDCALL graphics_window_get_max_x (WINDOW_HANDLE handle)
 Get the current maximum X of the window viewport for an existing console window.
uint32_t STDCALL graphics_window_get_max_y (WINDOW_HANDLE handle)
 Get the current maximum Y of the window viewport for an existing console window.
CONSOLE_RECT STDCALL graphics_window_get_rect (WINDOW_HANDLE handle)
 Get the rectangle X1,Y1,X2,Y2 of the window viewport for an existing console window.
uint32_t STDCALL graphics_window_set_rect (WINDOW_HANDLE handle, CONSOLE_RECT *rect)
 Set the rectangle X1,Y1,X2,Y2 of the window viewport for an existing console window.
uint32_t STDCALL graphics_window_reset_rect (WINDOW_HANDLE handle)
 Reset the window viewport for an existing console window to the maximum size.
uint32_t STDCALL graphics_window_get_viewport (WINDOW_HANDLE handle, uint32_t *x1, uint32_t *y1, uint32_t *x2, uint32_t *y2)
 Get the X1,Y1,X2,Y2 of the window viewport for an existing console window.
uint32_t STDCALL graphics_window_set_viewport (WINDOW_HANDLE handle, uint32_t x1, uint32_t y1, uint32_t x2, uint32_t y2)
 Set the X1,Y1,X2,Y2 of the window viewport for an existing console window.
uint32_t STDCALL graphics_window_reset_viewport (WINDOW_HANDLE handle)
 Reset the window viewport for an existing console window to the maximum size.
uint32_t STDCALL graphics_window_get_cols (WINDOW_HANDLE handle)
 Get the current columns of the window viewport for an existing console window.
uint32_t STDCALL graphics_window_get_rows (WINDOW_HANDLE handle)
 Get the current rows of the window viewport for an existing console window.
uint32_t STDCALL graphics_window_get_width (WINDOW_HANDLE handle)
 Get the absolute width of an existing console window.
uint32_t STDCALL graphics_window_get_height (WINDOW_HANDLE handle)
 Get the absolute height of an existing console window.
uint32_t STDCALL graphics_window_get_format (WINDOW_HANDLE handle)
 Get the color format of an existing console window.
uint32_t STDCALL graphics_window_get_forecolor (WINDOW_HANDLE handle)
 Get the current foreground color of an existing console window.
uint32_t STDCALL graphics_window_set_forecolor (WINDOW_HANDLE handle, uint32_t color)
 Set the current foreground color of an existing console window.
uint32_t STDCALL graphics_window_get_backcolor (WINDOW_HANDLE handle)
 Get the current background color of an existing console window.
uint32_t STDCALL graphics_window_set_backcolor (WINDOW_HANDLE handle, uint32_t color)
 Set the current background color of an existing console window.
FONT_HANDLE STDCALL graphics_window_get_font (WINDOW_HANDLE handle)
 Get the default font of an existing console window.
uint32_t STDCALL graphics_window_set_font (WINDOW_HANDLE handle, FONT_HANDLE font)
 Set the default font of an existing console window.
uint32_t STDCALL graphics_window_get_cursor_xy (WINDOW_HANDLE handle, uint32_t *x, uint32_t *y)
 Get the current cursor X and Y positions of an existing console window.
uint32_t STDCALL graphics_window_set_cursor_xy (WINDOW_HANDLE handle, uint32_t x, uint32_t y)
 Set the current cursor X and Y positions of an existing console window.
CURSOR_MODE STDCALL graphics_window_get_cursor_mode (WINDOW_HANDLE handle)
 Get the current cursor mode of an existing console window.
uint32_t STDCALL graphics_window_set_cursor_mode (WINDOW_HANDLE handle, CURSOR_MODE cursormode)
 Set the current cursor mode of an existing console window.
BOOL STDCALL graphics_window_get_cursor_blink (WINDOW_HANDLE handle)
 Get the current cursor blink state of an existing console window.
uint32_t STDCALL graphics_window_set_cursor_blink (WINDOW_HANDLE handle, BOOL cursorblink)
 Set the current cursor blink state of an existing console window.
CURSOR_STATE STDCALL graphics_window_get_cursor_state (WINDOW_HANDLE handle)
 Get the current cursor state of an existing console window.
uint32_t STDCALL graphics_window_set_cursor_state (WINDOW_HANDLE handle, CURSOR_STATE cursorstate)
 Set the current cursor state of an existing console window.
CURSOR_SHAPE STDCALL graphics_window_get_cursor_shape (WINDOW_HANDLE handle)
 Get the current cursor shape of an existing console window.
uint32_t STDCALL graphics_window_set_cursor_shape (WINDOW_HANDLE handle, CURSOR_SHAPE cursorshape)
 Set the current cursor shape of an existing console window.
uint32_t STDCALL graphics_window_cursor_on (WINDOW_HANDLE handle)
 Enable the cursor on an existing console window.
uint32_t STDCALL graphics_window_cursor_off (WINDOW_HANDLE handle)
 Disable the cursor on an existing console window.
uint32_t STDCALL graphics_window_cursor_line (WINDOW_HANDLE handle)
 Change the cursor to a vertical line on an existing console window.
uint32_t STDCALL graphics_window_cursor_bar (WINDOW_HANDLE handle)
 Change the cursor to a horizontal bar on an existing console window.
uint32_t STDCALL graphics_window_cursor_block (WINDOW_HANDLE handle)
 Change the cursor to a solid block on an existing console window.
uint32_t STDCALL graphics_window_cursor_move (WINDOW_HANDLE handle, uint32_t x, uint32_t y)
 Move the cursor on an existing console window.
uint32_t STDCALL graphics_window_cursor_blink (WINDOW_HANDLE handle, BOOL enabled)
 Set the blink state of the cursor on an existing console window.
uint32_t STDCALL graphics_window_clear (WINDOW_HANDLE handle)
 Clear the current viewport of an existing console window.
uint32_t STDCALL graphics_window_clear_ex (WINDOW_HANDLE handle, uint32_t x1, uint32_t y1, uint32_t x2, uint32_t y2, uint32_t color)
 Clear part of the the current viewport of an existing console window.
uint32_t STDCALL graphics_window_draw_box (WINDOW_HANDLE handle, uint32_t x1, uint32_t y1, uint32_t x2, uint32_t y2, uint32_t color, uint32_t width)
 Draw a rectangular box outline on an existing console window.
uint32_t STDCALL graphics_window_draw_line (WINDOW_HANDLE handle, uint32_t x1, uint32_t y1, uint32_t x2, uint32_t y2, uint32_t color, uint32_t width)
 Draw a line on an existing console window.
uint32_t STDCALL graphics_window_draw_block (WINDOW_HANDLE handle, uint32_t x1, uint32_t y1, uint32_t x2, uint32_t y2, uint32_t color)
 Draw a rectangular filled block on an existing console window.
uint32_t STDCALL graphics_window_draw_circle (WINDOW_HANDLE handle, uint32_t x, uint32_t y, uint32_t color, uint32_t width, uint32_t radius)
 Draw a circle on an existing console window.
uint32_t STDCALL graphics_window_draw_char (WINDOW_HANDLE handle, char ch, uint32_t x, uint32_t y)
 Draw a character on an existing console window.
uint32_t STDCALL graphics_window_draw_char_ex (WINDOW_HANDLE handle, FONT_HANDLE font, char ch, uint32_t x, uint32_t y, uint32_t forecolor, uint32_t backcolor)
 Draw a character on an existing console window.
uint32_t STDCALL graphics_window_draw_text (WINDOW_HANDLE handle, const char *text, uint32_t x, uint32_t y)
 Draw a text string on an existing console window.
uint32_t STDCALL graphics_window_draw_text_ex (WINDOW_HANDLE handle, FONT_HANDLE font, const char *text, uint32_t x, uint32_t y, uint32_t forecolor, uint32_t backcolor)
 Draw a text string on an existing console window.
uint32_t STDCALL graphics_window_draw_pixel (WINDOW_HANDLE handle, uint32_t x, uint32_t y, uint32_t color)
 Draw a single pixel on an existing console window.
uint32_t STDCALL graphics_window_draw_image (WINDOW_HANDLE handle, uint32_t x, uint32_t y, void *image, uint32_t width, uint32_t height, uint32_t format)
 Draw an image on an existing console window.
uint32_t STDCALL graphics_window_get_pixel (WINDOW_HANDLE handle, uint32_t x, uint32_t y)
 Get a single pixel from an existing console window.
uint32_t STDCALL graphics_window_get_image (WINDOW_HANDLE handle, uint32_t x, uint32_t y, void *image, uint32_t width, uint32_t height, uint32_t format)
 Get an image from an existing console window.
uint32_t STDCALL graphics_window_copy_image (WINDOW_HANDLE handle, CONSOLE_POINT *source, CONSOLE_POINT *dest, uint32_t width, uint32_t height)
 Copy an image from one place to another in an existing console window.
uint32_t STDCALL graphics_window_move_image (WINDOW_HANDLE handle, CONSOLE_POINT *source, CONSOLE_POINT *dest, uint32_t width, uint32_t height, uint32_t fillcolor)
 Move an image from one place to another in an existing console window.
uint32_t STDCALL graphics_window_image_size (WINDOW_HANDLE handle, uint32_t width, uint32_t height, uint32_t format, uint32_t stride)
 Calculate the size in bytes of an image that is Width by Height in the color format specified.
uint32_t STDCALL graphics_window_get_count (CONSOLE_DEVICE *console)
 Get the current console window count.
WINDOW_HANDLE STDCALL graphics_window_get_active (CONSOLE_DEVICE *console)
 Get the current console active window.
GRAPHICS_WINDOW *STDCALL graphics_window_check (CONSOLE_DEVICE *console, GRAPHICS_WINDOW *window)
 Check if a console window entry is valid.

Typedef Documentation

◆ graphics_window_enumerate_cb

Graphics Console specific constants Graphics Console specific types Graphics Window Enumeration Callback

◆ GRAPHICS_WINDOW

Graphics Window

Function Documentation

◆ graphics_window_create()

WINDOW_HANDLE STDCALL graphics_window_create ( CONSOLE_DEVICE * console,
uint32_t position )

Create a new Graphics window.

Graphics Console Functions

Parameters
ConsoleThe console device to create the new window on
PositionThe console position to create the new window at (eg CONSOLE_POSITION_FULL)
Returns
Handle to new Graphics window or INVALID_HANDLE_VALUE if the window could not be created

◆ graphics_window_create_ex()

WINDOW_HANDLE STDCALL graphics_window_create_ex ( CONSOLE_DEVICE * console,
FONT_HANDLE font,
uint32_t size,
uint32_t state,
uint32_t mode,
uint32_t position )

Create a new Graphics window.

Parameters
ConsoleThe console device to create the new window on
FontThe handle of the default font for the new console window
SizeThe size in bytes to allocate for the new window entry (Defaults to SizeOf(TGraphicsWindow))
StateThe state of the new console window (WINDOW_STATE_VISIBLE or WINDOW_STATE_INVISIBLE)
ModeThe mode of the new console window (Normally WINDOW_MODE_GRAPHICS)
PositionThe console position to create the new window at (eg CONSOLE_POSITION_FULL)
Returns
Handle to new Graphics window or INVALID_HANDLE_VALUE if the window could not be created

◆ graphics_window_destroy()

uint32_t STDCALL graphics_window_destroy ( WINDOW_HANDLE handle)

Close and Destroy an existing console window.

Parameters
HandleThe handle of the window to destroy
Returns
ERROR_SUCCESS if completed or another error code on failure

◆ graphics_window_show()

uint32_t STDCALL graphics_window_show ( WINDOW_HANDLE handle)

Make an existing console window visible and show it on screen.

Parameters
HandleThe handle of the window to show
Returns
ERROR_SUCCESS if completed or another error code on failure

◆ graphics_window_hide()

uint32_t STDCALL graphics_window_hide ( WINDOW_HANDLE handle)

Make an existing console window invisible and hide it on screen.

Parameters
HandleThe handle of the window to hide
Returns
ERROR_SUCCESS if completed or another error code on failure

◆ graphics_window_activate()

uint32_t STDCALL graphics_window_activate ( WINDOW_HANDLE handle)

Make an existing console window the active window.

Parameters
HandleThe handle of the window to activate
Returns
ERROR_SUCCESS if completed or another error code on failure

◆ graphics_window_deactivate()

uint32_t STDCALL graphics_window_deactivate ( WINDOW_HANDLE handle)

Make an existing console window inactive.

Parameters
HandleThe handle of the window to deactivate
Returns
ERROR_SUCCESS if completed or another error code on failure
Note
On success there will be no active window set

◆ graphics_window_next()

WINDOW_HANDLE STDCALL graphics_window_next ( CONSOLE_DEVICE * console,
BOOL visible )

Get the next console window starting with the active window.

Parameters
ConsoleThe console device to change the active window on
VisibleIf true only return windows that are visible
Returns
ERROR_SUCCESS if completed or another error code on failure

◆ graphics_window_previous()

WINDOW_HANDLE STDCALL graphics_window_previous ( CONSOLE_DEVICE * console,
BOOL visible )

Get the previous console window starting with the active window.

Parameters
ConsoleThe console device to change the active window on
VisibleIf true only return windows that are visible
Returns
ERROR_SUCCESS if completed or another error code on failure

◆ graphics_window_at()

WINDOW_HANDLE STDCALL graphics_window_at ( CONSOLE_DEVICE * console,
uint32_t x,
uint32_t y,
BOOL visible )

Find the console window that X and Y coordinates are within.

Parameters
ConsoleThe console device to find the window on
XThe X coordinate to find the window for
YThe Y coordinate to find the window for
VisibleIf true only return windows that are visible
Returns
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

◆ graphics_window_find()

WINDOW_HANDLE STDCALL graphics_window_find ( CONSOLE_DEVICE * console,
uint32_t position )

Find an existing console window in the position specified.

Parameters
ConsoleThe console device to find the window on
PositionThe window position to find (eg CONSOLE_POSITION_FULL)
Returns
The handle of the existing window or INVALID_HANDLE_VALUE if not found

◆ graphics_window_enumerate()

uint32_t STDCALL graphics_window_enumerate ( CONSOLE_DEVICE * console,
graphics_window_enumerate_cb callback,
void * data )

Enumerate existing console windows on the specified console device.

Parameters
ConsoleThe console device to enumerate windows for
CallbackThe function to call for each window enumerated
DataA pointer to private data to be passed to the callback (Optional)
Returns
ERROR_SUCCESS if completed or another error code on failure

◆ graphics_window_check_flag()

BOOL STDCALL graphics_window_check_flag ( WINDOW_HANDLE handle,
uint32_t flag )

Check an existing console window to determine if a flag is set or not.

Parameters
HandleThe handle of the window to check
FlagThe window flag to check for (eg WINDOW_FLAG_LINE_WRAP)
Returns
True if the flag is set, False if not set

◆ graphics_window_update_flag()

uint32_t STDCALL graphics_window_update_flag ( WINDOW_HANDLE handle,
uint32_t flag,
BOOL clear )

Set or clear a flag on an existing console window.

Parameters
HandleThe handle of the window to set or clear the flag on
FlagThe window flag to set or clear (eg WINDOW_FLAG_LINE_WRAP)
ClearIf true clear the flag, else set it
Returns
ERROR_SUCCESS if completed or another error code on failure

◆ graphics_window_get_mode()

uint32_t STDCALL graphics_window_get_mode ( WINDOW_HANDLE handle)

Get the window mode of an existing console window.

Parameters
HandleThe handle of the window to get the mode for
Returns
The window mode (eg WINDOW_MODE_GRAPHICS)

◆ graphics_window_get_state()

uint32_t STDCALL graphics_window_get_state ( WINDOW_HANDLE handle)

Get the window state of an existing console window.

Parameters
HandleThe handle of the window to get the state for
Returns
The window state (eg WINDOW_STATE_INVISIBLE)

◆ graphics_window_get_position()

uint32_t STDCALL graphics_window_get_position ( WINDOW_HANDLE handle)

Get the position of an existing console window.

Parameters
HandleThe handle of the window to get the position for
Returns
The window position (eg CONSOLE_POSITION_FULL)

◆ graphics_window_set_position()

uint32_t STDCALL graphics_window_set_position ( WINDOW_HANDLE handle,
uint32_t position )

Set the position of an existing console window.

Parameters
HandleThe handle of the window to set the position for
PositionThe new window position to set
Returns
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

◆ graphics_window_get_properties()

uint32_t STDCALL graphics_window_get_properties ( WINDOW_HANDLE handle,
WINDOW_PROPERTIES * properties )

Get the properties for the specified console window.

Parameters
HandleThe handle of the window to get the properties from
PropertiesPointer to a TWindowProperties structure to fill in
Returns
ERROR_SUCCESS if completed or another error code on failure

◆ graphics_window_get_min_x()

uint32_t STDCALL graphics_window_get_min_x ( WINDOW_HANDLE handle)

Get the current minimum X of the window viewport for an existing console window.

Parameters
HandleThe handle of the window to get MinX for
Returns
The minimum X value for the current window viewport
Note
For Graphics Console functions, X is based on screen pixels not characters

◆ graphics_window_get_min_y()

uint32_t STDCALL graphics_window_get_min_y ( WINDOW_HANDLE handle)

Get the current minimum Y of the window viewport for an existing console window.

Parameters
HandleThe handle of the window to get MinY for
Returns
The minimum Y value for the current window viewport
Note
For Graphics Console functions, Y is based on screen pixels not characters

◆ graphics_window_get_max_x()

uint32_t STDCALL graphics_window_get_max_x ( WINDOW_HANDLE handle)

Get the current maximum X of the window viewport for an existing console window.

Parameters
HandleThe handle of the window to get MaxX for
Returns
The maximum X value for the current window viewport
Note
For Graphics Console functions, X is based on screen pixels not characters

◆ graphics_window_get_max_y()

uint32_t STDCALL graphics_window_get_max_y ( WINDOW_HANDLE handle)

Get the current maximum Y of the window viewport for an existing console window.

Parameters
HandleThe handle of the window to get MaxY for
Returns
The maximum Y value for the current window viewport
Note
For Graphics Console functions, Y is based on screen pixels not characters

◆ graphics_window_get_rect()

CONSOLE_RECT STDCALL graphics_window_get_rect ( WINDOW_HANDLE handle)

Get the rectangle X1,Y1,X2,Y2 of the window viewport for an existing console window.

Parameters
HandleThe handle of the window to get the rectangle for
Returns
The rectangle of the current window viewport
Note
For Graphics Console functions, Rect is based on screen pixels not characters

◆ graphics_window_set_rect()

uint32_t STDCALL graphics_window_set_rect ( WINDOW_HANDLE handle,
CONSOLE_RECT * rect )

Set the rectangle X1,Y1,X2,Y2 of the window viewport for an existing console window.

Parameters
HandleThe handle of the window to set the rectangle for
RectThe rectangle to set for the window viewport
Returns
ERROR_SUCCESS if completed or another error code on failure
Note
For Graphics Console functions, Rect is based on screen pixels not characters

◆ graphics_window_reset_rect()

uint32_t STDCALL graphics_window_reset_rect ( WINDOW_HANDLE handle)

Reset the window viewport for an existing console window to the maximum size.

Parameters
HandleThe handle of the window to reset the viewport for
Returns
ERROR_SUCCESS if completed or another error code on failure

◆ graphics_window_get_viewport()

uint32_t STDCALL graphics_window_get_viewport ( WINDOW_HANDLE handle,
uint32_t * x1,
uint32_t * y1,
uint32_t * x2,
uint32_t * y2 )

Get the X1,Y1,X2,Y2 of the window viewport for an existing console window.

Parameters
HandleThe handle of the window to get the viewport for
X1The left edge of the current viewport
Y1The top edge of the current viewport
X2The right edge of the current viewport
Y2The bottom edge of the current viewport
Returns
ERROR_SUCCESS if completed or another error code on failure
Note
For Graphics Console functions, Viewport is based on screen pixels not characters

◆ graphics_window_set_viewport()

uint32_t STDCALL graphics_window_set_viewport ( WINDOW_HANDLE handle,
uint32_t x1,
uint32_t y1,
uint32_t x2,
uint32_t y2 )

Set the X1,Y1,X2,Y2 of the window viewport for an existing console window.

Parameters
HandleThe handle of the window to get the viewport for
X1The left edge of the window viewport
Y1The top edge of the window viewport
X2The right edge of the window viewport
Y2The bottom edge of the window viewport
Returns
ERROR_SUCCESS if completed or another error code on failure
Note
For Graphics Console functions, Viewport is based on screen pixels not characters

◆ graphics_window_reset_viewport()

uint32_t STDCALL graphics_window_reset_viewport ( WINDOW_HANDLE handle)

Reset the window viewport for an existing console window to the maximum size.

Parameters
HandleThe handle of the window to reset the viewport for
Returns
ERROR_SUCCESS if completed or another error code on failure

◆ graphics_window_get_cols()

uint32_t STDCALL graphics_window_get_cols ( WINDOW_HANDLE handle)

Get the current columns of the window viewport for an existing console window.

Parameters
HandleThe handle of the window to get columns for
Returns
The columns value for the current window viewport
Note
For Graphics Console functions, Columns is based on screen pixels not characters

◆ graphics_window_get_rows()

uint32_t STDCALL graphics_window_get_rows ( WINDOW_HANDLE handle)

Get the current rows of the window viewport for an existing console window.

Parameters
HandleThe handle of the window to get rows for
Returns
The rows value for the current window viewport
Note
For Graphics Console functions, Rows is based on screen pixels not characters

◆ graphics_window_get_width()

uint32_t STDCALL graphics_window_get_width ( WINDOW_HANDLE handle)

Get the absolute width of an existing console window.

Parameters
HandleThe handle of the window to get the width for
Returns
The absolute width of the window
Note
For Graphics Console functions, Width is based on screen pixels not characters

◆ graphics_window_get_height()

uint32_t STDCALL graphics_window_get_height ( WINDOW_HANDLE handle)

Get the absolute height of an existing console window.

Parameters
HandleThe handle of the window to get the height for
Returns
The absolute height of the window
Note
For Graphics Console functions, Height is based on screen pixels not characters

◆ graphics_window_get_format()

uint32_t STDCALL graphics_window_get_format ( WINDOW_HANDLE handle)

Get the color format of an existing console window.

Parameters
HandleThe handle of the window to get the format for
Returns
The color format of the window (eg COLOR_FORMAT_ARGB32)

◆ graphics_window_get_forecolor()

uint32_t STDCALL graphics_window_get_forecolor ( WINDOW_HANDLE handle)

Get the current foreground color of an existing console window.

Parameters
HandleThe handle of the window to get the foreground color for
Returns
The foreground color of the window (eg COLOR_WHITE)

◆ graphics_window_set_forecolor()

uint32_t STDCALL graphics_window_set_forecolor ( WINDOW_HANDLE handle,
uint32_t color )

Set the current foreground color of an existing console window.

Parameters
HandleThe handle of the window to set the foreground color for
ColorThe foreground color to set (eg COLOR_WHITE)
Returns
ERROR_SUCCESS if completed or another error code on failure

◆ graphics_window_get_backcolor()

uint32_t STDCALL graphics_window_get_backcolor ( WINDOW_HANDLE handle)

Get the current background color of an existing console window.

Parameters
HandleThe handle of the window to get the background color for
Returns
The background color of the window (eg COLOR_BLACK)

◆ graphics_window_set_backcolor()

uint32_t STDCALL graphics_window_set_backcolor ( WINDOW_HANDLE handle,
uint32_t color )

Set the current background color of an existing console window.

Parameters
HandleThe handle of the window to set the background color for
ColorThe background color to set (eg COLOR_BLACK)
Returns
ERROR_SUCCESS if completed or another error code on failure

◆ graphics_window_get_font()

FONT_HANDLE STDCALL graphics_window_get_font ( WINDOW_HANDLE handle)

Get the default font of an existing console window.

Parameters
HandleThe handle of the window to get the default font for
Returns
The font handle of the default font or INVALID_HANDLE_VALUE on error

◆ graphics_window_set_font()

uint32_t STDCALL graphics_window_set_font ( WINDOW_HANDLE handle,
FONT_HANDLE font )

Set the default font of an existing console window.

Parameters
HandleThe handle of the window to set the default font for
FontThe font handle of the default font to set
Returns
ERROR_SUCCESS if completed or another error code on failure

◆ graphics_window_get_cursor_xy()

uint32_t STDCALL graphics_window_get_cursor_xy ( WINDOW_HANDLE handle,
uint32_t * x,
uint32_t * y )

Get the current cursor X and Y positions of an existing console window.

Parameters
HandleThe handle of the window to get cursor X and Y for
XThe returned cursor X value
YThe returned cursor Y value
Returns
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

◆ graphics_window_set_cursor_xy()

uint32_t STDCALL graphics_window_set_cursor_xy ( WINDOW_HANDLE handle,
uint32_t x,
uint32_t y )

Set the current cursor X and Y positions of an existing console window.

Parameters
HandleThe handle of the window to set cursor X and Y for
XThe new cursor X value
YThe new cursor Y value
Returns
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

◆ graphics_window_get_cursor_mode()

CURSOR_MODE STDCALL graphics_window_get_cursor_mode ( WINDOW_HANDLE handle)

Get the current cursor mode of an existing console window.

Parameters
HandleThe handle of the window to get the mode for
Returns
The current cursor mode (eg CURSOR_MODE_INSERT)

◆ graphics_window_set_cursor_mode()

uint32_t STDCALL graphics_window_set_cursor_mode ( WINDOW_HANDLE handle,
CURSOR_MODE cursormode )

Set the current cursor mode of an existing console window.

Parameters
HandleThe handle of the window to set the mode for
CursorModeThe cursor mode to set (eg CURSOR_MODE_INSERT)
Returns
ERROR_SUCCESS if completed or another error code on failure

◆ graphics_window_get_cursor_blink()

BOOL STDCALL graphics_window_get_cursor_blink ( WINDOW_HANDLE handle)

Get the current cursor blink state of an existing console window.

Parameters
HandleThe handle of the window to get blink state for
Returns
True if blink is enabled, False if not or on error

◆ graphics_window_set_cursor_blink()

uint32_t STDCALL graphics_window_set_cursor_blink ( WINDOW_HANDLE handle,
BOOL cursorblink )

Set the current cursor blink state of an existing console window.

Parameters
HandleThe handle of the window to set the blink state for
CursorBlinkTrue to enable blink, False to disable
Returns
ERROR_SUCCESS if completed or another error code on failure

◆ graphics_window_get_cursor_state()

CURSOR_STATE STDCALL graphics_window_get_cursor_state ( WINDOW_HANDLE handle)

Get the current cursor state of an existing console window.

Parameters
HandleThe handle of the window to get the state for
Returns
The current cursor state (eg CURSOR_STATE_ON)

◆ graphics_window_set_cursor_state()

uint32_t STDCALL graphics_window_set_cursor_state ( WINDOW_HANDLE handle,
CURSOR_STATE cursorstate )

Set the current cursor state of an existing console window.

Parameters
HandleThe handle of the window to set the state for
CursorStateThe cursor state to set (eg CURSOR_STATE_ON)
Returns
ERROR_SUCCESS if completed or another error code on failure

◆ graphics_window_get_cursor_shape()

CURSOR_SHAPE STDCALL graphics_window_get_cursor_shape ( WINDOW_HANDLE handle)

Get the current cursor shape of an existing console window.

Parameters
HandleThe handle of the window to get the shape for
Returns
The current cursor shape (eg CURSORLINE)

◆ graphics_window_set_cursor_shape()

uint32_t STDCALL graphics_window_set_cursor_shape ( WINDOW_HANDLE handle,
CURSOR_SHAPE cursorshape )

Set the current cursor shape of an existing console window.

Parameters
HandleThe handle of the window to set the shape for
CursorShapeThe cursor shape to set (eg CURSORLINE)
Returns
ERROR_SUCCESS if completed or another error code on failure

◆ graphics_window_cursor_on()

uint32_t STDCALL graphics_window_cursor_on ( WINDOW_HANDLE handle)

Enable the cursor on an existing console window.

Parameters
HandleThe handle of the window to enable the cursor for
Returns
ERROR_SUCCESS if completed or another error code on failure

◆ graphics_window_cursor_off()

uint32_t STDCALL graphics_window_cursor_off ( WINDOW_HANDLE handle)

Disable the cursor on an existing console window.

Parameters
HandleThe handle of the window to disable the cursor for
Returns
ERROR_SUCCESS if completed or another error code on failure

◆ graphics_window_cursor_line()

uint32_t STDCALL graphics_window_cursor_line ( WINDOW_HANDLE handle)

Change the cursor to a vertical line on an existing console window.

Parameters
HandleThe handle of the window to change the cursor for
Returns
ERROR_SUCCESS if completed or another error code on failure

◆ graphics_window_cursor_bar()

uint32_t STDCALL graphics_window_cursor_bar ( WINDOW_HANDLE handle)

Change the cursor to a horizontal bar on an existing console window.

Parameters
HandleThe handle of the window to change the cursor for
Returns
ERROR_SUCCESS if completed or another error code on failure

◆ graphics_window_cursor_block()

uint32_t STDCALL graphics_window_cursor_block ( WINDOW_HANDLE handle)

Change the cursor to a solid block on an existing console window.

Parameters
HandleThe handle of the window to change the cursor for
Returns
ERROR_SUCCESS if completed or another error code on failure

◆ graphics_window_cursor_move()

uint32_t STDCALL graphics_window_cursor_move ( WINDOW_HANDLE handle,
uint32_t x,
uint32_t y )

Move the cursor on an existing console window.

Parameters
HandleThe handle of the window to move the cursor for
XThe column to move the cursor to
YThe row to move the cursor to
Returns
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

◆ graphics_window_cursor_blink()

uint32_t STDCALL graphics_window_cursor_blink ( WINDOW_HANDLE handle,
BOOL enabled )

Set the blink state of the cursor on an existing console window.

Parameters
HandleThe handle of the window to set the blink state for
EnabledTrue if the cursor is blinking, False if not
Returns
ERROR_SUCCESS if completed or another error code on failure

◆ graphics_window_clear()

uint32_t STDCALL graphics_window_clear ( WINDOW_HANDLE handle)

Clear the current viewport of an existing console window.

Parameters
HandleThe handle of the window to clear
Returns
ERROR_SUCCESS if completed or another error code on failure

◆ graphics_window_clear_ex()

uint32_t STDCALL graphics_window_clear_ex ( WINDOW_HANDLE handle,
uint32_t x1,
uint32_t y1,
uint32_t x2,
uint32_t y2,
uint32_t color )

Clear part of the the current viewport of an existing console window.

Parameters
HandleThe handle of the window to clear
X1The left edge of the area to clear (relative to current viewport)
Y1The top edge of the area to clear (relative to current viewport)
X2The right edge of the area to clear (relative to current viewport)
Y2The bottom edge of the area to clear (relative to current viewport)
ColorThe fill color for the area to clear (eg COLOR_WHITE)
Returns
ERROR_SUCCESS if completed or another error code on failure
Note
For Graphics Console functions, Viewport is based on screen pixels not characters

◆ graphics_window_draw_box()

uint32_t STDCALL graphics_window_draw_box ( WINDOW_HANDLE handle,
uint32_t x1,
uint32_t y1,
uint32_t x2,
uint32_t y2,
uint32_t color,
uint32_t width )

Draw a rectangular box outline on an existing console window.

Parameters
HandleThe handle of the window to draw on
X1The left edge of the box (relative to current viewport)
Y1The top edge of the box (relative to current viewport)
X2The right edge of the box (relative to current viewport)
Y2The bottom edge of the box (relative to current viewport)
ColorThe color to draw with (eg COLOR_WHITE)
WidthThe width of the box outline
Returns
ERROR_SUCCESS if completed or another error code on failure
Note
For Graphics Console functions, Viewport is based on screen pixels not characters

◆ graphics_window_draw_line()

uint32_t STDCALL graphics_window_draw_line ( WINDOW_HANDLE handle,
uint32_t x1,
uint32_t y1,
uint32_t x2,
uint32_t y2,
uint32_t color,
uint32_t width )

Draw a line on an existing console window.

Parameters
HandleThe handle of the window to draw on
X1The left starting point of the line (relative to current viewport)
Y1The top starting point of the line (relative to current viewport)
X2The right ending point of the line (relative to current viewport)
Y2The bottom ending point of the line (relative to current viewport)
ColorThe color to draw with (eg COLOR_WHITE)
WidthThe width of the line
Returns
ERROR_SUCCESS if completed or another error code on failure
Note
For Graphics Console functions, Viewport is based on screen pixels not characters

◆ graphics_window_draw_block()

uint32_t STDCALL graphics_window_draw_block ( WINDOW_HANDLE handle,
uint32_t x1,
uint32_t y1,
uint32_t x2,
uint32_t y2,
uint32_t color )

Draw a rectangular filled block on an existing console window.

Parameters
HandleThe handle of the window to draw on
X1The left edge of the block (relative to current viewport)
Y1The top edge of the block (relative to current viewport)
X2The right edge of the block (relative to current viewport)
Y2The bottom edge of the block (relative to current viewport)
ColorThe color to draw with (eg COLOR_WHITE)
Returns
ERROR_SUCCESS if completed or another error code on failure
Note
For Graphics Console functions, Viewport is based on screen pixels not characters

◆ graphics_window_draw_circle()

uint32_t STDCALL graphics_window_draw_circle ( WINDOW_HANDLE handle,
uint32_t x,
uint32_t y,
uint32_t color,
uint32_t width,
uint32_t radius )

Draw a circle on an existing console window.

Parameters
HandleThe handle of the window to draw on
XThe left starting point of the circle (relative to current viewport)
YThe top starting point of the circle (relative to current viewport)
ColorThe color to draw with (eg COLOR_WHITE)
WidthThe width of the circle outline
RadiusThe radius of the circle
Returns
ERROR_SUCCESS if completed or another error code on failure
Note
For Graphics Console functions, Viewport is based on screen pixels not characters

◆ graphics_window_draw_char()

uint32_t STDCALL graphics_window_draw_char ( WINDOW_HANDLE handle,
char ch,
uint32_t x,
uint32_t y )

Draw a character on an existing console window.

Parameters
HandleThe handle of the window to draw on
ChThe character to draw
XThe left starting point of the character (relative to current viewport)
YThe top starting point of the character (relative to current viewport)
Returns
ERROR_SUCCESS if completed or another error code on failure
Note
For Graphics Console functions, Viewport is based on screen pixels not characters

◆ graphics_window_draw_char_ex()

uint32_t STDCALL graphics_window_draw_char_ex ( WINDOW_HANDLE handle,
FONT_HANDLE font,
char ch,
uint32_t x,
uint32_t y,
uint32_t forecolor,
uint32_t backcolor )

Draw a character on an existing console window.

Parameters
HandleThe handle of the window to draw on
FontThe handle of the font to draw the character with
ChThe character to draw
XThe left starting point of the character (relative to current viewport)
YThe top starting point of the character (relative to current viewport)
ForecolorThe foreground color for the character (eg COLOR_WHITE)
BackcolorThe background color for the character (eg COLOR_BLACK)
Returns
ERROR_SUCCESS if completed or another error code on failure
Note
For Graphics Console functions, Viewport is based on screen pixels not characters

◆ graphics_window_draw_text()

uint32_t STDCALL graphics_window_draw_text ( WINDOW_HANDLE handle,
const char * text,
uint32_t x,
uint32_t y )

Draw a text string on an existing console window.

Parameters
HandleThe handle of the window to draw on
TextThe text to draw
XThe left starting point of the text (relative to current viewport)
YThe top starting point of the text (relative to current viewport)
Returns
ERROR_SUCCESS if completed or another error code on failure
Note
For Graphics Console functions, Viewport is based on screen pixels not characters

◆ graphics_window_draw_text_ex()

uint32_t STDCALL graphics_window_draw_text_ex ( WINDOW_HANDLE handle,
FONT_HANDLE font,
const char * text,
uint32_t x,
uint32_t y,
uint32_t forecolor,
uint32_t backcolor )

Draw a text string on an existing console window.

Parameters
HandleThe handle of the window to draw on
FontThe handle of the font to draw the text with
TextThe text to draw
XThe left starting point of the text (relative to current viewport)
YThe top starting point of the text (relative to current viewport)
ForecolorThe foreground color for the text (eg COLOR_WHITE)
BackcolorThe background color for the text (eg COLOR_BLACK)
Returns
ERROR_SUCCESS if completed or another error code on failure
Note
For Graphics Console functions, Viewport is based on screen pixels not characters

◆ graphics_window_draw_pixel()

uint32_t STDCALL graphics_window_draw_pixel ( WINDOW_HANDLE handle,
uint32_t x,
uint32_t y,
uint32_t color )

Draw a single pixel on an existing console window.

Parameters
HandleThe handle of the window to draw on
XThe column for the pixel (relative to current viewport)
YThe row for the pixel (relative to current viewport)
ColorThe color for the pixel (eg COLOR_WHITE)
Returns
ERROR_SUCCESS if completed or another error code on failure
Note
For Graphics Console functions, Viewport is based on screen pixels not characters

◆ graphics_window_draw_image()

uint32_t STDCALL graphics_window_draw_image ( WINDOW_HANDLE handle,
uint32_t x,
uint32_t y,
void * image,
uint32_t width,
uint32_t height,
uint32_t format )

Draw an image on an existing console window.

Parameters
HandleThe handle of the window to draw on
XThe left starting point of the image (relative to current viewport)
YThe top starting point of the image (relative to current viewport)
ImagePointer to the image data in a contiguous block of pixel rows
WidthThe width in pixels of a row in the image data
HeightThe height in pixels of all rows in the image data
FormatThe color format of the image data (eg COLOR_FORMAT_ARGB32) Pass COLOR_FORMAT_UNKNOWN to use the window format
Returns
ERROR_SUCCESS if completed or another error code on failure
Note
For Graphics Console functions, Viewport is based on screen pixels not characters

◆ graphics_window_get_pixel()

uint32_t STDCALL graphics_window_get_pixel ( WINDOW_HANDLE handle,
uint32_t x,
uint32_t y )

Get a single pixel from an existing console window.

Parameters
HandleThe handle of the window to get from
XThe column of the pixel (relative to current viewport)
YThe row of the pixel (relative to current viewport)
Returns
The color of the pixel at X,Y (eg COLOR_WHITE)
Note
For Graphics Console functions, Viewport is based on screen pixels not characters

◆ graphics_window_get_image()

uint32_t STDCALL graphics_window_get_image ( WINDOW_HANDLE handle,
uint32_t x,
uint32_t y,
void * image,
uint32_t width,
uint32_t height,
uint32_t format )

Get an image from an existing console window.

Parameters
HandleThe handle of the window to get from
XThe left starting point of the image (relative to current viewport)
YThe top starting point of the image (relative to current viewport)
ImagePointer to a block of memory large enough to hold the image in a contiguous block of pixel rows
WidthThe width in pixels of a row of the image
HeightThe height in pixels of all rows of the image
FormatThe color format to store in the image data (eg COLOR_FORMAT_ARGB32) Pass COLOR_FORMAT_UNKNOWN to use the window format
Returns
ERROR_SUCCESS if completed or another error code on failure
Note
For Graphics Console functions, Viewport is based on screen pixels not characters

◆ graphics_window_copy_image()

uint32_t STDCALL graphics_window_copy_image ( WINDOW_HANDLE handle,
CONSOLE_POINT * source,
CONSOLE_POINT * dest,
uint32_t width,
uint32_t height )

Copy an image from one place to another in an existing console window.

Parameters
HandleThe handle of the window to copy from and to
SourceThe starting point (X,Y) to copy the image from
DestThe starting point (X,Y) to copy the image to
WidthThe width in pixels of each row of the image
HeightThe height in pixels of all rows of the image
Returns
ERROR_SUCCESS if completed or another error code on failure
Note
For Graphics Console functions, Viewport is based on screen pixels not characters

◆ graphics_window_move_image()

uint32_t STDCALL graphics_window_move_image ( WINDOW_HANDLE handle,
CONSOLE_POINT * source,
CONSOLE_POINT * dest,
uint32_t width,
uint32_t height,
uint32_t fillcolor )

Move an image from one place to another in an existing console window.

Parameters
HandleThe handle of the window to copy from and to
SourceThe starting point (X,Y) to copy the image from
DestThe starting point (X,Y) to copy the image to
WidthThe width in pixels of each row of the image
HeightThe height in pixels of all rows of the image
FillcolorThe color to fill the area where the image was moved from (COLOR_NONE for no fill, same as copy)
Returns
ERROR_SUCCESS if completed or another error code on failure
Note
For Graphics Console functions, Viewport is based on screen pixels not characters

◆ graphics_window_image_size()

uint32_t STDCALL graphics_window_image_size ( WINDOW_HANDLE handle,
uint32_t width,
uint32_t height,
uint32_t format,
uint32_t stride )

Calculate the size in bytes of an image that is Width by Height in the color format specified.

Parameters
HandleThe handle of the window for the image
WidthThe width of the image in pixels
HeightThe height of the image in pixels
FormatThe color format to use for the calculation (eg COLOR_FORMAT_ARGB32) Pass COLOR_FORMAT_UNKNOWN to use the window format
StrideThe distance in bytes between each row of pixels (Optional)
Returns
The size in bytes for an image of the specified size and format or 0 on error

◆ graphics_window_get_count()

uint32_t STDCALL graphics_window_get_count ( CONSOLE_DEVICE * console)

Get the current console window count.

Graphics Console Helper Functions

Parameters
ConsoleThe console device to get the window count for
Returns
The current number of console windows on the specified console device

◆ graphics_window_get_active()

WINDOW_HANDLE STDCALL graphics_window_get_active ( CONSOLE_DEVICE * console)

Get the current console active window.

Parameters
ConsoleThe console device to get the active window for
Returns
The window handle of the current active window or INVALID_HANDLE_VALUE on failure

◆ graphics_window_check()

GRAPHICS_WINDOW *STDCALL graphics_window_check ( CONSOLE_DEVICE * console,
GRAPHICS_WINDOW * window )

Check if a console window entry is valid.

Parameters
ConsoleThe console device to search for the window
WindowThe window entry to check for validity
Returns
The supplied window if successful or nil on failure