summaryrefslogtreecommitdiff
path: root/src/first_app.cpp
diff options
context:
space:
mode:
Diffstat (limited to '')
-rwxr-xr-xsrc/first_app.cpp32
1 files changed, 9 insertions, 23 deletions
diff --git a/src/first_app.cpp b/src/first_app.cpp
index 968f7f8..08f6f0c 100755
--- a/src/first_app.cpp
+++ b/src/first_app.cpp
@@ -11,7 +11,15 @@ void FirstApp::run() {
Chunk::load();
- loadGameObjects();
+ for(int32_t x = 0; x < 10; x++) {
+ for(int32_t z = 0; z < 10; z++) {
+ Chunk* chunk = Chunk::newChunk(x, z, 53463);
+ Chunk::createMeshAsync(chunk);
+ auto chunkObject = xe::GameObject::createGameObject();
+ chunkObject.transform.translation = {16.f*x, 0.f, 16.f*z};
+ gameObjects.push_back(std::move(chunkObject));
+ }
+ }
SimpleRenderer renderer{xeEngine, Chunk::getTextures()};
@@ -44,26 +52,4 @@ void FirstApp::run() {
}
-void FirstApp::loadGameObjects() {
-
- for(int32_t x = 0; x < 10; x++) {
- for(int32_t z = 0; z < 10; z++) {
- Chunk* chunk = Chunk::newChunk(x, z, 53463);
- }
- }
-
- for(int32_t x = 0; x < 10; x++) {
- for(int32_t z = 0; z < 10; z++) {
- Chunk* chunk = Chunk::getChunk(x,z);
- chunk->createMesh();
-
- auto chunkObject = xe::GameObject::createGameObject();
- chunkObject.model = chunk->getMesh();
- chunkObject.transform.translation = {16.f*x, 0.f, 16.f*z};
- gameObjects.push_back(std::move(chunkObject));
- }
- }
-
-}
-
} \ No newline at end of file