refactoring

This commit is contained in:
Nick Fisher
2025-03-21 14:56:20 +08:00
parent 1177a71f73
commit 255c0edd49
38 changed files with 1521 additions and 1207 deletions

View File

@@ -17,17 +17,17 @@ namespace thermion {
* This class handles frame rendering requests, viewer creation, and maintains
* a task queue for rendering operations.
*/
class RenderLoop {
class RenderThread {
public:
/**
* @brief Constructs a new RenderLoop and starts the render thread.
* @brief Constructs a new RenderThread and starts the render thread.
*/
explicit RenderLoop();
explicit RenderThread();
/**
* @brief Destroys the RenderLoop and stops the render thread.
* @brief Destroys the RenderThread and stops the render thread.
*/
~RenderLoop();
~RenderThread();
/**
* @brief Requests a frame to be rendered.
@@ -74,7 +74,7 @@ private:
// Template implementation
template <class Rt>
auto RenderLoop::add_task(std::packaged_task<Rt()>& pt) -> std::future<Rt> {
auto RenderThread::add_task(std::packaged_task<Rt()>& pt) -> std::future<Rt> {
std::unique_lock<std::mutex> lock(_taskMutex);
auto ret = pt.get_future();
_tasks.push_back([pt = std::make_shared<std::packaged_task<Rt()>>(