FuncDoodle
Loading...
Searching...
No Matches
ToolManager.h
Go to the documentation of this file.
1
15
16#pragma once
17
28
29#include "Project/Frame.h"
30
31#include "Asset/AssetLoader.h"
32
33#include "Keybinds/Keybinds.h"
34#include "Util/MacroUtils.h"
35
36#include "Tool/Tool.h"
37
38namespace FuncDoodle {
46 public:
60 void RegisterKeybinds();
65 void RenderTools();
70 void Buttons();
75 void Widgets();
80 void UpdateCursor();
85 void Cursor();
99 const float* GetCol() { return m_Col; }
106 void SetCol(struct Col col) {
107 unsigned char colArr[3] = {col.r, col.g, col.b};
108 for (int j = 0; j < 3; j++) {
109 m_Col[j] = static_cast<float>(colArr[j]) / 255.0f;
110 }
111 }
112
118 [[nodiscard]] int GetSize() const { return m_Size; }
125 void SetSize(int size) { m_Size = size; }
126
127 private:
129 float m_Col[3] = {0.0f, 0.0f, 0.0f};
130 int m_Size = 1;
132 };
133} // namespace FuncDoodle
Centralized asset management system for images, audio, and fonts.
Keyboard input system including key masks, shortcuts, and keybind registry.
Logging system, assertion macros, platform utilities, and build/config macros.
Defines pixel color structures and frame/image data containers.
Defines editor tools, tool utilities, and tool-related keybinding logic.
Stores and persists all keybinds used in FuncDoodle (default + user-defined).
Definition Keybinds.h:250
void UpdateCursor()
Updates cursor state to match the active tool.
Definition ToolManager.cc:110
int GetSize() const
Returns the current tool size.
Definition ToolManager.h:118
void SetSize(int size)
Sets the current tool size.
Definition ToolManager.h:125
ToolType m_SelectedTool
Definition ToolManager.h:128
float m_Col[3]
Definition ToolManager.h:129
const float * GetCol()
Returns the current tool color as normalized RGB values.
Definition ToolManager.h:99
void RegisterKeybinds()
Registers tool-selection keybinds.
Definition ToolManager.cc:50
void Widgets()
Renders tool configuration widgets.
Definition ToolManager.cc:57
int m_Size
Definition ToolManager.h:130
void Cursor()
Renders or updates the tool cursor overlay.
Definition ToolManager.cc:121
void Buttons()
Renders tool-selection buttons.
Definition ToolManager.cc:19
ToolManager(KeybindsRegistry &keybinds)
Creates a tool manager bound to the application keybind registry.
Definition ToolManager.cc:14
KeybindsRegistry & m_Keybinds
Definition ToolManager.h:131
void SetCol(struct Col col)
Sets the current tool color from an 8-bit RGB color.
Definition ToolManager.h:106
void RenderTools()
Renders the complete tool UI.
Definition ToolManager.cc:96
ToolType GetSelectedTool()
Returns the currently selected tool.
Definition ToolManager.h:92
The FuncDoodle C++ namespace.
Definition Common.h:12
ToolType
All available tools in the editor.
Definition Tool.h:35
@ Pencil
Definition Tool.h:36
A struct holding an RGB8 color.
Definition Frame.h:47
unsigned char r
Red channel in 8-bit RGB space.
Definition Frame.h:49
unsigned char g
Green channel in 8-bit RGB space.
Definition Frame.h:50
unsigned char b
Blue channel in 8-bit RGB space.
Definition Frame.h:51