aboutsummaryrefslogtreecommitdiff
path: root/cRender.cpp
diff options
context:
space:
mode:
authorGravatar jonas <himself@jonasgunz.de> 2019-01-08 09:50:50 +0100
committerGravatar jonas <himself@jonasgunz.de> 2019-01-08 09:50:50 +0100
commit75a09cb6229b8c14ad180f05edf1b5402eed5299 (patch)
treecd339b418b2de57558827786fc806ef051222c84 /cRender.cpp
parent6152506560cc3642e1956bc9e2502e8ae8aa9a5b (diff)
downloadtermgl-75a09cb6229b8c14ad180f05edf1b5402eed5299.tar.gz
cRender can now use bottom line
changed output to framebuffer from printf to write
Diffstat (limited to 'cRender.cpp')
-rw-r--r--cRender.cpp9
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)