102 Patches: Detours to the Rescue
C reference for DttR maintainers and modders.
Loading...
Searching...
No Matches
mods_private.h
Go to the documentation of this file.
1#ifndef MODS_PRIVATE_H
2#define MODS_PRIVATE_H
3
4#include <stdbool.h>
5#include <stddef.h>
6#include <windows.h>
7
8#include <SDL3/SDL.h>
9#include <dttr_mods.h>
10
11void dttr_mods_init();
12void dttr_mods_tick();
22void dttr_mods_overlay_visible_changed(bool visible);
31void dttr_mods_after_event(const SDL_Event *event, bool consumed);
41const char *dttr_mods_loaded_name(size_t index);
45
46#define MODS_MAX 32u
47
48typedef struct {
49 FILETIME write_time;
53
54typedef struct {
55 HMODULE handle;
58 char filename[MAX_PATH];
59 char source_path[MAX_PATH];
60 char shadow_path[MAX_PATH];
61 char display_name[MAX_PATH];
100
101#endif // MODS_PRIVATE_H
void void * ctx
void void DWORD HANDLE event
void(* DTTR_Mods_WindowResizedFn)(const DTTR_Mods_WindowContext *ctx)
Definition dttr_mods.h:189
void(* DTTR_Mods_ImGuiBeginFn)(const DTTR_Mods_RenderContext *ctx)
Definition dttr_mods.h:185
void(* DTTR_Mods_AfterEventFn)(const SDL_Event *event, bool consumed)
Definition dttr_mods.h:196
void(* DTTR_Mods_GraphicsDeviceDestroyingFn)(const DTTR_Mods_GraphicsContext *ctx)
Definition dttr_mods.h:194
void(* DTTR_Mods_GraphicsDeviceLostFn)(const DTTR_Mods_GraphicsContext *ctx)
Definition dttr_mods.h:192
void(* DTTR_Mods_CleanupFn)()
Definition dttr_mods.h:102
union SDL_Event SDL_Event
Definition dttr_mods.h:20
void(* DTTR_Mods_BeforePresentFn)(const DTTR_Mods_PresentContext *ctx)
Definition dttr_mods.h:182
void(* DTTR_Mods_FrameBeginFn)(const DTTR_Mods_FrameContext *ctx)
Definition dttr_mods.h:179
void(* DTTR_Mods_GraphicsDeviceCreatedFn)(const DTTR_Mods_GraphicsContext *ctx)
Definition dttr_mods.h:191
void(* DTTR_Mods_BeforeGameFrameFn)(const DTTR_Mods_FrameContext *ctx)
Definition dttr_mods.h:180
bool(* DTTR_Mods_EventFn)(const SDL_Event *event)
Definition dttr_mods.h:104
bool(* DTTR_Mods_InitFn)(const DTTR_Mods_Context *ctx)
Definition dttr_mods.h:101
void(* DTTR_Mods_AfterGameFrameFn)(const DTTR_Mods_FrameContext *ctx)
Definition dttr_mods.h:181
void(* DTTR_Mods_TickFn)()
Definition dttr_mods.h:103
void(* DTTR_Mods_ImGuiEndFn)(const DTTR_Mods_RenderContext *ctx)
Definition dttr_mods.h:186
void(* DTTR_Mods_BeforeUnloadFn)()
Definition dttr_mods.h:107
void(* DTTR_Mods_InputModeChangedFn)(const DTTR_Mods_InputContext *ctx)
Definition dttr_mods.h:197
void(* DTTR_Mods_OverlayVisibleChangedFn)(bool visible)
Definition dttr_mods.h:187
void(* DTTR_Mods_GameFrameAdvancedFn)()
Definition dttr_mods.h:200
const DTTR_Mods_Info *(* DTTR_Mods_InfoFn)()
Definition dttr_mods.h:105
bool(* DTTR_Mods_BeforeEventFn)(const SDL_Event *event)
Definition dttr_mods.h:195
void(* DTTR_Mods_AfterPresentFn)(const DTTR_Mods_PresentContext *ctx)
Definition dttr_mods.h:183
void(* DTTR_Mods_GraphicsDeviceRestoredFn)(const DTTR_Mods_GraphicsContext *ctx)
Definition dttr_mods.h:193
void(* DTTR_Mods_WindowCreatedFn)(const DTTR_Mods_WindowContext *ctx)
Definition dttr_mods.h:188
bool(* DTTR_Mods_ShouldAdvanceGameFrameFn)()
Definition dttr_mods.h:199
void(* DTTR_Mods_FrameEndFn)(const DTTR_Mods_FrameContext *ctx)
Definition dttr_mods.h:184
void(* DTTR_Mods_RenderFn)(const DTTR_Mods_RenderContext *ctx)
Definition dttr_mods.h:177
void(* DTTR_Mods_LateInitFn)()
Definition dttr_mods.h:106
void(* DTTR_Mods_GameFrameBlockedFn)()
Definition dttr_mods.h:201
void(* DTTR_Mods_WindowDestroyingFn)(const DTTR_Mods_WindowContext *ctx)
Definition dttr_mods.h:190
void(* DTTR_Mods_RenderGameFn)(const DTTR_Mods_RenderGameContext *ctx)
Definition dttr_mods.h:176
void dttr_mods_render_game(const DTTR_Mods_RenderGameContext *ctx)
Definition mods.c:751
void dttr_mods_input_mode_changed(const DTTR_Mods_InputContext *ctx)
Definition mods.c:712
void dttr_mods_tick()
Definition mods.c:605
void dttr_mods_overlay_visible_changed(bool visible)
Definition mods.c:654
void dttr_mods_render(const DTTR_Mods_RenderContext *ctx)
Definition mods.c:755
void dttr_mods_window_destroying(const DTTR_Mods_WindowContext *ctx)
Definition mods.c:666
void dttr_mods_after_game_frame(const DTTR_Mods_FrameContext *ctx)
Definition mods.c:630
void dttr_mods_imgui_end(const DTTR_Mods_RenderContext *ctx)
Definition mods.c:650
void dttr_mods_frame_begin(const DTTR_Mods_FrameContext *ctx)
Definition mods.c:622
void dttr_mods_before_present(const DTTR_Mods_PresentContext *ctx)
Definition mods.c:634
size_t dttr_mods_loaded_count()
Definition mods.c:763
void dttr_mods_late_init()
Definition mods.c:618
bool dttr_mods_handle_event(const SDL_Event *event)
Definition mods.c:759
void dttr_mods_graphics_device_destroying(const DTTR_Mods_GraphicsContext *ctx)
Definition mods.c:682
void dttr_mods_after_present(const DTTR_Mods_PresentContext *ctx)
Definition mods.c:638
void dttr_mods_window_resized(const DTTR_Mods_WindowContext *ctx)
Definition mods.c:662
void dttr_mods_imgui_begin(const DTTR_Mods_RenderContext *ctx)
Definition mods.c:646
bool dttr_mods_has_render_game()
Definition mods.c:741
void dttr_mods_cleanup()
Definition mods.c:788
DWORD dttr_mods_loaded_elapsed_ms(size_t index)
Definition mods.c:776
void dttr_mods_init()
Definition mods.c:592
void dttr_mods_frame_end(const DTTR_Mods_FrameContext *ctx)
Definition mods.c:642
void dttr_mods_game_frame_blocked()
Definition mods.c:737
bool dttr_mods_should_advance_game_frame()
Definition mods.c:716
void dttr_mods_graphics_device_created(const DTTR_Mods_GraphicsContext *ctx)
Definition mods.c:670
void dttr_mods_window_created(const DTTR_Mods_WindowContext *ctx)
Definition mods.c:658
const char * dttr_mods_loaded_name(size_t index)
Definition mods.c:767
bool dttr_mods_before_event(const SDL_Event *event)
Definition mods.c:704
void dttr_mods_before_game_frame(const DTTR_Mods_FrameContext *ctx)
Definition mods.c:626
void dttr_mods_game_frame_advanced()
Definition mods.c:733
void dttr_mods_graphics_device_restored(const DTTR_Mods_GraphicsContext *ctx)
Definition mods.c:678
void dttr_mods_graphics_device_lost(const DTTR_Mods_GraphicsContext *ctx)
Definition mods.c:674
void dttr_mods_after_event(const SDL_Event *event, bool consumed)
Definition mods.c:708
bool dttr_mods_hot_reload_enabled()
Definition mods.c:784
DTTR_Mods_WindowDestroyingFn window_destroying
DTTR_Mods_BeforePresentFn before_present
void * hook_owner
DTTR_Mods_InputModeChangedFn input_mode_changed
DTTR_Mods_Context * context
DTTR_Mods_LateInitFn late_init
DTTR_Mods_ImGuiBeginFn imgui_begin
DTTR_Mods_GraphicsDeviceDestroyingFn graphics_device_destroying
DTTR_Mods_GameFrameBlockedFn game_frame_blocked
DTTR_Mods_AfterPresentFn after_present
DTTR_Mods_RenderGameFn render_game
DTTR_Mods_AfterEventFn after_event
bool reload_pending
HMODULE handle
DTTR_Mods_WindowCreatedFn window_created
bool initialized
DTTR_Mods_CleanupFn cleanup
DTTR_Mods_OverlayVisibleChangedFn overlay_visible_changed
char filename[MAX_PATH]
mod_file_id pending_file
DWORD pending_since_ms
DTTR_Mods_GraphicsDeviceRestoredFn graphics_device_restored
DTTR_Mods_AfterGameFrameFn after_game_frame
DTTR_Mods_RenderFn render
DTTR_Mods_ShouldAdvanceGameFrameFn should_advance_game_frame
DTTR_Mods_InitFn init
DTTR_Mods_EventFn event
DTTR_Mods_GraphicsDeviceLostFn graphics_device_lost
char display_name[MAX_PATH]
DTTR_Mods_GameFrameAdvancedFn game_frame_advanced
DTTR_Mods_BeforeGameFrameFn before_game_frame
DTTR_Mods_ImGuiEndFn imgui_end
DTTR_Mods_TickFn tick
DTTR_Mods_FrameEndFn frame_end
DTTR_Mods_BeforeEventFn before_event
mod_file_id source_file
char shadow_path[MAX_PATH]
DWORD loaded_at_ms
DTTR_Mods_FrameBeginFn frame_begin
DTTR_Mods_WindowResizedFn window_resized
char source_path[MAX_PATH]
DTTR_Mods_GraphicsDeviceCreatedFn graphics_device_created
DTTR_Mods_BeforeUnloadFn before_unload
DTTR_Mods_InfoFn info
DWORD size_high
FILETIME write_time