Skip to content

Commit

Permalink
Add hello world to readme
Browse files Browse the repository at this point in the history
  • Loading branch information
a-n-t-h-o-n-y committed Feb 15, 2024
1 parent ffa5e67 commit fbd344b
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 8 deletions.
37 changes: 32 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,41 @@

__Terminal Escape Sequence Library__

This library provides support for generating terminal escape sequences. These
sequences, when written to `stdout`, enable control over terminal visual
presentation and behavior.
`Escape` provides support for generating and interpreting terminal escape
sequences. These can be written to the terminal to control cursor movement, text
formatting, and colors. It also includes a `read()` function to produce
keyboard, mouse input, and window resize events.

```cpp
#include <iostream>
#include <esc/esc.hpp>

using namespace esc;

int main()
{
std::cout
<< escape(Brush{
.background = XColor::Cyan,
.foreground = TrueColor{0xF02127},
.traits = Trait::Italic,
}) << "Hello"

<< escape(Brush{}) << " 👽 "

<< escape(
fg(TrueColor{0x76F09C}),
Trait::Bold | Trait::Underline
) << "World!"

<< escape(Brush{}) << std::endl;
}
```

## Features

- **Dynamic Terminal Control**: Generate escape sequences for cursor movement, text formatting, color settings, and more.
- **Event Handling**: Includes a `read()` function to handle keyboard, mouse inputs, and window resize events, enhancing interactive applications.
- **Dynamic Terminal Control**: Generate escape sequences for cursor movement, text formatting, and colors.
- **Event Handling**: Includes a `read()` function to handle keyboard, mouse input, and window resize events, enabling interactive terminal applications.
- **Cross-Terminal Compatibility**: Designed to work across various terminals without relying on a terminfo database.

## Dependencies
Expand Down
6 changes: 3 additions & 3 deletions examples/pong.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ struct Game {
};

struct {
std::size_t score;
std::size_t score = 0;
Player player;
Paddle paddle{
.top = {.x = 1, .y = (game_space.height - Paddle::height) / 2},
Expand All @@ -81,7 +81,7 @@ struct Game {
} left;

struct {
std::size_t score;
std::size_t score = 0;
Player player;
Paddle paddle{
.top = {.x = game_space.width - 2,
Expand All @@ -96,7 +96,7 @@ struct Game {
float dx = 0;
float dy = 0;
} velocity;
} ball;
} ball{};
};

struct PlayerSelectMenu {
Expand Down

0 comments on commit fbd344b

Please sign in to comment.