Chunks render moved to ChunksLoader

This commit is contained in:
MihailRis
2022-06-29 19:30:23 +03:00
committed by GitHub
parent 15bed4169e
commit f569378b88
12 changed files with 127 additions and 43 deletions
+6 -4
View File
@@ -81,10 +81,12 @@ void update_level(World* world, Level* level, vec3 position, float delta, long f
update_controls(level->physics, level->chunks, level->player, delta);
update_interaction(level, lineBatch);
level->chunks->setCenter(world->wfile, position.x,0,position.z);
level->chunksController->_buildMeshes(renderer, frame);
level->chunks->setCenter(world->wfile, position.x, 0, position.z);
int freeLoaders = level->chunksController->countFreeLoaders();
for (int i = 0; i < freeLoaders; i++)
level->chunksController->_buildMeshes(renderer, frame);
freeLoaders = level->chunksController->countFreeLoaders();
for (int i = 0; i < freeLoaders; i++)
level->chunksController->loadVisible(world->wfile);
}
@@ -140,7 +142,7 @@ int main() {
bool occlusion = false;
bool devdata = false;
glfwSwapInterval(0);
Window::swapInterval(0);
std::cout << "-- initializing finished" << std::endl;
while (!Window::isShouldClose()){