Implements calling Lua.

This commit is contained in:
2021-08-25 12:27:39 +09:00
parent 1518e429b4
commit 213902021c
46 changed files with 2233 additions and 245 deletions

55
src/Frame.h Normal file
View File

@@ -0,0 +1,55 @@
#pragma once
#include <vector>
#include "iDrawable.h"
#include "iWritable.h"
namespace gj {
class Frame : public iDrawable, public iWritable {
public:
Frame() = delete;
Frame(Frame&&) = delete;
Frame(const Frame&) = delete;
Frame& operator=(Frame&&) = delete;
Frame& operator=(const Frame&) = delete;
Frame(size_t dres, size_t wres) {
draw_.reserve(dres);
write_.reserve(wres);
}
void Clear() {
draw_.clear();
write_.clear();
}
void Add(const iDrawable* d) {
draw_.push_back(d);
}
void Add(const iWritable* w) {
write_.push_back(w);
}
void Draw(Colorbuffer& fb) const override {
for (auto d : draw_) {
d->Draw(fb);
}
}
void Write(Textbuffer& fb) const override {
for (auto w : write_) {
w->Write(fb);
}
}
private:
std::vector<const iDrawable*> draw_;
std::vector<const iWritable*> write_;
};
}