diff options
| author | hachem <im@hachem.wtf> | 2026-08-20 02:05:45 +0200 |
|---|---|---|
| committer | hachem <im@hachem.wtf> | 2026-08-20 02:18:50 +0200 |
| commit | 0802ee19573e880e319a61ae814ee42c01e28cd3 (patch) | |
| tree | 76d279402ea8ff3d209296192f6ac0d572798c9d /src/engine/engine.h | |
| parent | 7d39ee93a6d354e727c7534a18663f1d00d46b0f (diff) | |
refactor: trailing return types in engine and states
Diffstat (limited to 'src/engine/engine.h')
| -rw-r--r-- | src/engine/engine.h | 94 |
1 files changed, 47 insertions, 47 deletions
diff --git a/src/engine/engine.h b/src/engine/engine.h index 1c25466..0451d40 100644 --- a/src/engine/engine.h +++ b/src/engine/engine.h @@ -65,30 +65,30 @@ namespace Donut Engine(); ~Engine() = default; - void draw_full_screen_quad(); - void draw_blur_pass(); - void dispatch_compute(const Camera& cam); - void upload_camera_ubo(const Camera& cam); - void upload_objects_ubo(const std::vector<ObjectData>& objs); - void upload_disk_ubo(); - void upload_simulation_ubo(); - void render_scene(); - void update_physics(float delta_time); - void update_window_dimensions(); - void set_window_dimensions(int width, int height); + auto draw_full_screen_quad() -> void; + auto draw_blur_pass() -> void; + auto dispatch_compute(const Camera& cam) -> void; + auto upload_camera_ubo(const Camera& cam) -> void; + auto upload_objects_ubo(const std::vector<ObjectData>& objs) -> void; + auto upload_disk_ubo() -> void; + auto upload_simulation_ubo() -> void; + auto render_scene() -> void; + auto update_physics(float delta_time) -> void; + auto update_window_dimensions() -> void; + auto set_window_dimensions(int width, int height) -> void; - int get_width() const { return m_width; } - int get_height() const { return m_height; } + auto get_width() const -> int { return m_width; } + auto get_height() const -> int { return m_height; } - std::vector<ObjectData>& get_objects() { return m_objects; } - BlackHole& get_sag_a() { return m_sag_a; } - Camera& get_camera() { return m_camera; } - bool& get_gravity() { return m_gravity; } + auto get_objects() -> std::vector<ObjectData>& { return m_objects; } + auto get_sag_a() -> BlackHole& { return m_sag_a; } + auto get_camera() -> Camera& { return m_camera; } + auto get_gravity() -> bool& { return m_gravity; } - void update_performance(float delta_time); - void set_target_fps(int fps) { m_target_fps = fps; } - int get_target_fps() const { return m_target_fps; } - float get_current_fps() const { return m_current_fps; } + auto update_performance(float delta_time) -> void; + auto set_target_fps(int fps) -> void { m_target_fps = fps; } + auto get_target_fps() const -> int { return m_target_fps; } + auto get_current_fps() const -> float { return m_current_fps; } void set_compute_height(int height) { #ifdef __APPLE__ @@ -96,43 +96,43 @@ namespace Donut #endif m_compute_height = height; } - int get_compute_height() const { return m_compute_height; } - int get_compute_width() const { return (m_width * m_compute_height) / m_height; } - void update_compute_dimensions(); + auto get_compute_height() const -> int { return m_compute_height; } + auto get_compute_width() const -> int { return (m_width * m_compute_height) / m_height; } + auto update_compute_dimensions() -> void; - int get_max_steps_moving() const { return m_max_steps_moving; } - int get_max_steps_static() const { return m_max_steps_static; } - float get_early_exit_distance() const { return m_early_exit_distance; } - void set_max_steps_moving(int steps) { m_max_steps_moving = steps; } - void set_max_steps_static(int steps) { m_max_steps_static = steps; } - void set_early_exit_distance(float distance) { m_early_exit_distance = distance; } + auto get_max_steps_moving() const -> int { return m_max_steps_moving; } + auto get_max_steps_static() const -> int { return m_max_steps_static; } + auto get_early_exit_distance() const -> float { return m_early_exit_distance; } + auto set_max_steps_moving(int steps) -> void { m_max_steps_moving = steps; } + auto set_max_steps_static(int steps) -> void { m_max_steps_static = steps; } + auto set_early_exit_distance(float distance) -> void { m_early_exit_distance = distance; } - float get_disk_thickness() const { return m_disk_thickness; } - void set_disk_thickness(float thickness) { m_disk_thickness = thickness; } + auto get_disk_thickness() const -> float { return m_disk_thickness; } + auto set_disk_thickness(float thickness) -> void { m_disk_thickness = thickness; } - float get_disk_density() const { return m_disk_density; } - void set_disk_density(float density) { m_disk_density = density; } + auto get_disk_density() const -> float { return m_disk_density; } + auto set_disk_density(float density) -> void { m_disk_density = density; } - float get_rotation_speed() const { return m_rotation_speed; } - void set_rotation_speed(float speed) { m_rotation_speed = speed; } + auto get_rotation_speed() const -> float { return m_rotation_speed; } + auto set_rotation_speed(float speed) -> void { m_rotation_speed = speed; } - float get_blur_strength() const { return m_blur_strength; } - void set_blur_strength(float strength) { m_blur_strength = strength; } + auto get_blur_strength() const -> float { return m_blur_strength; } + auto set_blur_strength(float strength) -> void { m_blur_strength = strength; } - float get_glow_intensity() const { return m_glow_intensity; } - void set_glow_intensity(float intensity) { m_glow_intensity = intensity; } + auto get_glow_intensity() const -> float { return m_glow_intensity; } + auto set_glow_intensity(float intensity) -> void { m_glow_intensity = intensity; } - void load_objects_from_scene(const std::vector<Donut::Object>& objects); - void export_high_res_frame(const std::string& filename, int width = 4096, int height = 3072); - void print_object_info() const; + auto load_objects_from_scene(const std::vector<Donut::Object>& objects) -> void; + auto export_high_res_frame(const std::string& filename, int width = 4096, int height = 3072) -> void; + auto print_object_info() const -> void; - void set_hdri_environment(Ref<CubemapTexture> hdri) { m_hdri_environment = hdri; } - Ref<CubemapTexture> get_hdri_environment() const { return m_hdri_environment; } + auto set_hdri_environment(Ref<CubemapTexture> hdri) -> void { m_hdri_environment = hdri; } + auto get_hdri_environment() const -> Ref<CubemapTexture> { return m_hdri_environment; } private: - Ref<Shader> create_compute_program(const char* path); + auto create_compute_program(const char* path) -> Ref<Shader>; std::pair<Ref<VertexArray>, Ref<Texture2D>> quad_vao(); - void draw_geodesic_pass(int cw, int ch); + auto draw_geodesic_pass(int cw, int ch) -> void; private: Ref<VertexArray> m_quad_vao; Ref<Texture2D> m_texture; |
