|
102 Patches: Detours to the Rescue
C reference for DttR maintainers and modders.
|
#include "graphics_private.h"#include "hooks_private.h"#include <dttr_config.h>#include <dttr_errors.h>#include <dttr_log.h>#include <dttr_sdl.h>#include <stddef.h>#include <windows.h>#include "sds.h"#include "sidecar_private.h"Go to the source code of this file.
Data Structures | |
| struct | backend_candidate |
| struct | backend_range |
Macros | |
| #define | DTTR_MIN_WINDOW_DIM 64 |
| #define | BACKEND_COUNT SDL_arraysize(backend_candidates) |
| #define | IDX_SDL_GPU 0 |
| #define | IDX_OPENGL 1 |
Variables | |
| static const backend_candidate | backend_candidates [] |
| static sds | window_title = NULL |
| #define BACKEND_COUNT SDL_arraysize(backend_candidates) |
Definition at line 19 of file graphics.c.
Referenced by select_backend_range().
| #define DTTR_MIN_WINDOW_DIM 64 |
Definition at line 18 of file graphics.c.
Referenced by clamp_dim(), and dttr_graphics_handle_window_resize().
| #define IDX_OPENGL 1 |
Definition at line 32 of file graphics.c.
Referenced by select_backend_range().
| #define IDX_SDL_GPU 0 |
Definition at line 31 of file graphics.c.
Referenced by select_backend_range().
|
static |
Definition at line 70 of file graphics.c.
References DTTR_MIN_WINDOW_DIM.
Referenced by dttr_graphics_init(), dttr_graphics_set_logical_resolution(), and select_render_resolution().
|
static |
Definition at line 457 of file graphics.c.
References dttr_graphics_mod_window_destroying(), NULL, and state.
Referenced by dttr_graphics_cleanup(), and dttr_graphics_init().
| void dttr_graphics_begin_frame | ( | ) |
Definition at line 599 of file graphics.c.
References dttr_backend, and state.
Referenced by d3d_device7_record_clear(), and tick_main_loop().
| void dttr_graphics_cleanup | ( | ) |
Definition at line 638 of file graphics.c.
References destroy_window(), dttr_backend, dttr_graphics_mod_device_destroying(), dttr_graphics_mod_device_lost(), dttr_graphics_surface_texture_cache_reset(), NULL, and state.
Referenced by cleanup_runtime().
| void dttr_graphics_end_frame | ( | ) |
Definition at line 610 of file graphics.c.
References dttr_backend, and state.
Referenced by surface_present(), and tick_main_loop().
| SDL_GPUDevice * dttr_graphics_get_device | ( | ) |
Definition at line 583 of file graphics.c.
References dttr_backend.
Referenced by DTTR_Hook_WinMainCallback().
| SDL_Window * dttr_graphics_get_window | ( | ) |
Definition at line 578 of file graphics.c.
References dttr_backend.
Referenced by DTTR_Hook_WinMainCallback(), and kvec_t().
| void dttr_graphics_handle_window_resize | ( | int | width, |
| int | height ) |
Definition at line 588 of file graphics.c.
References dttr_backend, dttr_graphics_mod_window_resized(), DTTR_MIN_WINDOW_DIM, refresh_render_resolution(), and update_window_title().
Referenced by dttr_sidecar_handle_sdl_event().
| HWND dttr_graphics_init | ( | ) |
Definition at line 482 of file graphics.c.
References backend_candidates, clamp_dim(), destroy_window(), dttr_backend, dttr_config, DTTR_Config_GraphicsAPIName(), DTTR_Errors_ShowMessage(), DTTR_GRAPHICS_API_AUTO, dttr_graphics_mod_device_created(), dttr_graphics_mod_device_restored(), dttr_graphics_mod_window_created(), DTTR_LOG_ERROR, DTTR_LOG_WARN, backend_range::end, get_hwnd(), init_common_state(), NULL, select_backend_range(), select_render_resolution(), backend_range::start, state, update_window_title(), WINDOW_HEIGHT, and WINDOW_WIDTH.
Referenced by dttr_graphics_hooks_init(), and DTTR_Hook_WinMainCallback().
| void dttr_graphics_mod_present_rect_after | ( | DTTR_BackendState * | state, |
| const DTTR_PresentRect * | present, | ||
| bool | overlay_rendered ) |
Definition at line 439 of file graphics.c.
References dttr_graphics_mod_after_present(), DTTR_PresentRect::h, state, DTTR_PresentRect::w, DTTR_PresentRect::x, and DTTR_PresentRect::y.
Referenced by end_frame(), and end_frame().
| void dttr_graphics_mod_present_rect_before | ( | DTTR_BackendState * | state, |
| const DTTR_PresentRect * | present ) |
Definition at line 424 of file graphics.c.
References dttr_graphics_mod_before_present(), DTTR_PresentRect::h, state, DTTR_PresentRect::w, DTTR_PresentRect::x, and DTTR_PresentRect::y.
Referenced by end_frame(), and end_frame().
| bool dttr_graphics_present_video_frame_bgra | ( | const uint8_t * | pixels, |
| int | width, | ||
| int | height, | ||
| int | stride ) |
Definition at line 621 of file graphics.c.
References dttr_backend, state, and stride.
Referenced by dttr_movies_tick().
| void dttr_graphics_set_logical_resolution | ( | int | width, |
| int | height ) |
Definition at line 562 of file graphics.c.
References clamp_dim(), dttr_backend, refresh_render_resolution(), state, WINDOW_HEIGHT, and WINDOW_WIDTH.
|
static |
|
static |
Definition at line 141 of file graphics.c.
References DTTR_BLEND_ZERO, DTTR_D3DTA_DIFFUSE, DTTR_D3DTA_TEXTURE, DTTR_D3DTOP_MODULATE, DTTR_D3DTOP_SELECTARG1, dttr_graphics_mat4_identity(), dttr_graphics_surface_texture_cache_reset(), DTTR_TEXADDR_WRAP, and state.
Referenced by dttr_graphics_init().
|
static |
Definition at line 126 of file graphics.c.
References DTTR_LOG_WARN, select_render_resolution(), and state.
Referenced by dttr_graphics_handle_window_resize(), and dttr_graphics_set_logical_resolution().
|
static |
Definition at line 469 of file graphics.c.
References BACKEND_COUNT, DTTR_GRAPHICS_API_AUTO, DTTR_GRAPHICS_API_OPENGL, IDX_OPENGL, and IDX_SDL_GPU.
Referenced by dttr_graphics_init().
|
static |
Definition at line 76 of file graphics.c.
References clamp_dim(), dttr_config, DTTR_SCALING_METHOD_LOGICAL, DTTR_SCALING_MODE_STRETCH, state, WINDOW_HEIGHT, and WINDOW_WIDTH.
Referenced by dttr_graphics_init(), and refresh_render_resolution().
|
static |
Definition at line 42 of file graphics.c.
References DTTR_VERSION, h, state, w, and window_title.
Referenced by dttr_graphics_handle_window_resize(), and dttr_graphics_init().
|
static |
Definition at line 26 of file graphics.c.
Referenced by dttr_graphics_init().
|
static |
Definition at line 34 of file graphics.c.
Referenced by DTTR_ImGui_ErrorShow(), DTTR_LoaderUI_ShowError(), and update_window_title().