![]() |
cmdfx 0.2.0
Lightweight game engine for your terminal
|
Screen API for controlling other things around the terminal. More...
Go to the source code of this file.
Functions | |
const char * | Window_getTitle () |
Gets the title of the terminal window. | |
void | Window_setTitle (const char *title) |
Sets the title of the terminal window. | |
void | Window_getSize (int *width, int *height) |
Gets the size of the terminal window, and stores it in the width and height variables. | |
void | Window_setSize (int width, int height) |
Sets the size of the terminal window. | |
void | Screen_getSize (int *width, int *height) |
Gets the size of the screen, and stores it in the width and height variables. | |
void | Screen_getMousePos (int *x, int *y) |
Gets the position of the mouse, and stores it in the x and y variables. | |
int | Screen_isEchoEnabled () |
Gets whether or not echoing is enabled. | |
int | Screen_setEchoEnabled (int enabled) |
Sets whether or not echoing is enabled. | |
int | Screen_isLineBuffered () |
Gets whether or not line buffering is enabled. | |
int | Screen_setLineBuffered (int enabled) |
Sets whether or not line buffering is enabled. | |
int | Screen_isInTerminal () |
Checks if the program is running in a terminal. | |
void | Screen_ensureInTerminal () |
Ensures that the program is running in a terminal. | |
Screen API for controlling other things around the terminal.
void Screen_ensureInTerminal | ( | ) |
Ensures that the program is running in a terminal.
This method will check if the program is running in a terminal. If it is not, the program will exit and launch the program in a terminal.
void Screen_getMousePos | ( | int * | x, |
int * | y ) |
Gets the position of the mouse, and stores it in the x and y variables.
This method gets the position of the mouse on the screen. The x and y variables will be updated with the x and y position of the mouse.
This method will require administrator privileges on Linux.
x | The pointer to the x position of the mouse. |
y | The pointer to the y position of the mouse. |
void Screen_getSize | ( | int * | width, |
int * | height ) |
Gets the size of the screen, and stores it in the width and height variables.
width | The pointer to the width of the screen. |
height | The pointer to the height of the screen. |
int Screen_isEchoEnabled | ( | ) |
Gets whether or not echoing is enabled.
This method gets whether or not echoing is enabled on the terminal. Echoing is when the terminal displays the characters that are typed. If this is off, the terminal will not display the characters when they are typed.
int Screen_isInTerminal | ( | ) |
Checks if the program is running in a terminal.
This method checks if the program is running in a terminal. This is useful for determining if your setup is correct.`
int Screen_isLineBuffered | ( | ) |
Gets whether or not line buffering is enabled.
This method gets whether or not line buffering is enabled on the terminal. Line buffering is when the terminal waits for a newline character before sending the input to the program. This must be disabled in order to listen for individual key presses, otherwise events will only pass if the user presses enter.
int Screen_setEchoEnabled | ( | int | enabled | ) |
Sets whether or not echoing is enabled.
enabled | 1 to enable echoing, 0 to disable echoing. |
int Screen_setLineBuffered | ( | int | enabled | ) |
Sets whether or not line buffering is enabled.
enabled | 1 to enable line buffering, 0 to disable line buffering. |
void Window_getSize | ( | int * | width, |
int * | height ) |
Gets the size of the terminal window, and stores it in the width and height variables.
width | The pointer to the width of the terminal window. |
height | The pointer to the height of the terminal window. |
const char * Window_getTitle | ( | ) |
Gets the title of the terminal window.
void Window_setSize | ( | int | width, |
int | height ) |
Sets the size of the terminal window.
width | The width of the terminal window. |
height | The height of the terminal window. |
void Window_setTitle | ( | const char * | title | ) |
Sets the title of the terminal window.
title | The title to set. |