cmdfx 0.3.2
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
20{
24namespace Screen
25{
26void getScreenSize(int* width, int* height) {
27 Screen_getSize(width, height);
28}
29void getMousePos(int* x, int* y) {
31}
32
33int isEchoEnabled() {
34 return Screen_isEchoEnabled();
35}
36void setEchoEnabled(int echoEnabled) {
37 Screen_setEchoEnabled(echoEnabled);
38}
39int isLineBuffered() {
40 return Screen_isLineBuffered();
41}
42void setLineBuffered(int lineBuffered) {
43 Screen_setLineBuffered(lineBuffered);
44}
45
46bool isInTerminal() {
47 return Screen_isInTerminal();
48}
49void ensureInTerminal() {
51}
52}; // namespace Screen
53
57namespace Window
58{
59const char* getTitle() {
60 return Window_getTitle();
61}
62void setTitle(const char* title) {
63 Window_setTitle(title);
64}
65void setTitle(const std::string& title) {
66 Window_setTitle(title.c_str());
67}
68void getSize(int* width, int* height) {
69 Window_getSize(width, height);
70}
71void setSize(int width, int height) {
72 Window_setSize(width, height);
73}
74}; // namespace Window
75} // namespace CmdFX
C++ wrapper for the CmdFX Screen API.
Definition screen.hpp:25
C++ wrapper for the CmdFX Window API.
Definition screen.hpp:58
Primary namespace for CmdFX.
Definition cmdfx.hpp:26
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.