diff options
author | jonas <himself@jonasgunz.de> | 2018-12-14 18:46:22 +0100 |
---|---|---|
committer | jonas <himself@jonasgunz.de> | 2018-12-14 18:46:22 +0100 |
commit | 79deae78d89757b3e1a53b5d990c28cc70d4175d (patch) | |
tree | 32ae7a308961b6aa21c63bd97d6c38341388117f /AmpelJonas/cRender.h | |
parent | 2da23ea7be6dd20da8d7319da4db69ff9688b9e6 (diff) | |
download | termgl-79deae78d89757b3e1a53b5d990c28cc70d4175d.tar.gz |
Performance improvements to cRender::render() by only drawing changed pixels
NON-Working
Diffstat (limited to 'AmpelJonas/cRender.h')
-rw-r--r-- | AmpelJonas/cRender.h | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/AmpelJonas/cRender.h b/AmpelJonas/cRender.h index 30077e9..00f94e2 100644 --- a/AmpelJonas/cRender.h +++ b/AmpelJonas/cRender.h @@ -91,8 +91,11 @@ public: int render(void); //Prints cScreen - int clear(void); + int clear(); + int clear(bool _forceReRender); //clears cScreen + wColor + // for _forceReRender == true, the bChanged[][] is set to true to force Re-Render of whole Screen + // clear(void) calls clear(_forceReRender = false) int getLastError(); //Returns last Error that was not returnable @@ -104,10 +107,13 @@ public: protected: cRender(); //Empty Constructor for being inheritable + void setBufferSize(sPos _size); + bool bBlockRender; //Used by children to block render function char **cScreen; //Pixel Map WORD **wColor; //Color Map + bool **bChanged; //Pixel Change Map char cBackound; //Default backround WORD wBackColor; @@ -128,7 +134,9 @@ private: //Slightly adapted from: http://www.cplusplus.com/forum/windows/121444/ #endif void gotoxy( int x, int y ); - void setBufferSize(sPos _size); + + void forceReRender(); + #ifdef __linux__ sPos getConsoleWindowSize(); #endif |