mirror of
https://github.com/dankamongmen/notcurses
synced 2025-03-10 01:29:05 -04:00
tetris: refresh on startup in place of erase()
This commit is contained in:
parent
0e7e8b02eb
commit
a76ee9a5af
@ -8,7 +8,6 @@ void DrawBackground(const std::string& s) { // drawn to the standard plane
|
||||
}
|
||||
|
||||
void DrawBoard() { // draw all fixed components of the game
|
||||
stdplane_->erase();
|
||||
try{
|
||||
DrawBackground(BackgroundFile);
|
||||
}catch(...){
|
||||
|
@ -32,9 +32,10 @@ int main(void) {
|
||||
srand(time(nullptr));
|
||||
std::atomic_bool gameover = false;
|
||||
notcurses_options ncopts{};
|
||||
ncopts.flags = NCOPTION_INHIBIT_SETLOCALE | NCOPTION_NO_ALTERNATE_SCREEN;
|
||||
ncopts.flags = NCOPTION_INHIBIT_SETLOCALE;
|
||||
ncpp::NotCurses nc(ncopts);
|
||||
{
|
||||
nc.refresh(nullptr, nullptr); // clear screen if smcup+background are unavailable
|
||||
Tetris t{nc, gameover};
|
||||
std::thread tid(&Tetris::Ticker, &t);
|
||||
if(IOLoop(nc, t, gameover)){
|
||||
|
Loading…
x
Reference in New Issue
Block a user