diff options
author | Julian T <julian@jtle.dk> | 2020-08-14 20:30:07 +0200 |
---|---|---|
committer | Julian T <julian@jtle.dk> | 2020-09-16 21:05:58 +0200 |
commit | 9b34ab6db773568011dc85fd73156b63da377e01 (patch) | |
tree | 2511b89ecdf948826e51d342610635b7e8dfbf33 /app/rendercoord.hpp | |
parent | 5ca04e5b2ec8eef88df6cbd4e3d09ac7dab55c0d (diff) |
Better configuration
Diffstat (limited to 'app/rendercoord.hpp')
-rw-r--r-- | app/rendercoord.hpp | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/app/rendercoord.hpp b/app/rendercoord.hpp index a749f8a..eea1b40 100644 --- a/app/rendercoord.hpp +++ b/app/rendercoord.hpp @@ -2,6 +2,7 @@ #define RENDER_THREAD_H #include "draw.hpp" +#include "config.hpp" #include <atomic> #include <qlabel.h> #include <render.hpp> @@ -17,7 +18,7 @@ class RenderThread : public QThread { Q_OBJECT public: - RenderThread(Renderer r, unsigned threads, QObject *parent = nullptr, unsigned id = 0); + RenderThread(Renderer r, unsigned threads, const Config &cfg, QObject *parent = nullptr, unsigned id = 0); // Returns 0 if successful or 1 if busy int render(QRgb *buffer, unsigned samples); @@ -46,6 +47,8 @@ class RenderThread : public QThread { unsigned m_workers; + Config const m_conf; + // Value in here means work is to be done QSemaphore m_work; QSemaphore m_pause; @@ -59,7 +62,7 @@ class RenderCoordinator : public QObject { Q_OBJECT public: - RenderCoordinator(QObject *parent, DrawWidget &target, Renderer r, QLabel *status=nullptr); + RenderCoordinator(QObject *parent, DrawWidget &target, Renderer r, const Config &conf, QLabel *status=nullptr); void setSamples(unsigned samples); void render(); @@ -84,7 +87,7 @@ class RenderCoordinator : public QObject { State m_state; - unsigned m_samples; + const Config &m_conf; }; #endif |