alec

Abstraction Layer for Escape Codes
git clone git://git.dimitrijedobrota.com/alec.git
Log | Files | Refs | README | LICENSE

demo.cpp (823B)


      1 #include "alec.hpp"
      2 #include <iostream>
      3 
      4 using namespace alec;
      5 using enum Color;
      6 using enum Decor;
      7 
      8 int main(void) {
      9     std::cout << abuf_enable_v << cursor_hide_v;
     10 
     11     std::cout << cursor_position_v<1, 1> << foreground_v<91> << "HELLO!\n";
     12 
     13     std::cout << cursor_down_v<3>;
     14     std::cout << foreground_v<30> << background_v<196, 53, 64> << "WORLD!\n";
     15 
     16     std::cout << background_v<DEFAULT> << "testing 1...\n" << foreground_v<DEFAULT>;
     17     std::cout << decor_set_v<INVERSE> << "testing 2...\n" << decor_reset_v<INVERSE>;
     18 
     19     std::cout << cursor_up_v<5> << "Hello there!" << cursor_save_v;
     20     std::cout << cursor_down_v<10> << "General Kenobi!";
     21     std::cout << cursor_position_v<10, 40> << "no pain no gain" << cursor_restore_v << cursor_show_v;
     22 
     23     getchar();
     24 
     25     std::cout << abuf_disable_v;
     26 
     27     return 0;
     28 }