Switch to C++
This commit is contained in:
23
ui/base.cc
Normal file
23
ui/base.cc
Normal file
@@ -0,0 +1,23 @@
|
||||
#include "base.h"
|
||||
|
||||
#include <curses.h>
|
||||
#include <string.h>
|
||||
|
||||
#include <string>
|
||||
|
||||
namespace ui {
|
||||
void draw_text(const std::string text, int *x, int *y) {
|
||||
if (!text.length()) return;
|
||||
|
||||
auto iter = text.begin();
|
||||
|
||||
mvaddch(*y, *x, *iter);
|
||||
++iter;
|
||||
|
||||
for (; iter != text.end(); ++iter) {
|
||||
addch(*iter);
|
||||
}
|
||||
|
||||
getyx(stdscr, *y, *x);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user