VOXELRENDER: extract to method

master
Martin Gerhardy 2022-04-23 20:45:17 +02:00
parent 7e3013ddac
commit 86c94760a8
2 changed files with 7 additions and 2 deletions

View File

@ -130,10 +130,14 @@ void SceneGraphRenderer::prepare(voxelformat::SceneGraph &sceneGraph, uint32_t f
}
}
void SceneGraphRenderer::extractAll() {
while (_renderer.scheduleExtractions(100)) {
}
}
void SceneGraphRenderer::render(const video::Camera& camera, bool shadow, bool waitPending) {
if (waitPending) {
while (_renderer.scheduleExtractions(100)) {
}
extractAll();
_renderer.waitForPendingExtractions();
_renderer.update();
}

View File

@ -37,6 +37,7 @@ public:
bool toMesh(voxelformat::SceneGraphNode &node, voxel::Mesh* mesh);
bool empty(voxelformat::SceneGraphNode &node);
void prepare(voxelformat::SceneGraph &sceneGraph, uint32_t frame = 0, bool hideInactive = false, bool grayInactive = false);
void extractAll();
/**
* @param waitPending Wait for pending extractions and update the buffers before doing the rendering. If this is false, you have to call @c update() manually!
*/