21#define DTTR_MODS_EXCEPTION_REPORT_STACK_TRACE_CAPACITY 16384u
204#define DTTR_MODS_LOG_LVL_TRACE 0
205#define DTTR_MODS_LOG_LVL_DEBUG 1
206#define DTTR_MODS_LOG_LVL_INFO 2
207#define DTTR_MODS_LOG_LVL_WARN 3
208#define DTTR_MODS_LOG_LVL_ERROR 4
209#define DTTR_MODS_LOG_LVL_FATAL 5
211#define DTTR_MODS_LOG(ctx, level, ...) \
213 if ((ctx)->api->log_is_enabled(level)) { \
214 (ctx)->api->log_unchecked(level, __FILE__, __LINE__, __VA_ARGS__); \
217#define DTTR_MODS_LOG_TRACE(ctx, ...) \
218 DTTR_MODS_LOG(ctx, DTTR_MODS_LOG_LVL_TRACE, __VA_ARGS__)
219#define DTTR_MODS_LOG_DEBUG(ctx, ...) \
220 DTTR_MODS_LOG(ctx, DTTR_MODS_LOG_LVL_DEBUG, __VA_ARGS__)
221#define DTTR_MODS_LOG_INFO(ctx, ...) \
222 DTTR_MODS_LOG(ctx, DTTR_MODS_LOG_LVL_INFO, __VA_ARGS__)
223#define DTTR_MODS_LOG_WARN(ctx, ...) \
224 DTTR_MODS_LOG(ctx, DTTR_MODS_LOG_LVL_WARN, __VA_ARGS__)
225#define DTTR_MODS_LOG_ERROR(ctx, ...) \
226 DTTR_MODS_LOG(ctx, DTTR_MODS_LOG_LVL_ERROR, __VA_ARGS__)
227#define DTTR_MODS_LOG_FATAL(ctx, ...) \
228 DTTR_MODS_LOG(ctx, DTTR_MODS_LOG_LVL_FATAL, __VA_ARGS__)
233#define DTTR_EXPORT extern "C" __declspec(dllexport)
235#define DTTR_EXPORT __declspec(dllexport)
238#define DTTR_MODS_INFO(mod_name, mod_version, mod_author) \
239 static const DTTR_Mods_Info dttr_mod_info = { \
244 DTTR_EXPORT const DTTR_Mods_Info *DTTR_Mod_Info() { \
245 return &dttr_mod_info; \
254#define DTTR_MODS_INIT \
255 static bool dttr_mod_init(const DTTR_Mods_Context *); \
256 DTTR_EXPORT bool DTTR_Mod_Init(const DTTR_Mods_Context *ctx) { \
257 if (!DTTR_Mods_ContextIsCompatible(ctx)) { \
260 return dttr_mod_init(ctx); \
262 static bool dttr_mod_init(const DTTR_Mods_Context *ctx)
264#define DTTR_MODS_CLEANUP DTTR_EXPORT void DTTR_Mod_Cleanup()
265#define DTTR_MODS_TICK DTTR_EXPORT void DTTR_Mod_Tick()
266#define DTTR_MODS_LATE_INIT DTTR_EXPORT void DTTR_Mod_LateInit()
267#define DTTR_MODS_BEFORE_UNLOAD DTTR_EXPORT void DTTR_Mod_BeforeUnload()
271#define DTTR_MODS_FRAME_BEGIN \
272 DTTR_EXPORT void DTTR_Mod_FrameBegin(const DTTR_Mods_FrameContext *ctx)
277#define DTTR_MODS_BEFORE_GAME_FRAME \
278 DTTR_EXPORT void DTTR_Mod_BeforeGameFrame(const DTTR_Mods_FrameContext *ctx)
283#define DTTR_MODS_AFTER_GAME_FRAME \
284 DTTR_EXPORT void DTTR_Mod_AfterGameFrame(const DTTR_Mods_FrameContext *ctx)
289#define DTTR_MODS_BEFORE_PRESENT \
290 DTTR_EXPORT void DTTR_Mod_BeforePresent(const DTTR_Mods_PresentContext *ctx)
293#define DTTR_MODS_AFTER_PRESENT \
294 DTTR_EXPORT void DTTR_Mod_AfterPresent(const DTTR_Mods_PresentContext *ctx)
297#define DTTR_MODS_FRAME_END \
298 DTTR_EXPORT void DTTR_Mod_FrameEnd(const DTTR_Mods_FrameContext *ctx)
300#define DTTR_MODS_IMGUI_BEGIN \
301 DTTR_EXPORT void DTTR_Mod_ImGuiBegin(const DTTR_Mods_RenderContext *ctx)
303#define DTTR_MODS_IMGUI_END \
304 DTTR_EXPORT void DTTR_Mod_ImGuiEnd(const DTTR_Mods_RenderContext *ctx)
306#define DTTR_MODS_OVERLAY_VISIBLE_CHANGED \
307 DTTR_EXPORT void DTTR_Mod_OverlayVisibleChanged(bool visible)
309#define DTTR_MODS_WINDOW_CREATED \
310 DTTR_EXPORT void DTTR_Mod_WindowCreated(const DTTR_Mods_WindowContext *ctx)
312#define DTTR_MODS_WINDOW_RESIZED \
313 DTTR_EXPORT void DTTR_Mod_WindowResized(const DTTR_Mods_WindowContext *ctx)
315#define DTTR_MODS_WINDOW_DESTROYING \
316 DTTR_EXPORT void DTTR_Mod_WindowDestroying(const DTTR_Mods_WindowContext *ctx)
318#define DTTR_MODS_GRAPHICS_DEVICE_CREATED \
319 DTTR_EXPORT void DTTR_Mod_GraphicsDeviceCreated(const DTTR_Mods_GraphicsContext *ctx)
321#define DTTR_MODS_GRAPHICS_DEVICE_LOST \
322 DTTR_EXPORT void DTTR_Mod_GraphicsDeviceLost(const DTTR_Mods_GraphicsContext *ctx)
324#define DTTR_MODS_GRAPHICS_DEVICE_RESTORED \
325 DTTR_EXPORT void DTTR_Mod_GraphicsDeviceRestored(const DTTR_Mods_GraphicsContext *ctx)
327#define DTTR_MODS_GRAPHICS_DEVICE_DESTROYING \
328 DTTR_EXPORT void DTTR_Mod_GraphicsDeviceDestroying( \
329 const DTTR_Mods_GraphicsContext *ctx \
332#define DTTR_MODS_BEFORE_EVENT \
333 DTTR_EXPORT bool DTTR_Mod_BeforeEvent(const SDL_Event *event)
335#define DTTR_MODS_AFTER_EVENT \
336 DTTR_EXPORT void DTTR_Mod_AfterEvent(const SDL_Event *event, bool consumed)
338#define DTTR_MODS_INPUT_MODE_CHANGED \
339 DTTR_EXPORT void DTTR_Mod_InputModeChanged(const DTTR_Mods_InputContext *ctx)
342#define DTTR_MODS_EVENT DTTR_EXPORT bool DTTR_Mod_Event(const SDL_Event *event)
345#define DTTR_MODS_RENDER_GAME \
346 DTTR_EXPORT void DTTR_Mod_RenderGame(const DTTR_Mods_RenderGameContext *ctx)
349#define DTTR_MODS_RENDER \
350 DTTR_EXPORT void DTTR_Mod_Render(const DTTR_Mods_RenderContext *ctx)
353#define DTTR_MODS_SHOULD_ADVANCE_GAME_FRAME \
354 DTTR_EXPORT bool DTTR_Mod_ShouldAdvanceGameFrame()
357#define DTTR_MODS_GAME_FRAME_ADVANCED DTTR_EXPORT void DTTR_Mod_GameFrameAdvanced()
360#define DTTR_MODS_GAME_FRAME_BLOCKED DTTR_EXPORT void DTTR_Mod_GameFrameBlocked()
void void DWORD HANDLE event
DTTR_Graphics_COM_DirectDrawSurface7 DWORD flags void NULL
void(* DTTR_Mods_WindowResizedFn)(const DTTR_Mods_WindowContext *ctx)
void(* DTTR_Mods_ImGuiBeginFn)(const DTTR_Mods_RenderContext *ctx)
void(* DTTR_Mods_AfterEventFn)(const SDL_Event *event, bool consumed)
void(* DTTR_Mods_GraphicsDeviceDestroyingFn)(const DTTR_Mods_GraphicsContext *ctx)
void(* DTTR_Mods_GraphicsDeviceLostFn)(const DTTR_Mods_GraphicsContext *ctx)
void(* DTTR_Mods_CleanupFn)()
union SDL_Event SDL_Event
void(* DTTR_Mods_BeforePresentFn)(const DTTR_Mods_PresentContext *ctx)
struct SDL_Window SDL_Window
void(* DTTR_Mods_FrameBeginFn)(const DTTR_Mods_FrameContext *ctx)
bool(* DTTR_Mods_WriteExceptionReportFn)(const DTTR_Mods_ExceptionReportRequest *request, DTTR_Mods_ExceptionReport *report)
void(* DTTR_Mods_GraphicsDeviceCreatedFn)(const DTTR_Mods_GraphicsContext *ctx)
#define DTTR_MODS_EXCEPTION_REPORT_STACK_TRACE_CAPACITY
void(* DTTR_Mods_BeforeGameFrameFn)(const DTTR_Mods_FrameContext *ctx)
bool(* DTTR_Mods_EventFn)(const SDL_Event *event)
bool(* DTTR_Mods_InitFn)(const DTTR_Mods_Context *ctx)
void(* DTTR_Mods_AfterGameFrameFn)(const DTTR_Mods_FrameContext *ctx)
void(* DTTR_Mods_TickFn)()
void(* DTTR_Mods_ImGuiEndFn)(const DTTR_Mods_RenderContext *ctx)
void(* DTTR_Mods_BeforeUnloadFn)()
void(* DTTR_Mods_InputModeChangedFn)(const DTTR_Mods_InputContext *ctx)
void(* DTTR_Mods_OverlayVisibleChangedFn)(bool visible)
void(* DTTR_Mods_GameFrameAdvancedFn)()
DTTR_Mods_GraphicsBackend
@ DTTR_MODS_GRAPHICS_BACKEND_UNKNOWN
@ DTTR_MODS_GRAPHICS_BACKEND_SDL_GPU
@ DTTR_MODS_GRAPHICS_BACKEND_OPENGL
bool(* DTTR_Mods_BeforeEventFn)(const SDL_Event *event)
static bool DTTR_Mods_ContextIsCompatible(const DTTR_Mods_Context *ctx)
void(* DTTR_Mods_AfterPresentFn)(const DTTR_Mods_PresentContext *ctx)
void(* DTTR_Mods_GraphicsDeviceRestoredFn)(const DTTR_Mods_GraphicsContext *ctx)
void(* DTTR_Mods_WindowCreatedFn)(const DTTR_Mods_WindowContext *ctx)
bool(* DTTR_Mods_ShouldAdvanceGameFrameFn)()
void(* DTTR_Mods_FrameEndFn)(const DTTR_Mods_FrameContext *ctx)
void(* DTTR_Mods_RenderFn)(const DTTR_Mods_RenderContext *ctx)
static DTTR_Mods_WriteExceptionReportFn DTTR_Mods_GetWriteExceptionReportFn(const DTTR_Mods_API *api)
void(* DTTR_Mods_LateInitFn)()
void(* DTTR_Mods_GameFrameBlockedFn)()
void(* DTTR_Mods_WindowDestroyingFn)(const DTTR_Mods_WindowContext *ctx)
bool(* DTTR_Mods_LogIsEnabledFn)(int level)
void(* DTTR_Mods_LogFn)(int level, const char *file, int line, const char *fmt,...)
void(* DTTR_Mods_RenderGameFn)(const DTTR_Mods_RenderGameContext *ctx)
#define DTTR_SDK_ABI_VERSION
DTTR_Mods_LogFn log_unchecked
DTTR_Mods_LogIsEnabledFn log_is_enabled
DTTR_Mods_WriteExceptionReportFn write_exception_report
DTTR_Core_Context runtime
const DTTR_Mods_API * api
EXCEPTION_RECORD exception_record
char stack_trace[DTTR_MODS_EXCEPTION_REPORT_STACK_TRACE_CAPACITY]
DTTR_Mods_GraphicsBackend backend