diff options
| author | hachem <im@hachem.wtf> | 2026-08-24 18:28:39 +0200 |
|---|---|---|
| committer | hachem <im@hachem.wtf> | 2026-08-24 18:28:39 +0200 |
| commit | a34c49f103c8950a57687ea3d866c244d95b4414 (patch) | |
| tree | ff268f4a7f52769a252443d6f2822c9814e3bb1c /src/core | |
| parent | 06398a7a176e123506de6e8851866a8bec0b3427 (diff) | |
[docs]: added a few comments cause i wont be able to read this in a week's time
Diffstat (limited to 'src/core')
| -rw-r--r-- | src/core/application.cpp | 16 | ||||
| -rw-r--r-- | src/core/application.h | 10 | ||||
| -rw-r--r-- | src/core/window.cpp | 10 |
3 files changed, 18 insertions, 18 deletions
diff --git a/src/core/application.cpp b/src/core/application.cpp index c24e029..5a3a21b 100644 --- a/src/core/application.cpp +++ b/src/core/application.cpp @@ -17,7 +17,7 @@ namespace Donut { Application* Application::s_instance = nullptr; - // Scroll is delivered through a GLFW callback; accumulate it here and drain it + // scroll is delivered through a GLFW callback; accumulate it here and drain it // once per frame in update_input (chaining ImGui's own scroll handler). static double g_scroll_accum = 0.0; static GLFWscrollfun g_prev_scroll = nullptr; @@ -31,7 +31,7 @@ namespace Donut { s_instance = this; - // Select the render API before the window is created: the window is built + // select the render API before the window is created: the window is built // differently for Vulkan (GLFW_NO_API) than for OpenGL. Logger::init(); SettingsManager::initialize(); @@ -79,7 +79,7 @@ namespace Donut m_ui = create_scope<UILayer>(); m_device->init_imgui(); - // Load the UI font into the device-created ImGui context (backend-agnostic; + // load the UI font into the device-created ImGui context (backend-agnostic; // the backend rebuilds the atlas on the next frame). ImGuiIO& io = ImGui::GetIO(); if (!io.Fonts->AddFontFromFileTTF("assets/fonts/inter/static/Inter_18pt-Regular.ttf", 16.0f)) @@ -103,7 +103,7 @@ namespace Donut if (!m_minimized && m_device) render_frame(); - // With vsync off, cap to the target FPS (vsync itself paces otherwise). + // with vsync off, cap to the target FPS (vsync itself paces otherwise). if (!SettingsManager::get_v_sync_enabled()) { int fps = SettingsManager::get_target_fps(); @@ -159,8 +159,8 @@ namespace Donut m_device->imgui_new_frame(); - // Keep the scene camera's projection current before the UI builds, so the - // scene-tab gizmo and the render agree on the same matrices this frame. + // keep the scene camera's projection current before the UI builds, so the + // scene-view gizmo and the render agree on the same matrices this frame. int w = 0, h = 0; glfwGetFramebufferSize((GLFWwindow*)m_window->get_native_window(), &w, &h); m_scene->scene_camera.set_projection(45.0f, (float)w / (float)std::max(h, 1), 0.1f, 1000.0f); @@ -188,11 +188,11 @@ namespace Donut glfwGetCursorPos(window, &mx, &my); bool left_down = glfwGetMouseButton(window, GLFW_MOUSE_BUTTON_LEFT) == GLFW_PRESS; - // Tabs without a live viewport (Setup / Export) have no camera to drive. + // a None view has no live viewport, so there's no camera to drive. if (view == View::None) { m_left_was_down = left_down; // keep the drag-edge state coherent - g_scroll_accum = 0.0; // discard scroll over inert tabs + g_scroll_accum = 0.0; // no live view: nothing to scroll m_user_moving = false; return; } diff --git a/src/core/application.h b/src/core/application.h index f1e40c8..bb88919 100644 --- a/src/core/application.h +++ b/src/core/application.h @@ -15,10 +15,10 @@ namespace Donut { - // Thin shell: owns the window, the RHI device, the Scene (document), the - // RenderPath (device-side rendering) and the UILayer (tabbed workspaces), and - // runs the frame loop that wires them together. All the rendering lives in the - // RHI + shared renderers; all the editing lives in the Scene + workspaces. + // thin shell: owns the window, the RHI device, the Scene (document), the + // RenderPath (device-side rendering) and the UILayer (docking UI), and runs + // the frame loop that wires them together. all the rendering lives in the + // RHI + shared renderers; all the editing lives in the Scene + UI panels. class Application : public AppActions { public: @@ -32,7 +32,7 @@ namespace Donut auto get_window() -> Window& { return *m_window; } static auto get() -> Application& { return *s_instance; } - // AppActions — window/device changes requested by the Setup workspace. + // AppActions — window/device changes requested by the Settings panel. auto set_resolution(int w, int h) -> void override; auto set_fullscreen(bool on) -> void override; auto set_vsync(bool on) -> void override; diff --git a/src/core/window.cpp b/src/core/window.cpp index dd5882c..085d7bc 100644 --- a/src/core/window.cpp +++ b/src/core/window.cpp @@ -39,16 +39,16 @@ namespace Donut if (RendererAPI::get_api() == RendererAPI::API::Vulkan) { - // Vulkan manages presentation itself; GLFW must not create a GL context. + // Vulkan does its own presentation, so GLFW must NOT sneak in a GL context. glfwWindowHint(GLFW_CLIENT_API, GLFW_NO_API); } else { #ifdef __APPLE__ - // macOS only exposes OpenGL up to 4.1 Core Profile, and requires a - // forward-compatible core-profile context for any modern (>= 3.3) - // shader to compile. Without these hints GLFW hands back a legacy - // 2.1 context and every GLSL shader in the project fails to build. + // macOS caps OpenGL at 4.1 Core Profile and demands a forward-compat + // core-profile context for anything modern (>= 3.3) to even compile. + // skip these hints and GLFW hands you a dusty 2.1 context and every + // single shader in the project refuses to build. so, we ask nicely: glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 4); glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 1); glfwWindowHint(GLFW_OPENGL_PROFILE, GLFW_OPENGL_CORE_PROFILE); |
