6#include <cimgui_impl.h>
7#include <cimgui_impl_sdlgpu3.h>
10#define DTTR_IMGUI_COLOR_LINK ((ImVec4_c){0.33f, 0.63f, 1.0f, 1.0f})
11#define DTTR_IMGUI_COLOR_STACK_FRAME_BG ((ImVec4_c){0.10f, 0.11f, 0.12f, 1.0f})
12#define DTTR_IMGUI_COLOR_BUTTON_BG ((ImVec4_c){0.184f, 0.204f, 0.227f, 1.0f})
13#define DTTR_IMGUI_COLOR_BUTTON_BG_HOVERED ((ImVec4_c){0.235f, 0.267f, 0.298f, 1.0f})
14#define DTTR_IMGUI_COLOR_BUTTON_BG_ACTIVE ((ImVec4_c){0.145f, 0.165f, 0.188f, 1.0f})
15#define DTTR_IMGUI_COLOR_BUTTON_TEXT ((ImVec4_c){0.91f, 0.90f, 0.87f, 1.0f})
16#define DTTR_IMGUI_SCALE_EPSILON 0.001f
29 return scale > 0.0f ? scale : 1.0f;
34 window ? SDL_GetWindowDisplayScale(window) : 0.0f
47 const float delta = a > b ? a - b : b - a;
60 ImGuiStyle *style = igGetStyle();
62 if (!
state->initialized) {
63 state->base_style = *style;
64 state->initialized =
true;
68 *style =
state->base_style;
71 ImGuiStyle_ScaleAllSizes(style, scale);
72 style->FontScaleMain =
state->base_style.FontScaleMain * scale;
73 state->current_scale = scale;
123 ImGuiWindowFlags
flags
const DTTR_BackendState * state
DTTR_Graphics_COM_Direct3DDevice7 void DWORD flags DWORD void DWORD flags
void void DWORD HANDLE event
void DTTR_ImGuiDialog_End(DTTR_ImGuiDialogContext *ctx)
void DTTR_ImGuiDialog_DrawHeader(const DTTR_ImGuiDialogContext *ctx, const char *title, const char *version)
bool DTTR_ImGui_ErrorShow(const char *title, const char *message)
void DTTR_ImGuiDialog_CenterNextItem(float item_width)
static float DTTR_ImGui_GetCurrentDesktopScale(const DTTR_ImGuiDesktopScaleState *state)
void DTTR_ImGuiDialog_Render(DTTR_ImGuiDialogContext *ctx)
static bool DTTR_ImGui_ScaleChanged(float a, float b)
bool DTTR_ImGuiDialog_RefreshScale(DTTR_ImGuiDialogContext *ctx)
bool DTTR_ImGuiDialog_BeginRoot(DTTR_ImGuiDialogContext *ctx, const char *title, ImGuiWindowFlags flags)
float DTTR_ImGuiDialog_ScaledFloat(const DTTR_ImGuiDialogContext *ctx, float value)
static bool DTTR_ImGui_ApplyWindowDesktopScale(DTTR_ImGuiDesktopScaleState *state, SDL_Window *window)
void DTTR_ImGuiDialog_OffsetCursorY(const DTTR_ImGuiDialogContext *ctx, float amount)
void DTTR_ImGuiDialog_DrawPaddedText(const DTTR_ImGuiDialogContext *ctx, const char *message, float padding_x, float padding_y)
void DTTR_ImGuiDialog_ProcessEvents(const DTTR_ImGuiDialogContext *ctx, bool *running)
static bool DTTR_ImGui_ApplyDesktopScale(DTTR_ImGuiDesktopScaleState *state, float scale)
bool DTTR_ImGuiDialog_Button(const DTTR_ImGuiDialogContext *ctx, const char *id, const char *label, ImVec2_c size)
static float DTTR_ImGui_GetWindowDesktopScale(SDL_Window *window)
void DTTR_ImGuiDialog_EndRoot()
void DTTR_ImGuiDialog_NewFrame(const DTTR_ImGuiDialogContext *ctx)
void DTTR_ImGuiDialog_ProcessEvent(const DTTR_ImGuiDialogContext *ctx, const SDL_Event *event, bool *running)
#define DTTR_IMGUI_SCALE_EPSILON
static float DTTR_ImGui_NormalizeDesktopScale(float scale)
void DTTR_ImGuiDialog_FitWindowToContent(DTTR_ImGuiDialogContext *ctx, int width, float padding_y)
void DTTR_ImGuiDialog_Shutdown()
bool DTTR_ImGuiDialog_Begin(DTTR_ImGuiDialogContext *ctx, const char *title, int width, int height)
union SDL_Event SDL_Event
struct SDL_Window SDL_Window
ImGuiContext * imgui_context
ImGuiContext * previous_imgui_context
int logical_window_height
DTTR_ImGuiDesktopScaleState imgui_scale