More threadpool bs

This commit is contained in:
Dynamitos
2021-12-02 13:00:03 +01:00
parent 5fafdda770
commit 9e3a2446ce
37 changed files with 488 additions and 541 deletions
+6 -5
View File
@@ -13,18 +13,19 @@ public:
virtual ~View();
// These are called from the view thread, and handle updating game data
virtual void beginUpdate() {}
virtual void update() {}
virtual void beginUpdate() = 0;
virtual void update() = 0;
// End frame is called with a lock, so it is safe to write to shared memory
virtual void commitUpdate() {}
virtual void commitUpdate() = 0;
// These are called from the render thread
// prepare render is also locked, so reading from shared memory is also safe
virtual void prepareRender() {}
virtual Job render() { co_return; }
virtual void prepareRender() = 0;
virtual MainJob render() = 0;
void applyArea(URect area);
void setFocused();
Event renderFinished() { return renderFinishedEvent; }
void resetRender() { renderFinishedEvent.reset(); }
protected:
Gfx::PGraphics graphics;