102 Patches: Detours to the Rescue
C reference for DttR maintainers and modders.
Loading...
Searching...
No Matches
imgui_dialog.c File Reference
#include <dttr_imgui.h>
#include <glad/gl.h>

Go to the source code of this file.

Functions

static void use_dialog_imgui_context (const DTTR_ImGuiDialogContext *ctx)
static void restore_previous_imgui_context (const DTTR_ImGuiDialogContext *ctx)
void DTTR_ImGuiDialog_OffsetCursorY (const DTTR_ImGuiDialogContext *ctx, float amount)
static float context_scale (const DTTR_ImGuiDialogContext *ctx)
float DTTR_ImGuiDialog_ScaledFloat (const DTTR_ImGuiDialogContext *ctx, float value)
static int scaled_int (const DTTR_ImGuiDialogContext *ctx, float value)
static void resize_dialog_window_for_scale (DTTR_ImGuiDialogContext *ctx)
bool DTTR_ImGuiDialog_RefreshScale (DTTR_ImGuiDialogContext *ctx)
static void set_gl_attributes ()
static bool init_sdl_video ()
static bool init_dialog_imgui (DTTR_ImGuiDialogContext *ctx)
bool DTTR_ImGuiDialog_Begin (DTTR_ImGuiDialogContext *ctx, const char *title, int width, int height)
void DTTR_ImGuiDialog_End (DTTR_ImGuiDialogContext *ctx)
void DTTR_ImGuiDialog_Shutdown ()
void DTTR_ImGuiDialog_NewFrame (const DTTR_ImGuiDialogContext *ctx)
void DTTR_ImGuiDialog_Render (DTTR_ImGuiDialogContext *ctx)
void DTTR_ImGuiDialog_ProcessEvent (const DTTR_ImGuiDialogContext *ctx, const SDL_Event *event, bool *running)
void DTTR_ImGuiDialog_ProcessEvents (const DTTR_ImGuiDialogContext *ctx, bool *running)
static void begin_full_window (const DTTR_ImGuiDialogContext *ctx)
bool DTTR_ImGuiDialog_BeginRoot (DTTR_ImGuiDialogContext *ctx, const char *title, ImGuiWindowFlags flags)
void DTTR_ImGuiDialog_EndRoot ()
bool DTTR_ImGuiDialog_Button (const DTTR_ImGuiDialogContext *ctx, const char *id, const char *label, ImVec2_c size)
void DTTR_ImGuiDialog_CenterNextItem (float item_width)
static void draw_centered_text (const char *text)
void DTTR_ImGuiDialog_DrawHeader (const DTTR_ImGuiDialogContext *ctx, const char *title, const char *version)
void DTTR_ImGuiDialog_DrawPaddedText (const DTTR_ImGuiDialogContext *ctx, const char *message, float padding_x, float padding_y)
void DTTR_ImGuiDialog_FitWindowToContent (DTTR_ImGuiDialogContext *ctx, int width, float padding_y)

Variables

static const ImGuiWindowFlags ROOT_WINDOW_FLAGS
static bool sdl_video_ready

Function Documentation

◆ begin_full_window()

void begin_full_window ( const DTTR_ImGuiDialogContext * ctx)
static

Definition at line 265 of file imgui_dialog.c.

References ctx, float, and use_dialog_imgui_context().

Referenced by DTTR_ImGuiDialog_BeginRoot().

◆ context_scale()

float context_scale ( const DTTR_ImGuiDialogContext * ctx)
static

Definition at line 29 of file imgui_dialog.c.

References ctx.

Referenced by DTTR_ImGuiDialog_RefreshScale(), and DTTR_ImGuiDialog_ScaledFloat().

◆ draw_centered_text()

void draw_centered_text ( const char * text)
static

Definition at line 318 of file imgui_dialog.c.

References DTTR_ImGuiDialog_CenterNextItem(), NULL, and size.

Referenced by DTTR_ImGuiDialog_DrawHeader().

◆ DTTR_ImGuiDialog_Begin()

bool DTTR_ImGuiDialog_Begin ( DTTR_ImGuiDialogContext * ctx,
const char * title,
int width,
int height )

◆ DTTR_ImGuiDialog_BeginRoot()

bool DTTR_ImGuiDialog_BeginRoot ( DTTR_ImGuiDialogContext * ctx,
const char * title,
ImGuiWindowFlags flags )

◆ DTTR_ImGuiDialog_Button()

bool DTTR_ImGuiDialog_Button ( const DTTR_ImGuiDialogContext * ctx,
const char * id,
const char * label,
ImVec2_c size )

◆ DTTR_ImGuiDialog_CenterNextItem()

void DTTR_ImGuiDialog_CenterNextItem ( float item_width)

Definition at line 311 of file imgui_dialog.c.

Referenced by draw_centered_text(), draw_source_buttons(), and DTTR_ImGui_ErrorShow().

◆ DTTR_ImGuiDialog_DrawHeader()

void DTTR_ImGuiDialog_DrawHeader ( const DTTR_ImGuiDialogContext * ctx,
const char * title,
const char * version )

◆ DTTR_ImGuiDialog_DrawPaddedText()

void DTTR_ImGuiDialog_DrawPaddedText ( const DTTR_ImGuiDialogContext * ctx,
const char * message,
float padding_x,
float padding_y )

◆ DTTR_ImGuiDialog_End()

◆ DTTR_ImGuiDialog_EndRoot()

void DTTR_ImGuiDialog_EndRoot ( )

◆ DTTR_ImGuiDialog_FitWindowToContent()

void DTTR_ImGuiDialog_FitWindowToContent ( DTTR_ImGuiDialogContext * ctx,
int width,
float padding_y )

◆ DTTR_ImGuiDialog_NewFrame()

void DTTR_ImGuiDialog_NewFrame ( const DTTR_ImGuiDialogContext * ctx)

◆ DTTR_ImGuiDialog_OffsetCursorY()

void DTTR_ImGuiDialog_OffsetCursorY ( const DTTR_ImGuiDialogContext * ctx,
float amount )

◆ DTTR_ImGuiDialog_ProcessEvent()

void DTTR_ImGuiDialog_ProcessEvent ( const DTTR_ImGuiDialogContext * ctx,
const SDL_Event * event,
bool * running )

Definition at line 235 of file imgui_dialog.c.

References ctx, event, and use_dialog_imgui_context().

Referenced by DTTR_ImGuiDialog_ProcessEvents(), and process_events().

◆ DTTR_ImGuiDialog_ProcessEvents()

void DTTR_ImGuiDialog_ProcessEvents ( const DTTR_ImGuiDialogContext * ctx,
bool * running )

Definition at line 255 of file imgui_dialog.c.

References ctx, DTTR_ImGuiDialog_ProcessEvent(), and event.

Referenced by DTTR_ImGui_ErrorShow(), and DTTR_LoaderUI_ChooseGameSource().

◆ DTTR_ImGuiDialog_RefreshScale()

◆ DTTR_ImGuiDialog_Render()

void DTTR_ImGuiDialog_Render ( DTTR_ImGuiDialogContext * ctx)

◆ DTTR_ImGuiDialog_ScaledFloat()

◆ DTTR_ImGuiDialog_Shutdown()

void DTTR_ImGuiDialog_Shutdown ( )

Definition at line 204 of file imgui_dialog.c.

References sdl_video_ready.

Referenced by dttr_config_main(), and dttr_launcher_main().

◆ init_dialog_imgui()

bool init_dialog_imgui ( DTTR_ImGuiDialogContext * ctx)
static

Definition at line 96 of file imgui_dialog.c.

References ctx, DTTR_ImGuiDialog_RefreshScale(), NULL, and use_dialog_imgui_context().

Referenced by DTTR_ImGuiDialog_Begin().

◆ init_sdl_video()

bool init_sdl_video ( )
static

Definition at line 83 of file imgui_dialog.c.

References sdl_video_ready.

Referenced by DTTR_ImGuiDialog_Begin().

◆ resize_dialog_window_for_scale()

void resize_dialog_window_for_scale ( DTTR_ImGuiDialogContext * ctx)
static

Definition at line 42 of file imgui_dialog.c.

References ctx, and scaled_int().

Referenced by DTTR_ImGuiDialog_RefreshScale().

◆ restore_previous_imgui_context()

void restore_previous_imgui_context ( const DTTR_ImGuiDialogContext * ctx)
static

Definition at line 17 of file imgui_dialog.c.

References ctx.

Referenced by DTTR_ImGuiDialog_End().

◆ scaled_int()

int scaled_int ( const DTTR_ImGuiDialogContext * ctx,
float value )
static

◆ set_gl_attributes()

void set_gl_attributes ( )
static

Definition at line 75 of file imgui_dialog.c.

Referenced by DTTR_ImGuiDialog_Begin().

◆ use_dialog_imgui_context()

Variable Documentation

◆ ROOT_WINDOW_FLAGS

const ImGuiWindowFlags ROOT_WINDOW_FLAGS
static
Initial value:
= ImGuiWindowFlags_NoDecoration
| ImGuiWindowFlags_NoMove
| ImGuiWindowFlags_NoSavedSettings

Definition at line 5 of file imgui_dialog.c.

Referenced by DTTR_ImGuiDialog_BeginRoot().

◆ sdl_video_ready

bool sdl_video_ready
static

Definition at line 9 of file imgui_dialog.c.

Referenced by DTTR_ImGuiDialog_Shutdown(), and init_sdl_video().