pvjc25/du8/world.c
2025-06-08 12:52:57 +02:00

36 lines
508 B
C

#include <ncurses.h>
#include "world.h"
void world_init() {
initscr();
noecho();
curs_set(FALSE);
keypad(stdscr, TRUE);
timeout(-1); // Blokujúce čakanie na vstup
}
void world_end() {
endwin();
}
int world_get_key() {
return getch();
}
void world_clear() {
clear();
}
void world_draw_char(int x, int y, char c) {
mvaddch(y, x, c);
}
void world_draw_text(int x, int y, const char *text) {
mvprintw(y, x, "%s", text);
}
void world_display() {
refresh();
}