diff options
| author | Mel <einebeere@gmail.com> | 2022-10-22 00:16:14 +0200 |
|---|---|---|
| committer | Mel <einebeere@gmail.com> | 2022-10-22 00:16:14 +0200 |
| commit | 7b20942c765334687fd5f58df4c0190601b97b58 (patch) | |
| tree | 771a9df76abf29b9fd43636584f01e7f6125490c /src/main.cpp | |
| parent | 20c53c7473fc6cc08944f502f078dfe57bcae1c9 (diff) | |
| download | meowcraft-7b20942c765334687fd5f58df4c0190601b97b58.tar.zst meowcraft-7b20942c765334687fd5f58df4c0190601b97b58.zip | |
Fix chunk index hash to show infinite world
Diffstat (limited to 'src/main.cpp')
| -rw-r--r-- | src/main.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/main.cpp b/src/main.cpp index 960112e..e600802 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -55,7 +55,7 @@ void run() { MC::World::World world; MC::GFX::Camera camera{}; - camera.set_position({0.0f, 0.0f, 3.0f}); + camera.set_position({0.0f, 22.0f, 0.0f}); MC::GFX::Shading::Program program( MC::GFX::Shading::Shader::create_fragment(), @@ -92,19 +92,19 @@ void run() { auto view = Math::MVP::view(camera.position(), camera.angles()); view_uniform.set(view); + glClearColor(0.85f, 0.85f, 0.85f, 1.0f); // #DBDBDB + glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); for (auto& chunk : world.get_visible_chunks(camera.position())) { auto model = Math::MVP::model(chunk.chunk->position(), {}); model_uniform.set(model); render(chunk.mesh.value(), texture); } + time++; } } void render(MC::GFX::BindableMesh& mesh, MC::GFX::Texture& texture) { - glClearColor(0.85f, 0.85f, 0.85f, 1.0f); // #DBDBDB - glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); - texture.bind(); mesh.bind(); glDrawElements(GL_TRIANGLES, mesh.size(), GL_UNSIGNED_INT, nullptr); @@ -125,7 +125,7 @@ void process_input(MC::GFX::Window& window, MC::GFX::Camera& camera) { float y = key(GLFW_KEY_SPACE) - key(GLFW_KEY_LEFT_SHIFT); float z = key(GLFW_KEY_S) - key(GLFW_KEY_W); - auto move_speed = 0.5f; + auto move_speed = 0.2f; auto rotation_speed = 0.1f; camera.move_relative({x * move_speed, y * move_speed, z * move_speed}); |
