cmdfx 0.2.1
Lightweight game engine for your terminal
Loading...
Searching...
No Matches
screen.hpp
Go to the documentation of this file.
1
11#pragma once
12
13#include <string>
14
15extern "C" {
16 #include "cmdfx/core/screen.h"
17}
18
19namespace CmdFX {
23 namespace Screen {
24 void getScreenSize(int* width, int* height) { Screen_getSize(width, height); }
25 void getMousePos(int* x, int* y) { Screen_getMousePos(x, y); }
26
27 int isEchoEnabled() { return Screen_isEchoEnabled(); }
28 void setEchoEnabled(int echoEnabled) { Screen_setEchoEnabled(echoEnabled); }
29 int isLineBuffered() { return Screen_isLineBuffered(); }
30 void setLineBuffered(int lineBuffered) { Screen_setLineBuffered(lineBuffered); }
31
32 bool isInTerminal() { return Screen_isInTerminal(); }
33 void ensureInTerminal() { Screen_ensureInTerminal(); }
34 };
35
39 namespace Window {
40 const char* getTitle() { return Window_getTitle(); }
41 void setTitle(const char* title) { Window_setTitle(title); }
42 void setTitle(const std::string& title) { Window_setTitle(title.c_str()); }
43 void getSize(int* width, int* height) { Window_getSize(width, height); }
44 void setSize(int width, int height) { Window_setSize(width, height); }
45 };
46}
C++ wrapper for the CmdFX Screen API.
Definition screen.hpp:23
C++ wrapper for the CmdFX Window API.
Definition screen.hpp:39
Primary namespace for CmdFX.
Definition cmdfx.hpp:22
Screen API for controlling other things around the terminal.
int Screen_setLineBuffered(int enabled)
Sets whether or not line buffering is enabled.
void Window_setTitle(const char *title)
Sets the title of the terminal window.
void Window_setSize(int width, int height)
Sets the size of the terminal window.
void Screen_ensureInTerminal()
Ensures that the program is running in a terminal.
int Screen_setEchoEnabled(int enabled)
Sets whether or not echoing is enabled.
void Screen_getSize(int *width, int *height)
Gets the size of the screen, and stores it in the width and height variables.
int Screen_isEchoEnabled()
Gets whether or not echoing is enabled.
const char * Window_getTitle()
Gets the title of the terminal window.
int Screen_isInTerminal()
Checks if the program is running 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.
int Screen_isLineBuffered()
Gets whether or not line buffering is enabled.
void Window_getSize(int *width, int *height)
Gets the size of the terminal window, and stores it in the width and height variables.