FuncDoodle
Loading...
Searching...
No Matches
FrameRenderer.h
Go to the documentation of this file.
1
16
17#pragma once
18
19#include "Core/AppSettings.h"
20#include "Project/Frame.h"
21
22#include "Tool/ToolManager.h"
23
24#include "Core/Player.h"
25
26#include "Util/Ptr.h"
27
29#include "UI/Gui.h"
30
31namespace FuncDoodle {
43 public:
55 FrameRenderer(Frame* frame, unsigned long index, ToolManager* manager,
56 AnimationPlayer* player,
57 const SharedPtr<EditorController>& editorController,
58 AppSettings& settings)
59 : m_Ctx(settings) {
60 m_Ctx.Frame = frame;
61 m_Ctx.PreviousFrame = nullptr;
62 m_Ctx.Index = index;
63 m_Ctx.ToolManager = manager;
64 m_Ctx.Player = player;
65 m_Ctx.Grid = nullptr;
66 m_Ctx.LastMousePos = ImVec2{-1, -1};
67 m_Ctx.LastHoverMousePos = ImVec2{-1, -1};
68
69 m_EditorController = editorController;
70 }
71
75 void RenderFrame();
80 void RenderStatusBar() const;
85 void InitPixels();
86
101 void SetUndoByStroke(bool undoByStroke) {
102 if (m_EditorController) {
103 m_EditorController->SetUndoByStroke(undoByStroke, m_Ctx.Player);
104 }
105 }
106
116 void RenderFramePixels(int startX, int startY, ImDrawList* drawList,
117 bool usePrevPxScale = true, bool renderPreview = true) const;
118
119 private:
122 // ImVec2 m_LastHoverMousePos = ImVec2(-1, -1);
123 };
124} // namespace FuncDoodle
Runtime configuration and user-adjustable application settings.
Core editor logic handling canvas interaction, painting tools, and stroke management.
ImGui/OpenGL/GLFW integration utilities and file dialog wrapper.
Defines AnimationPlayer, responsible for animation playback control.
Defines pixel color structures and frame/image data containers.
Convenience type aliases for standard smart pointers.
std::shared_ptr< T > SharedPtr
Alias for a reference-counted shared smart pointer.
Definition Ptr.h:31
Manages tools, tool state, and tool-related UI in FuncDoodle.
Responsible for playing a users' animation.
Definition Player.h:39
EditorController::CanvasContext m_Ctx
Definition FrameRenderer.h:120
SharedPtr< EditorController > m_EditorController
Definition FrameRenderer.h:121
EditorController::CanvasContext * GetCtx()
Returns the mutable canvas context used by this renderer.
Definition FrameRenderer.h:93
void InitPixels()
Initializes pixel-related state before rendering.
Definition FrameRenderer.cc:92
void RenderFrame()
Renders the complete frame view.
Definition FrameRenderer.cc:24
void RenderStatusBar() const
Renders status information associated with the frame view.
Definition FrameRenderer.cc:75
void SetUndoByStroke(bool undoByStroke)
Forwards undo-by-stroke preference to the editor controller.
Definition FrameRenderer.h:101
void RenderFramePixels(int startX, int startY, ImDrawList *drawList, bool usePrevPxScale=true, bool renderPreview=true) const
Draws frame pixels into a draw list.
Definition FrameRenderer.cc:100
FrameRenderer(Frame *frame, unsigned long index, ToolManager *manager, AnimationPlayer *player, const SharedPtr< EditorController > &editorController, AppSettings &settings)
Creates a renderer for a single frame view.
Definition FrameRenderer.h:55
Wraps an ImageArray with higher-level frame editing operations.
Definition Frame.h:248
Manages tools in FuncDoodle.
Definition ToolManager.h:45
The FuncDoodle C++ namespace.
Definition Common.h:12
Represents the application's current settings and loaded from imgui.ini.
Definition AppSettings.h:22
Bundles per-frame canvas state used during rendering and input handling.
Definition EditorController.h:61