-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtypes.cppm
More file actions
45 lines (37 loc) · 1.08 KB
/
types.cppm
File metadata and controls
45 lines (37 loc) · 1.08 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
// This project is licensed under the GPL-3.0 License. See the LICENSE file for details, or check out <gnu.org>.
// Copyright (C) 2026 mxreal64
module;
#include <SDL3/SDL.h>
export module delta.types;
import std;
export inline constexpr int WINDOW_WIDTH = 1920;
export inline constexpr int WINDOW_HEIGHT = 1080;
export inline constexpr float MARGIN_X = 100.0f;
export inline constexpr float MARGIN_Y = 80.0f;
export inline constexpr float LINE_SPACING = 36.0f;
export inline constexpr int TARGET_FPS = 60;
export inline constexpr int FRAME_DELAY = 1000 / TARGET_FPS;
export enum class DeltaError : uint8_t {
FontLoadFailure,
RendererNullPointer,
WindowCreationFailed
};
export struct style_state {
bool bold = false;
bool italic = false;
};
export struct selection_span {
size_t start = 0;
size_t end = 0;
bool active_drag = false;
};
// THE NEW LAYOUT SOURCE OF TRUTH
export struct LayoutChar {
char character;
size_t raw_buffer_index;
style_state style;
};
export struct LayoutLine {
std::vector<LayoutChar> chars;
bool is_hard_newline = false;
};