|
102 Patches: Detours to the Rescue
C reference for DttR maintainers and modders.
|
#include <stdbool.h>#include <stddef.h>#include <stdint.h>#include <windows.h>#include <dttr_runtime.h>Go to the source code of this file.
Data Structures | |
| struct | DTTR_Mods_ExceptionReportRequest |
| struct | DTTR_Mods_ExceptionReport |
| struct | DTTR_Mods_API |
| struct | DTTR_Mods_Context |
| struct | DTTR_Mods_Info |
| struct | DTTR_Mods_FrameContext |
| struct | DTTR_Mods_PresentContext |
| struct | DTTR_Mods_WindowContext |
| struct | DTTR_Mods_GraphicsContext |
| struct | DTTR_Mods_InputContext |
| struct | DTTR_Mods_RenderGameContext |
| struct | DTTR_Mods_RenderContext |
Enumerations | |
| enum | DTTR_Mods_GraphicsBackend { DTTR_MODS_GRAPHICS_BACKEND_UNKNOWN = 0 , DTTR_MODS_GRAPHICS_BACKEND_SDL_GPU = 1 , DTTR_MODS_GRAPHICS_BACKEND_OPENGL = 2 } |
Functions | |
| static DTTR_Mods_WriteExceptionReportFn | DTTR_Mods_GetWriteExceptionReportFn (const DTTR_Mods_API *api) |
| static bool | DTTR_Mods_ContextIsCompatible (const DTTR_Mods_Context *ctx) |
Mod DLL API for modules loaded from mods/.
Mods must export DTTR_Mod_Init and DTTR_Mod_Cleanup; optional callbacks can be exported to observe frame, window, graphics, input, event, and unload lifecycle events.
Definition in file dttr_mods.h.
| #define DTTR_EXPORT __declspec(dllexport) |
Definition at line 236 of file dttr_mods.h.
| #define DTTR_MODS_AFTER_EVENT DTTR_EXPORT void DTTR_Mod_AfterEvent(const SDL_Event *event, bool consumed) |
Definition at line 336 of file dttr_mods.h.
| #define DTTR_MODS_AFTER_GAME_FRAME DTTR_EXPORT void DTTR_Mod_AfterGameFrame(const DTTR_Mods_FrameContext *ctx) |
Definition at line 284 of file dttr_mods.h.
| #define DTTR_MODS_AFTER_PRESENT DTTR_EXPORT void DTTR_Mod_AfterPresent(const DTTR_Mods_PresentContext *ctx) |
Definition at line 294 of file dttr_mods.h.
| #define DTTR_MODS_BEFORE_EVENT DTTR_EXPORT bool DTTR_Mod_BeforeEvent(const SDL_Event *event) |
Definition at line 333 of file dttr_mods.h.
| #define DTTR_MODS_BEFORE_GAME_FRAME DTTR_EXPORT void DTTR_Mod_BeforeGameFrame(const DTTR_Mods_FrameContext *ctx) |
Definition at line 278 of file dttr_mods.h.
| #define DTTR_MODS_BEFORE_PRESENT DTTR_EXPORT void DTTR_Mod_BeforePresent(const DTTR_Mods_PresentContext *ctx) |
Definition at line 290 of file dttr_mods.h.
| #define DTTR_MODS_BEFORE_UNLOAD DTTR_EXPORT void DTTR_Mod_BeforeUnload() |
Definition at line 268 of file dttr_mods.h.
| #define DTTR_MODS_CLEANUP DTTR_EXPORT void DTTR_Mod_Cleanup() |
Definition at line 265 of file dttr_mods.h.
| #define DTTR_MODS_EVENT DTTR_EXPORT bool DTTR_Mod_Event(const SDL_Event *event) |
Definition at line 343 of file dttr_mods.h.
| #define DTTR_MODS_EXCEPTION_REPORT_STACK_TRACE_CAPACITY 16384u |
Definition at line 22 of file dttr_mods.h.
| #define DTTR_MODS_FRAME_BEGIN DTTR_EXPORT void DTTR_Mod_FrameBegin(const DTTR_Mods_FrameContext *ctx) |
Definition at line 272 of file dttr_mods.h.
| #define DTTR_MODS_FRAME_END DTTR_EXPORT void DTTR_Mod_FrameEnd(const DTTR_Mods_FrameContext *ctx) |
Definition at line 298 of file dttr_mods.h.
| #define DTTR_MODS_GAME_FRAME_ADVANCED DTTR_EXPORT void DTTR_Mod_GameFrameAdvanced() |
Definition at line 358 of file dttr_mods.h.
| #define DTTR_MODS_GAME_FRAME_BLOCKED DTTR_EXPORT void DTTR_Mod_GameFrameBlocked() |
Definition at line 361 of file dttr_mods.h.
| #define DTTR_MODS_GRAPHICS_DEVICE_CREATED DTTR_EXPORT void DTTR_Mod_GraphicsDeviceCreated(const DTTR_Mods_GraphicsContext *ctx) |
Definition at line 319 of file dttr_mods.h.
| #define DTTR_MODS_GRAPHICS_DEVICE_DESTROYING |
Definition at line 328 of file dttr_mods.h.
| #define DTTR_MODS_GRAPHICS_DEVICE_LOST DTTR_EXPORT void DTTR_Mod_GraphicsDeviceLost(const DTTR_Mods_GraphicsContext *ctx) |
Definition at line 322 of file dttr_mods.h.
| #define DTTR_MODS_GRAPHICS_DEVICE_RESTORED DTTR_EXPORT void DTTR_Mod_GraphicsDeviceRestored(const DTTR_Mods_GraphicsContext *ctx) |
Definition at line 325 of file dttr_mods.h.
| #define DTTR_MODS_IMGUI_BEGIN DTTR_EXPORT void DTTR_Mod_ImGuiBegin(const DTTR_Mods_RenderContext *ctx) |
Definition at line 301 of file dttr_mods.h.
| #define DTTR_MODS_IMGUI_END DTTR_EXPORT void DTTR_Mod_ImGuiEnd(const DTTR_Mods_RenderContext *ctx) |
Definition at line 304 of file dttr_mods.h.
| #define DTTR_MODS_INFO | ( | mod_name, | |
| mod_version, | |||
| mod_author ) |
Definition at line 239 of file dttr_mods.h.
| #define DTTR_MODS_INIT |
Definition at line 255 of file dttr_mods.h.
| #define DTTR_MODS_INPUT_MODE_CHANGED DTTR_EXPORT void DTTR_Mod_InputModeChanged(const DTTR_Mods_InputContext *ctx) |
Definition at line 339 of file dttr_mods.h.
| #define DTTR_MODS_LATE_INIT DTTR_EXPORT void DTTR_Mod_LateInit() |
Definition at line 267 of file dttr_mods.h.
| #define DTTR_MODS_LOG | ( | ctx, | |
| level, | |||
| ... ) |
Definition at line 212 of file dttr_mods.h.
| #define DTTR_MODS_LOG_DEBUG | ( | ctx, | |
| ... ) |
Definition at line 220 of file dttr_mods.h.
Referenced by dttr_sidecar_install_pcdogs_patch_group(), and install_pointer_hook().
| #define DTTR_MODS_LOG_ERROR | ( | ctx, | |
| ... ) |
Definition at line 226 of file dttr_mods.h.
Referenced by dttr_mss_sdl_install_hooks(), dttr_sidecar_install_pcdogs_patch_group(), install_mss_import_descriptor(), and install_pointer_hook().
| #define DTTR_MODS_LOG_FATAL | ( | ctx, | |
| ... ) |
Definition at line 228 of file dttr_mods.h.
| #define DTTR_MODS_LOG_INFO | ( | ctx, | |
| ... ) |
Definition at line 222 of file dttr_mods.h.
| #define DTTR_MODS_LOG_LVL_DEBUG 1 |
Definition at line 206 of file dttr_mods.h.
| #define DTTR_MODS_LOG_LVL_ERROR 4 |
Definition at line 209 of file dttr_mods.h.
| #define DTTR_MODS_LOG_LVL_FATAL 5 |
Definition at line 210 of file dttr_mods.h.
| #define DTTR_MODS_LOG_LVL_INFO 2 |
Definition at line 207 of file dttr_mods.h.
| #define DTTR_MODS_LOG_LVL_TRACE 0 |
Definition at line 205 of file dttr_mods.h.
| #define DTTR_MODS_LOG_LVL_WARN 3 |
Definition at line 208 of file dttr_mods.h.
| #define DTTR_MODS_LOG_TRACE | ( | ctx, | |
| ... ) |
Definition at line 218 of file dttr_mods.h.
| #define DTTR_MODS_LOG_WARN | ( | ctx, | |
| ... ) |
Definition at line 224 of file dttr_mods.h.
| #define DTTR_MODS_OVERLAY_VISIBLE_CHANGED DTTR_EXPORT void DTTR_Mod_OverlayVisibleChanged(bool visible) |
Definition at line 307 of file dttr_mods.h.
| #define DTTR_MODS_RENDER DTTR_EXPORT void DTTR_Mod_Render(const DTTR_Mods_RenderContext *ctx) |
Definition at line 350 of file dttr_mods.h.
| #define DTTR_MODS_RENDER_GAME DTTR_EXPORT void DTTR_Mod_RenderGame(const DTTR_Mods_RenderGameContext *ctx) |
Definition at line 346 of file dttr_mods.h.
| #define DTTR_MODS_SHOULD_ADVANCE_GAME_FRAME DTTR_EXPORT bool DTTR_Mod_ShouldAdvanceGameFrame() |
Definition at line 354 of file dttr_mods.h.
| #define DTTR_MODS_TICK DTTR_EXPORT void DTTR_Mod_Tick() |
Definition at line 266 of file dttr_mods.h.
| #define DTTR_MODS_WINDOW_CREATED DTTR_EXPORT void DTTR_Mod_WindowCreated(const DTTR_Mods_WindowContext *ctx) |
Definition at line 310 of file dttr_mods.h.
| #define DTTR_MODS_WINDOW_DESTROYING DTTR_EXPORT void DTTR_Mod_WindowDestroying(const DTTR_Mods_WindowContext *ctx) |
Definition at line 316 of file dttr_mods.h.
| #define DTTR_MODS_WINDOW_RESIZED DTTR_EXPORT void DTTR_Mod_WindowResized(const DTTR_Mods_WindowContext *ctx) |
Definition at line 313 of file dttr_mods.h.
Definition at line 196 of file dttr_mods.h.
| typedef void(* DTTR_Mods_AfterGameFrameFn) (const DTTR_Mods_FrameContext *ctx) |
Definition at line 181 of file dttr_mods.h.
| typedef void(* DTTR_Mods_AfterPresentFn) (const DTTR_Mods_PresentContext *ctx) |
Definition at line 183 of file dttr_mods.h.
Definition at line 195 of file dttr_mods.h.
| typedef void(* DTTR_Mods_BeforeGameFrameFn) (const DTTR_Mods_FrameContext *ctx) |
Definition at line 180 of file dttr_mods.h.
| typedef void(* DTTR_Mods_BeforePresentFn) (const DTTR_Mods_PresentContext *ctx) |
Definition at line 182 of file dttr_mods.h.
| typedef void(* DTTR_Mods_BeforeUnloadFn) () |
Definition at line 107 of file dttr_mods.h.
| typedef void(* DTTR_Mods_CleanupFn) () |
Definition at line 102 of file dttr_mods.h.
Definition at line 104 of file dttr_mods.h.
| typedef void(* DTTR_Mods_FrameBeginFn) (const DTTR_Mods_FrameContext *ctx) |
Definition at line 179 of file dttr_mods.h.
| typedef void(* DTTR_Mods_FrameEndFn) (const DTTR_Mods_FrameContext *ctx) |
Definition at line 184 of file dttr_mods.h.
| typedef void(* DTTR_Mods_GameFrameAdvancedFn) () |
Definition at line 200 of file dttr_mods.h.
| typedef void(* DTTR_Mods_GameFrameBlockedFn) () |
Definition at line 201 of file dttr_mods.h.
| typedef void(* DTTR_Mods_GraphicsDeviceCreatedFn) (const DTTR_Mods_GraphicsContext *ctx) |
Definition at line 191 of file dttr_mods.h.
| typedef void(* DTTR_Mods_GraphicsDeviceDestroyingFn) (const DTTR_Mods_GraphicsContext *ctx) |
Definition at line 194 of file dttr_mods.h.
| typedef void(* DTTR_Mods_GraphicsDeviceLostFn) (const DTTR_Mods_GraphicsContext *ctx) |
Definition at line 192 of file dttr_mods.h.
| typedef void(* DTTR_Mods_GraphicsDeviceRestoredFn) (const DTTR_Mods_GraphicsContext *ctx) |
Definition at line 193 of file dttr_mods.h.
| typedef void(* DTTR_Mods_ImGuiBeginFn) (const DTTR_Mods_RenderContext *ctx) |
Definition at line 185 of file dttr_mods.h.
| typedef void(* DTTR_Mods_ImGuiEndFn) (const DTTR_Mods_RenderContext *ctx) |
Definition at line 186 of file dttr_mods.h.
| typedef const DTTR_Mods_Info *(* DTTR_Mods_InfoFn) () |
Definition at line 105 of file dttr_mods.h.
| typedef bool(* DTTR_Mods_InitFn) (const DTTR_Mods_Context *ctx) |
Definition at line 101 of file dttr_mods.h.
| typedef void(* DTTR_Mods_InputModeChangedFn) (const DTTR_Mods_InputContext *ctx) |
Definition at line 197 of file dttr_mods.h.
| typedef void(* DTTR_Mods_LateInitFn) () |
Definition at line 106 of file dttr_mods.h.
Definition at line 46 of file dttr_mods.h.
| typedef bool(* DTTR_Mods_LogIsEnabledFn) (int level) |
Definition at line 53 of file dttr_mods.h.
| typedef void(* DTTR_Mods_OverlayVisibleChangedFn) (bool visible) |
Definition at line 187 of file dttr_mods.h.
| typedef void(* DTTR_Mods_RenderFn) (const DTTR_Mods_RenderContext *ctx) |
Definition at line 177 of file dttr_mods.h.
| typedef void(* DTTR_Mods_RenderGameFn) (const DTTR_Mods_RenderGameContext *ctx) |
Definition at line 176 of file dttr_mods.h.
| typedef bool(* DTTR_Mods_ShouldAdvanceGameFrameFn) () |
Definition at line 199 of file dttr_mods.h.
| typedef void(* DTTR_Mods_TickFn) () |
Definition at line 103 of file dttr_mods.h.
| typedef void(* DTTR_Mods_WindowCreatedFn) (const DTTR_Mods_WindowContext *ctx) |
Definition at line 188 of file dttr_mods.h.
| typedef void(* DTTR_Mods_WindowDestroyingFn) (const DTTR_Mods_WindowContext *ctx) |
Definition at line 190 of file dttr_mods.h.
| typedef void(* DTTR_Mods_WindowResizedFn) (const DTTR_Mods_WindowContext *ctx) |
Definition at line 189 of file dttr_mods.h.
| typedef bool(* DTTR_Mods_WriteExceptionReportFn) (const DTTR_Mods_ExceptionReportRequest *request, DTTR_Mods_ExceptionReport *report) |
Definition at line 41 of file dttr_mods.h.
Definition at line 20 of file dttr_mods.h.
| typedef struct SDL_Window SDL_Window |
Definition at line 19 of file dttr_mods.h.
| Enumerator | |
|---|---|
| DTTR_MODS_GRAPHICS_BACKEND_UNKNOWN | |
| DTTR_MODS_GRAPHICS_BACKEND_SDL_GPU | |
| DTTR_MODS_GRAPHICS_BACKEND_OPENGL | |
Definition at line 140 of file dttr_mods.h.
|
inlinestatic |
Definition at line 249 of file dttr_mods.h.
References ctx, and DTTR_SDK_ABI_VERSION.
|
inlinestatic |
Definition at line 64 of file dttr_mods.h.
References DTTR_Mods_API::abi_version, DTTR_SDK_ABI_VERSION, NULL, DTTR_Mods_API::struct_size, and DTTR_Mods_API::write_exception_report.