Skip to content

header-only library for the windows terminal.

License

Notifications You must be signed in to change notification settings

itskian/winterm

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 

Repository files navigation

winterm

made with c++17 mit license

A header-only library for the windows terminal.

Example

// initialize the library
term::initialize();

// set the title
term::title(L"monkey nuts");

// resize the terminal
term::size({ 140, 40 });

// disable the cursor blinking
term::disable(term::cursor);

// prevent highlighting text in the console
term::disable(term::highlighting);

std::wstring name = L"";

// clear the console
term::clear();

// draw red text in the top left
term::string({ 0, 0 }, term::red, L"hello world!");

// same thing but a blue background
term::string({ 0, 1 }, { term::red, term::blue }, L"hello world!");

// you can also add term::intense to any color
term::string({ 0, 2 }, { term::red, term::blue | term::intense }, L"hello world!");

// draw a centered string in the middle of the screen
term::stringc({ 70, 20 }, term::white, L"what is your name?");

while (name.empty()) {
  // draw to the screen
  term::flush();

  // ask for their name
  term::input({ 0, 39 }, name);
}

// clear the center of the screen by drawing an empty horizontal line
term::hline(20, 0, ' ');

// you can change colors in the middle of the stringby using #
term::stringc({ 70, 20 }, term::white, L"your name is #6X%s#7X!", name.c_str());

// draw to the screen
term::flush();

std::getchar();

About

header-only library for the windows terminal.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages