fixed output not found

This commit is contained in:
2024-07-15 17:56:45 -04:00
parent 356bfb3b2e
commit 1ebdd2d162
8 changed files with 292 additions and 0 deletions

35
src/output.h Normal file
View File

@ -0,0 +1,35 @@
#ifndef __DISPLAY_H__
#define __DISPLAY_H__
#include <ncurses.h>
#include <vector>
#include "position.h"
#include "cursor.h"
class output {
protected:
// use an array of ints to keep track of what's on the screen
// This will have a bit of buffer for the last line
// just in case it overflows
std::vector<int> contents;
public:
output();
virtual ~output() = default;
// Only call this to refresh the entire output
virtual void render() = 0;
// Clears the contents buffer
virtual void clear();
virtual void print_char(const position &pos, const char ch,
const int attrs =
A_NORMAL | COLOR_PAIR(COLOR_WHITE)) = 0;
virtual void print_str(const position &pos, const std::string &str,
const int attrs =
A_NORMAL | COLOR_PAIR(COLOR_WHITE)) = 0;
// default arguments are to be set in the base class's declaration
};
#endif