diff options
author | jonas <himself@jonasgunz.de> | 2019-01-08 09:50:50 +0100 |
---|---|---|
committer | jonas <himself@jonasgunz.de> | 2019-01-08 09:50:50 +0100 |
commit | 75a09cb6229b8c14ad180f05edf1b5402eed5299 (patch) | |
tree | cd339b418b2de57558827786fc806ef051222c84 | |
parent | 6152506560cc3642e1956bc9e2502e8ae8aa9a5b (diff) | |
download | termgl-75a09cb6229b8c14ad180f05edf1b5402eed5299.tar.gz |
cRender can now use bottom line
changed output to framebuffer from printf to write
-rw-r--r-- | cRender.cpp | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/cRender.cpp b/cRender.cpp index 5e5cb9d..12a4101 100644 --- a/cRender.cpp +++ b/cRender.cpp @@ -164,8 +164,11 @@ int cRender::render(void) #elif __linux__ //gotoxy(x,y) now included!! - printf("\e[%i;%iH\033[%im%c\n", i + 1, o + 1, wColor[o][i], cScreen[o][i]); - // Position Color + char buffer[20]; + int cbuf = sprintf(buffer,"\e[%i;%iH\e[%im%c", i + 1, o + 1, wColor[o][i], cScreen[o][i]); + // Position Color Origin is at 1,1 + write (STDOUT_FILENO, buffer, cbuf); + #endif //__linux__ } bChanged[o][i] = false; @@ -256,7 +259,7 @@ sPos cRender::getConsoleWindowSize() struct winsize w; ioctl(STDOUT_FILENO, TIOCGWINSZ, &w); - return {w.ws_col, w.ws_row - 1}; + return {w.ws_col, w.ws_row}; } void cRender::setAlternateBufferScreen(bool _enable) |