epic: refactor SDL2_Renderer usage to IRenderer and queued texture rendering

- Updated the testing guide to clarify the testing framework's organization and execution methods, improving user understanding.
- Refactored CMakeLists to include new platform-specific files, ensuring proper integration of the rendering backend.
- Modified main application files to utilize the new IRenderer interface, enhancing flexibility in rendering operations.
- Implemented deferred texture management in various components, allowing for more efficient graphics handling and improved performance.
- Introduced new methods for texture creation and updates, streamlining the rendering process across the application.
- Enhanced logging and error handling in the rendering pipeline to facilitate better debugging and diagnostics.
This commit is contained in:
scawful
2025-10-07 17:15:11 -04:00
parent 9e6f538520
commit 6c331f1fd0
101 changed files with 1401 additions and 2677 deletions

View File

@@ -28,6 +28,12 @@ static inline ImGuiInputTextFlags InputScalar_DefaultCharsFilter(
? ImGuiInputTextFlags_CharsHexadecimal
: ImGuiInputTextFlags_CharsDecimal;
}
// Helper: returns true if label is "invisible" (starts with "##")
static inline bool IsInvisibleLabel(const char* label) {
return label && label[0] == '#' && label[1] == '#';
}
bool InputScalarLeft(const char* label, ImGuiDataType data_type, void* p_data,
const void* p_step, const void* p_step_fast,
const char* format, float input_width,
@@ -52,22 +58,24 @@ bool InputScalarLeft(const char* label, ImGuiDataType data_type, void* p_data,
flags |= ImGuiInputTextFlags_AutoSelectAll;
bool value_changed = false;
// if (p_step == NULL) {
// ImGui::SetNextItemWidth(input_width);
// if (InputText("", buf, IM_ARRAYSIZE(buf), flags))
// value_changed = DataTypeApplyFromText(buf, data_type, p_data, format);
// } else {
const float button_size = GetFrameHeight();
AlignTextToFramePadding();
Text("%s", label);
SameLine();
// Support invisible labels (##) by not rendering the label, but still using it for ID
bool invisible_label = IsInvisibleLabel(label);
if (!invisible_label) {
AlignTextToFramePadding();
Text("%s", label);
SameLine();
}
BeginGroup(); // The only purpose of the group here is to allow the caller
// to query item data e.g. IsItemActive()
PushID(label);
SetNextItemWidth(ImMax(
1.0f, CalcItemWidth() - (button_size + style.ItemInnerSpacing.x) * 2));
// Place the label on the left of the input field
// Place the label on the left of the input field, unless invisible
PushStyleVar(ImGuiStyleVar_ItemSpacing,
ImVec2{style.ItemSpacing.x, style.ItemSpacing.y});
PushStyleVar(ImGuiStyleVar_FramePadding,