FuncDoodle
Loading...
Searching...
No Matches
Constants.h
Go to the documentation of this file.
1#pragma once
2
3#include <array>
4#include <cstdint>
5#include <imgui.h>
6#include <string_view>
7
19
20namespace FuncDoodle {
24 constexpr const char* g_SupportedExtensionsForImporting =
25 "png,jpg,jpeg,bmp,tga,psd,gif,hdr,pic,ppm,pgm,pnm";
26
30 constexpr uint8_t g_MaxColorValue = 255;
31
35 constexpr uint8_t g_ColorWhite = 255;
36
40 constexpr uint8_t g_AlphaOpaque = 255;
41
45 constexpr uint8_t g_ColorGrayRgb = 150;
46
50 constexpr int g_BufferChunkSize = 32;
51
55 constexpr int g_DefaultCanvasWidth = 32;
56
60 constexpr int g_DefaultCanvasHeight = 32;
61
65 constexpr int g_ToolbarHeight = 32;
66
70 constexpr int g_DefaultWindowWidth = 1920;
71
75 constexpr int g_DefaultWindowHeight = 1080;
76
80 constexpr int g_MenuNameBufferSize = 32;
81
85 constexpr int g_FilePathBufferSize = 512;
86
90 constexpr int g_LargeBufferSize = 1024;
91
95 constexpr int g_KeybindBufferSize = 1024;
96
100 constexpr int g_KeyNameBufferSize = 256;
101
105 constexpr float g_MaxRotationDeg = 360.0f;
106
110 constexpr int g_HalfAlpha = 128;
111
115 constexpr int g_DashColorPrimary = 150;
116
120 constexpr int g_DashColorSecondary = 255;
121
125 constexpr int g_UuidRandomRange = 255;
126
130 constexpr double g_MinDeltaTime = 1.0 / 1000.0;
131
135 constexpr double g_MaxDeltaTime = 1.0;
136
140 constexpr float g_DefaultFps = 60.0f;
141
145 constexpr float g_FrameTimeDivisor = 1000.0f;
146
147#ifdef DEBUG
148 inline constexpr bool c_Debug = true;
149#else
150 inline constexpr bool c_Debug = false;
151#endif
152
157 consteval const char* FuncVer() {
158 if constexpr (c_Debug) {
159 return "0.1.2-dev";
160 } else {
161 return "0.1.2";
162 }
163 }
164
170 static constexpr const char* c_FuncVer = FuncVer();
171
177 static constexpr uint8_t c_FdpVerMajor = 0;
178
184 static constexpr uint8_t c_FdpVerMinor = 5;
185
191 static constexpr std::array<ImGuiKey, 92> c_Qwerty = {
192 ImGuiKey_Escape,
193 ImGuiKey_F1,
194 ImGuiKey_F2,
195 ImGuiKey_F3,
196 ImGuiKey_F4,
197 ImGuiKey_F5,
198 ImGuiKey_F6,
199 ImGuiKey_F7,
200 ImGuiKey_F8,
201 ImGuiKey_F9,
202 ImGuiKey_F10,
203 ImGuiKey_F11,
204 ImGuiKey_F12,
205 ImGuiKey_End,
206 ImGuiKey_F13,
207 ImGuiKey_F14,
208 ImGuiKey_F15,
209 ImGuiKey_F16,
210 ImGuiKey_F17,
211 ImGuiKey_F18,
212 ImGuiKey_F19,
213 ImGuiKey_F20,
214 ImGuiKey_F21,
215 ImGuiKey_F22,
216 ImGuiKey_F23,
217 ImGuiKey_F24,
218 ImGuiKey_End,
219 ImGuiKey_GraveAccent,
220 ImGuiKey_1,
221 ImGuiKey_2,
222 ImGuiKey_3,
223 ImGuiKey_4,
224 ImGuiKey_5,
225 ImGuiKey_6,
226 ImGuiKey_7,
227 ImGuiKey_8,
228 ImGuiKey_9,
229 ImGuiKey_0,
230 ImGuiKey_Minus,
231 ImGuiKey_Equal,
232 ImGuiKey_Backspace,
233 ImGuiKey_End,
234 ImGuiKey_Tab,
235 ImGuiKey_Q,
236 ImGuiKey_W,
237 ImGuiKey_E,
238 ImGuiKey_R,
239 ImGuiKey_T,
240 ImGuiKey_Y,
241 ImGuiKey_U,
242 ImGuiKey_I,
243 ImGuiKey_O,
244 ImGuiKey_P,
245 ImGuiKey_LeftBracket,
246 ImGuiKey_RightBracket,
247 ImGuiKey_Backslash,
248 ImGuiKey_End,
249 ImGuiKey_CapsLock,
250 ImGuiKey_A,
251 ImGuiKey_S,
252 ImGuiKey_D,
253 ImGuiKey_F,
254 ImGuiKey_G,
255 ImGuiKey_H,
256 ImGuiKey_J,
257 ImGuiKey_K,
258 ImGuiKey_L,
259 ImGuiKey_Semicolon,
260 ImGuiKey_Apostrophe,
261 ImGuiKey_Enter,
262 ImGuiKey_End,
263 ImGuiKey_LeftShift,
264 ImGuiKey_Z,
265 ImGuiKey_X,
266 ImGuiKey_C,
267 ImGuiKey_V,
268 ImGuiKey_B,
269 ImGuiKey_N,
270 ImGuiKey_M,
271 ImGuiKey_Comma,
272 ImGuiKey_Period,
273 ImGuiKey_Slash,
274 ImGuiKey_RightShift,
275 ImGuiKey_End,
276 ImGuiKey_LeftCtrl,
277 ImGuiKey_LeftSuper,
278 ImGuiKey_LeftAlt,
279 ImGuiKey_Space,
280 ImGuiKey_RightAlt,
281 ImGuiKey_RightSuper,
282 ImGuiKey_Menu,
283 ImGuiKey_RightCtrl,
284 };
285
286 constexpr std::array<std::string_view, 2> g_ExportFormats = {"PNGs", "MP4"};
287
288 enum class ExportFormat : int {
290 MP4 = 1
291 };
292
293} // namespace FuncDoodle
The FuncDoodle C++ namespace.
Definition Common.h:12
consteval const char * FuncVer()
Definition Constants.h:157
static constexpr uint8_t c_FdpVerMinor
FuncDoodle project file format minor version.
Definition Constants.h:184
constexpr int g_DefaultCanvasHeight
Default canvas height in pixels.
Definition Constants.h:60
constexpr uint8_t g_MaxColorValue
Maximum value for an 8-bit color channel.
Definition Constants.h:30
constexpr int g_UuidRandomRange
Maximum range used for UUID random generation byte selection.
Definition Constants.h:125
constexpr uint8_t g_AlphaOpaque
Fully opaque alpha value.
Definition Constants.h:40
constexpr bool c_Debug
Definition Constants.h:148
constexpr int g_KeyNameBufferSize
Buffer size for storing key name strings.
Definition Constants.h:100
constexpr int g_DashColorPrimary
Primary dash color intensity (used in UI/grid rendering).
Definition Constants.h:115
constexpr uint8_t g_ColorGrayRgb
Default gray color value in RGB space.
Definition Constants.h:45
ExportFormat
Definition Constants.h:288
@ PNGSequence
Definition Constants.h:289
@ MP4
Definition Constants.h:290
constexpr int g_MenuNameBufferSize
Maximum buffer size for menu name strings.
Definition Constants.h:80
constexpr float g_DefaultFps
Default target FPS for timing calculations.
Definition Constants.h:140
constexpr int g_LargeBufferSize
Large general-purpose buffer size for temporary storage.
Definition Constants.h:90
constexpr int g_KeybindBufferSize
Buffer size for keybind serialization/deserialization.
Definition Constants.h:95
static constexpr const char * c_FuncVer
The FuncDoodle version string.
Definition Constants.h:170
constexpr float g_FrameTimeDivisor
Divisor used when converting milliseconds to frame time.
Definition Constants.h:145
constexpr int g_DefaultCanvasWidth
Default canvas width in pixels.
Definition Constants.h:55
constexpr int g_BufferChunkSize
Size of an internal buffer chunk (used for batching/processing).
Definition Constants.h:50
constexpr double g_MinDeltaTime
Minimum allowed delta time between frames (seconds).
Definition Constants.h:130
static constexpr std::array< ImGuiKey, 92 > c_Qwerty
QWERTY keyboard layout.
Definition Constants.h:191
static constexpr uint8_t c_FdpVerMajor
FuncDoodle project file format major version.
Definition Constants.h:177
constexpr double g_MaxDeltaTime
Maximum allowed delta time between frames (seconds).
Definition Constants.h:135
constexpr int g_DefaultWindowWidth
Default application window width in pixels.
Definition Constants.h:70
constexpr int g_HalfAlpha
Half alpha value (semi-transparent).
Definition Constants.h:110
constexpr int g_DashColorSecondary
Secondary dash color intensity (used in UI/grid rendering).
Definition Constants.h:120
constexpr float g_MaxRotationDeg
Maximum rotation angle in degrees.
Definition Constants.h:105
constexpr uint8_t g_ColorWhite
Fully white RGB channel value.
Definition Constants.h:35
constexpr std::array< std::string_view, 2 > g_ExportFormats
Definition Constants.h:286
constexpr int g_DefaultWindowHeight
Default application window height in pixels.
Definition Constants.h:75
constexpr const char * g_SupportedExtensionsForImporting
Supported file extensions for importing/exporting images.
Definition Constants.h:24
constexpr int g_FilePathBufferSize
Maximum buffer size for file path strings.
Definition Constants.h:85
constexpr int g_ToolbarHeight
Height of the application toolbar in pixels.
Definition Constants.h:65