#include <stdio.h>
#include "../lib/libtui.h"
void cleanup()
{
}
{
cleanup();
exit(-1);
}
}
{
exit(-2);
}
}
int main(int argc, char *argv[])
{
atexit(cleanup);
size_t x = 0;
size_t y = 0;
while (1) {
if (key == KEY_J) {
++y;
} else if (key == KEY_K) {
--y;
} else if (key == KEY_H) {
--x;
} else if (key == KEY_L) {
++x;
} else if (key == KEY_ESC) {
break;
}
}
}
return 0;
}
const char * libtui_draw_err_str(enum LIBTUI_DRAW_ERR err)
This function returns the string that corresponds to the given LIBTUI_DRAW_ERR.
Definition libtui_draw.c:7
enum LIBTUI_DRAW_ERR libtui_draw_clear_with_char(struct libtui_renderer *const renderer, const char c)
Clears the screen with the specified char.
Definition libtui_draw.c:30
enum LIBTUI_DRAW_ERR libtui_draw_single_char(struct libtui_renderer *const renderer, const char c, size_t x, size_t y)
Draws a single char at the specified (x, y).
Definition libtui_draw.c:61
LIBTUI_DRAW_ERR
Error Codes For Draw Module.
Definition libtui_draw.h:20
@ DRAW_ERROR_OK
No Error.
Definition libtui_draw.h:22
LIBTUI_KEYCODE
Complete enum of keycodes with the referring ascii codes.
Definition libtui_keyboard.h:17
bool libtui_keyboard_is_kb_hit(void)
Returns true if a key is pressed.
Definition libtui_keyboard.c:9
enum LIBTUI_KEYCODE libtui_keyboard_get_key(void)
Returns the pressed key.
Definition libtui_keyboard.c:27
void libtui_true_clear(void)
Truly clears the console independent from all the buffer stuff. Uses: system("clear");.
Definition libtui_term_control.c:18
void libtui_show_cursor(void)
Shows the cursor of the terminal.
Definition libtui_term_control.c:12
void libtui_hide_cursor(void)
Hides the cursor of the terminal.
Definition libtui_term_control.c:6
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_OK
No Error.
Definition libtui_renderer.h:22
Struct that holds data used by therendering module.
Definition libtui_renderer.h:44