102 Patches: Detours to the Rescue
C reference for DttR maintainers and modders.
Loading...
Searching...
No Matches
gui_tab_graphics.c
Go to the documentation of this file.
1#include "gui_internal.h"
2
3static const char *const GRAPHICS_API_TOOLTIPS[] = {
4 "Auto-selects the best available graphics backend.",
5 "Vulkan graphics backend.",
6 "Direct3D 12 graphics backend.",
7 "OpenGL graphics backend.",
8};
9
10static const char *const SCALING_FIT_TOOLTIPS[] = {
11 "Preserves aspect ratio and adds bars as needed.",
12 "Fills the whole window even if the image is distorted.",
13 "Whole-number scaling with aspect ratio preserved.",
14};
15
16static const char *const SCALING_METHOD_TOOLTIPS[] = {
17 "Preserves the game's native resolution and scales finished frames.",
18 "Scales inputs in render calls to render at a higher resolution.",
19};
20
21static const char *const PRESENT_FILTER_TOOLTIPS[] = {
22 "Nearest-neighbor sampling for presented frames.",
23 "Linear filtering for presented frames.",
24};
25
26static const char *const VERTEX_PRECISION_TOOLTIPS[] = {
27 "Game's original vertex coordinate precision.",
28 "Subpixel vertex coordinates for smoother 3D movement.\n\nNOTE: Subpixel mode "
29 "may make certain seams between polygons on the puppy models visible at higher "
30 "resolutions.",
31};
32
33static const char *TOOLTIP_GRAPHICS_API = "GPU backend. Default: auto.";
34static const char *TOOLTIP_WINDOW_WIDTH = "Initial game window width in pixels. Default: "
35 "640.";
36static const char *TOOLTIP_WINDOW_HEIGHT = "Initial game window height in pixels. "
37 "Default: 480.";
38static const char *TOOLTIP_SCALING_FIT = "Fit mode for the game image. Default: "
39 "letterbox.";
40static const char *TOOLTIP_SCALING_METHOD = "Scaling mode when the window is larger than "
41 "the game resolution. Default: logical.";
42static const char *TOOLTIP_PRESENT_FILTER = "Filter used when presenting scaled frames. "
43 "Default: linear.";
44static const char *TOOLTIP_VERTEX_PRECISION = "Vertex coordinate precision during 3D "
45 "rendering. Default: native.";
46static const char *TOOLTIP_SPRITE_SMOOTH = "Smooth 2D Sprites; disable for "
47 "nearest-neighbor. Default: true.";
48static const char *TOOLTIP_MSAA_SAMPLES = "Multisample anti-aliasing samples. Set to 1 "
49 "to disable. Default: 2.";
50static const char *TOOLTIP_TEXTURE_UPLOAD_SYNC = "Wait for each texture upload before "
51 "continuing. Default: false.";
53 = "Generate mipmaps for textures to reduce aliasing at smaller sizes. Default: true.";
54static const char *TOOLTIP_FULLSCREEN = "Start in fullscreen. F11 toggles at runtime. "
55 "Default: false.";
56
59 ctx,
60 "##graphics_settings_table",
62 )) {
63 return;
64 }
65
67 ctx,
68 "Graphics API",
69 "##graphics_api",
70 (int *)&state->config.graphics_api,
74 FIELD_LABEL_STATE(state, graphics_api)
75 );
77 ctx,
78 "Window Width",
79 "##window_width",
80 &state->config.window_width,
81 1,
82 100,
84 FIELD_LABEL_STATE(state, window_width)
85 );
87 ctx,
88 "Window Height",
89 "##window_height",
90 &state->config.window_height,
91 1,
92 100,
94 FIELD_LABEL_STATE(state, window_height)
95 );
97 ctx,
98 "Scaling Fit",
99 "##scaling_fit",
100 (int *)&state->config.scaling_fit,
104 FIELD_LABEL_STATE(state, scaling_fit)
105 );
107 ctx,
108 "Scaling Method",
109 "##scaling_method",
110 (int *)&state->config.scaling_method,
114 FIELD_LABEL_STATE(state, scaling_method)
115 );
117 ctx,
118 "Present Scaling Algorithm",
119 "##present_filter",
120 (int *)&state->config.present_filter,
124 FIELD_LABEL_STATE(state, present_filter)
125 );
127 ctx,
128 "Vertex Precision",
129 "##vertex_precision",
130 (int *)&state->config.vertex_precision,
134 FIELD_LABEL_STATE(state, vertex_precision)
135 );
137 ctx,
138 "Smooth 2D Sprites",
139 "##sprite_smooth",
140 &state->config.sprite_smooth,
142 FIELD_LABEL_STATE(state, sprite_smooth)
143 );
145 ctx,
146 "MSAA Samples",
147 "##msaa_samples",
148 &state->config.msaa_samples,
149 1,
150 4,
152 FIELD_LABEL_STATE(state, msaa_samples)
153 );
155 ctx,
156 "Texture Upload Sync",
157 "##texture_upload_sync",
158 &state->config.texture_upload_sync,
160 FIELD_LABEL_STATE(state, texture_upload_sync)
161 );
163 ctx,
164 "Generate Texture Mipmaps",
165 "##generate_texture_mipmaps",
166 &state->config.generate_texture_mipmaps,
168 FIELD_LABEL_STATE(state, generate_texture_mipmaps)
169 );
171 ctx,
172 "Fullscreen",
173 "##fullscreen",
174 &state->config.fullscreen,
176 FIELD_LABEL_STATE(state, fullscreen)
177 );
179}
const DTTR_BackendState * state
void void * ctx
@ DTTR_CONFIG_CHOICES_GRAPHICS_API
@ DTTR_CONFIG_CHOICES_SCALING_FIT
@ DTTR_CONFIG_CHOICES_SCALING_METHOD
@ DTTR_CONFIG_CHOICES_PRESENT_FILTER
@ DTTR_CONFIG_CHOICES_VERTEX_PRECISION
bool labeled_input_int(const DTTR_ImGuiDialogContext *ctx, const char *label, const char *id, int *value, int step, int step_fast, const char *tooltip, config_label_state label_state)
bool labeled_checkbox(const DTTR_ImGuiDialogContext *ctx, const char *label, const char *id, bool *value, const char *tooltip, config_label_state label_state)
void end_settings_table()
#define FIELD_LABEL_STATE(state, field)
#define DTTR_CONFIG_UI_INPUT_W
bool begin_tab_settings_table(const DTTR_ImGuiDialogContext *ctx, const char *id, float input_width)
Definition gui_tabs.c:13
bool labeled_choice_combo(const DTTR_ImGuiDialogContext *ctx, const char *label, const char *id, int *value, DTTR_ConfigChoiceList choices, const char *const *tooltips, const char *tooltip, config_label_state label_state)
static const char *const VERTEX_PRECISION_TOOLTIPS[]
static const char * TOOLTIP_SPRITE_SMOOTH
static const char * TOOLTIP_WINDOW_HEIGHT
static const char * TOOLTIP_WINDOW_WIDTH
static const char *const SCALING_METHOD_TOOLTIPS[]
static const char * TOOLTIP_PRESENT_FILTER
static const char * TOOLTIP_MSAA_SAMPLES
static const char * TOOLTIP_SCALING_METHOD
static const char * TOOLTIP_GENERATE_TEXTURE_MIPMAPS
static const char * TOOLTIP_SCALING_FIT
static const char *const PRESENT_FILTER_TOOLTIPS[]
static const char * TOOLTIP_FULLSCREEN
static const char *const GRAPHICS_API_TOOLTIPS[]
static const char * TOOLTIP_TEXTURE_UPLOAD_SYNC
static const char * TOOLTIP_VERTEX_PRECISION
static const char * TOOLTIP_GRAPHICS_API
static const char *const SCALING_FIT_TOOLTIPS[]
void draw_graphics_tab(const DTTR_ImGuiDialogContext *ctx, config_ui_state *state)