8000 GitHub - yz-5555/trenderer: Header-only ANSI text rendering library
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

yz-5555/trenderer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

40 Commits
 
 
 
 
 
 
 
 

Repository files navigation

TRENDERER

Another ANSI library for awesome text rendering in terminals.

Why TRENDERER?

  • Beginner friendly.
  • Cross-platform.
  • Header-only.

Key features

1. Add styles.

void tr_effect(TrEffect effects); // BOLD, DIM, UNDERLINE, BLINK, INVERT, HIDDEN, STRIKETHROUGH
void tr_fg_color(uint32_t fg_color, TrColorsMode fg_mode); // Supports ANSI 16, ANSI 256, true colors.
void tr_bg_color(uint32_t bg_color, TrColorsMode bg_mode);

2. Draw various contents.

void tr_draw_sprite(const TrPixel *sprite, int width, int height, int x, int y);
void tr_draw_text(const char *text, const TrStyle *style, int x, int y);

3. Render using frame buffers.

void tr_fb_clear(TrPixel *fb, int fb_width, int fb_height, uint32_t bg_color, TrColorsMode bg_mode);
void tr_fb_render(TrPixel *curr_fb, TrPixel *prev_fb, int fb_width, int fb_height);
void tr_fb_draw_sprite(TrPixel *fb, int fb_width, int fb_height, const TrPixel *sprite, int sprite_width, int sprite_height, int sprite_x, int sprite_y);
void tr_fb_draw_text(TrPixel *fb, int fb_width, int fb_height, const char *text, const TrStyle *text_style, int text_x, int text_y);

4. More controls

void tr_clear(void); // Clear the screen
void tr_move_cursor(int x, int y);
void tr_show_cursor(bool visible);

Installation

Just add trenderer.h to your project and it's good to go.

About

Header-only ANSI text rendering library

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

0