diff options
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}); |
