Finished writeup and fixed crashes

This commit is contained in:
Dynamitos
2021-10-19 23:04:38 +02:00
parent a0693daa67
commit 451572f254
36 changed files with 295 additions and 375 deletions
-2
View File
@@ -1,7 +1,5 @@
target_sources(SeeleEngine
PRIVATE
Frame.h
Frame.cpp
InspectorView.h
InspectorView.cpp
SceneView.h
View File
-18
View File
@@ -1,18 +0,0 @@
#pragma once
#include "View.h"
namespace Seele
{
// A frame is the mutable data needed to
// process a time step for the game updates
// It contains all the game update relevant data
// and is handed over to the renderer for read only processing
// If the game loop runs faster than the renderer, the renderer
// simply discards old Frames and starts working on the more recent ones
// if the game loop runs slower than the renderer (bad), the renderer has to wait
struct Frame
{
uint64 frameNumber;
Array<PViewFrame> viewFrame;
};
} // namespace Seele
+4 -8
View File
@@ -25,10 +25,10 @@ void Window::render()
gfxHandle->beginFrame();
for(auto& windowView : views)
{
{
std::lock_guard lock(windowView->workerMutex);
windowView->view->prepareRender();
}
windowView->view->beginUpdate();
windowView->view->update();
windowView->view->commitUpdate();
windowView->view->prepareRender();
windowView->view->render();
}
gfxHandle->endFrame();
@@ -58,9 +58,5 @@ void Window::viewWorker(WindowView* windowView)
{
while(true)
{
windowView->view->beginUpdate();
windowView->view->update();
std::lock_guard lock(windowView->workerMutex);
windowView->view->commitUpdate();
}
}