diff options
Diffstat (limited to 'src/engine/engine.cpp')
| -rw-r--r-- | src/engine/engine.cpp | 38 |
1 files changed, 19 insertions, 19 deletions
diff --git a/src/engine/engine.cpp b/src/engine/engine.cpp index d6e2723..87eda62 100644 --- a/src/engine/engine.cpp +++ b/src/engine/engine.cpp @@ -79,12 +79,12 @@ namespace Donut glGenFramebuffers(1, &m_geodesic_fbo); } - void Engine::update_window_dimensions() + auto Engine::update_window_dimensions() -> void { update_compute_dimensions(); } - void Engine::set_window_dimensions(int width, int height) + auto Engine::set_window_dimensions(int width, int height) -> void { int old_width = m_width; int old_height = m_height; @@ -99,18 +99,18 @@ namespace Donut update_compute_dimensions(); } - void Engine::update_performance(float delta_time) + auto Engine::update_performance(float delta_time) -> void { if (delta_time > 0.0f) m_current_fps = 1.0f / delta_time; } - void Engine::update_compute_dimensions() + auto Engine::update_compute_dimensions() -> void { m_texture = Texture2D::create(get_compute_width(), m_compute_height); } - void Engine::draw_full_screen_quad() + auto Engine::draw_full_screen_quad() -> void { RenderCommand::set_viewport(0, 0, m_width, m_height); @@ -125,7 +125,7 @@ namespace Donut RenderCommand::enable_depth_test(); } - void Engine::draw_blur_pass() + auto Engine::draw_blur_pass() -> void { RenderCommand::set_viewport(0, 0, m_width, m_height); @@ -143,7 +143,7 @@ namespace Donut RenderCommand::enable_depth_test(); } - void Engine::draw_geodesic_pass(int cw, int ch) + auto Engine::draw_geodesic_pass(int cw, int ch) -> void { m_quad_vao->bind(); RenderCommand::disable_depth_test(); @@ -170,7 +170,7 @@ namespace Donut RenderCommand::enable_depth_test(); } - void Engine::dispatch_compute(const Camera& cam) + auto Engine::dispatch_compute(const Camera& cam) -> void { auto& hdri_manager = HDRIManager::get(); m_hdri_environment = hdri_manager.get_current_hdri(); @@ -200,7 +200,7 @@ namespace Donut glBindFramebuffer(GL_FRAMEBUFFER, 0); } - void Engine::upload_camera_ubo(const Camera& cam) + auto Engine::upload_camera_ubo(const Camera& cam) -> void { struct UBOData { @@ -231,7 +231,7 @@ namespace Donut m_camera_ubo->bind(1); } - void Engine::upload_objects_ubo(const std::vector<ObjectData>& objs) + auto Engine::upload_objects_ubo(const std::vector<ObjectData>& objs) -> void { struct UBOData { @@ -256,7 +256,7 @@ namespace Donut m_objects_ubo->bind(3); } - void Engine::upload_disk_ubo() + auto Engine::upload_disk_ubo() -> void { float r1 = static_cast<float>(m_sag_a.m_rs * 2.2); float r2 = static_cast<float>(m_sag_a.m_rs * 5.2); @@ -268,7 +268,7 @@ namespace Donut m_disk_ubo->bind(2); } - void Engine::upload_simulation_ubo() + auto Engine::upload_simulation_ubo() -> void { struct UBOData { @@ -292,7 +292,7 @@ namespace Donut m_simulation_ubo->bind(4); } - void Engine::update_physics(float delta_time) + auto Engine::update_physics(float delta_time) -> void { for (auto& obj : m_objects) { @@ -325,7 +325,7 @@ namespace Donut } } - void Engine::render_scene() + auto Engine::render_scene() -> void { RenderCommand::clear(); m_shader_program->bind(); @@ -334,7 +334,7 @@ namespace Donut RenderCommand::draw_arrays(6); } - Ref<Shader> Engine::create_compute_program(const char* path) + auto Engine::create_compute_program(const char* path) -> Ref<Shader> { std::ifstream in(path); if(!in.is_open()) @@ -348,7 +348,7 @@ namespace Donut return Ref<Shader>(Shader::create_compute("ComputeShader", src_str)); } - std::pair<Ref<VertexArray>, Ref<Texture2D>> Engine::quad_vao() + auto Engine::quad_vao() -> std::pair<Ref<VertexArray>, Ref<Texture2D>> { float quad_vertices[] = { @@ -373,7 +373,7 @@ namespace Donut return { vertex_array, texture }; } - void Engine::load_objects_from_scene(const std::vector<Donut::Object>& objects) + auto Engine::load_objects_from_scene(const std::vector<Donut::Object>& objects) -> void { m_objects.clear(); m_objects.push_back( @@ -410,7 +410,7 @@ namespace Donut print_object_info(); } - void Engine::print_object_info() const + auto Engine::print_object_info() const -> void { DONUT_INFO("=== Object Information ==="); DONUT_INFO("Total objects: {}", m_objects.size()); @@ -435,7 +435,7 @@ namespace Donut DONUT_INFO("========================"); } - void Engine::export_high_res_frame(const std::string& filename, int width, int height) + auto Engine::export_high_res_frame(const std::string& filename, int width, int height) -> void { DONUT_INFO("Exporting high-resolution frame: {}x{} to {}", width, height, filename); |
