libtui
Loading...
Searching...
No Matches
libtui_renderer.h
Go to the documentation of this file.
1#ifndef LIBTUI_RENDERER_H
2#define LIBTUI_RENDERER_H
3
4#include <stdlib.h>
5
6struct libtui_buffer;
7
31
37
48 size_t rows;
50 size_t columns;
51};
52
65libtui_renderer_create(size_t width, size_t height,
66 struct libtui_renderer **const renderer_out);
67
76libtui_renderer_render(struct libtui_renderer *const renderer);
77
88
94
95#endif
enum LIBTUI_RENDERER_ERR libtui_renderer_create(size_t width, size_t height, struct libtui_renderer **const renderer_out)
Creates a new libtui_renderer.
Definition libtui_renderer.c:33
enum LIBTUI_RENDERER_ERR libtui_renderer_free(struct libtui_renderer *renderer)
Frees the renderer completely.
Definition libtui_renderer.c:75
enum LIBTUI_RENDERER_ERR libtui_renderer_render(struct libtui_renderer *const renderer)
Renders the final buffer to the screen.
Definition libtui_renderer.c:58
LIBTUI_RENDERER_ERR
Definition libtui_renderer.h:20
const char * libtui_renderer_err_str(enum LIBTUI_RENDERER_ERR err)
This function returns the string that corresponds to the given LIBTUI_RENDERER_ERR.
Definition libtui_renderer.c:10
@ RENDERER_ERROR_COUNT
Total number of errors.
Definition libtui_renderer.h:29
@ RENDERER_ERROR_NULL_RENDERER
The libtui_renderer* passed in as an argument is NULL.
Definition libtui_renderer.h:26
@ RENDERER_ERROR_MALLOC_FAILED
Tried to use malloc but failed.
Definition libtui_renderer.h:24
@ RENDERER_ERROR_OK
No Error.
Definition libtui_renderer.h:22
A struct that represents a 2D buffer. WARNING: Internal struct, end user shouldn't use this.
Definition libtui_buffer.h:27
Struct that holds data used by therendering module.
Definition libtui_renderer.h:44
struct libtui_buffer * buf
Owned and will be freed together with struct libtui_renderer at libtui_renderer_free.
Definition libtui_renderer.h:46
size_t rows
The amount of chars in the X axis on screen doesn't include ' ' and such control chars.
Definition libtui_renderer.h:48
size_t columns
The amount of chars in the Y axis on screen doesn't include ' ' and such control chars.
Definition libtui_renderer.h:50