summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/gui/gui.zig26
1 files changed, 3 insertions, 23 deletions
diff --git a/src/gui/gui.zig b/src/gui/gui.zig
index 18cb8b7b..9fd22e3f 100644
--- a/src/gui/gui.zig
+++ b/src/gui/gui.zig
@@ -2015,15 +2015,9 @@ fn runNative(init: std.process.Init, opts_in: pardes.Options, headless: bool, di
defer c.SDL_DestroyGPUDevice(device);
var soft_present = false;
var soft_renderer: ?*c.SDL_Renderer = null;
- const force_soft = if (env.get("PARDES_SOFT_PRESENT")) |raw|
- !(std.mem.eql(u8, raw, "0") or raw.len == 0)
- else
- false;
- if (surface_opacity or force_soft or !c.SDL_ClaimWindowForGPUDevice(device, window)) {
+ if (surface_opacity or !c.SDL_ClaimWindowForGPUDevice(device, window)) {
if (surface_opacity)
log.info("transparent window: the GPU API will not claim one, presenting through SDL_Renderer", .{})
- else if (force_soft)
- log.info("PARDES_SOFT_PRESENT set: presenting in software", .{})
else
log.warn("ClaimWindowForGPUDevice: {s}; presenting in software", .{c.SDL_GetError()});
soft_renderer = c.SDL_CreateRenderer(window, null) orelse {
@@ -2034,17 +2028,6 @@ fn runNative(init: std.process.Init, opts_in: pardes.Options, headless: bool, di
}
const present_mode: c.SDL_GPUPresentMode = blk: {
if (soft_present) break :blk c.SDL_GPU_PRESENTMODE_VSYNC;
- if (env.get("PARDES_SDL_PRESENT")) |raw| {
- const want: ?c.SDL_GPUPresentMode = if (std.ascii.eqlIgnoreCase(raw, "immediate"))
- c.SDL_GPU_PRESENTMODE_IMMEDIATE
- else if (std.ascii.eqlIgnoreCase(raw, "mailbox"))
- c.SDL_GPU_PRESENTMODE_MAILBOX
- else if (std.ascii.eqlIgnoreCase(raw, "vsync"))
- c.SDL_GPU_PRESENTMODE_VSYNC
- else
- null;
- if (want) |mode| if (c.SDL_WindowSupportsGPUPresentMode(device, window, mode)) break :blk mode;
- }
for ([_]c.SDL_GPUPresentMode{ c.SDL_GPU_PRESENTMODE_IMMEDIATE, c.SDL_GPU_PRESENTMODE_MAILBOX, c.SDL_GPU_PRESENTMODE_VSYNC }) |mode| {
if (c.SDL_WindowSupportsGPUPresentMode(device, window, mode)) break :blk mode;
}
@@ -2071,11 +2054,8 @@ fn runNative(init: std.process.Init, opts_in: pardes.Options, headless: bool, di
font_allocator = gpa;
// A harness forcing a density (PARDES_TEST_SCALE) draws the text as a
// person on that display would size it, so its chrome is seen at the
- // proportion it has there; PARDES_TEST_FONT_SCALE sizes the text alone
- // (a density's text with 1x chrome: how it looked before dp). A live
- // window keeps the size the user sets.
- const font_scale: f32 = if (env.get("PARDES_TEST_FONT_SCALE")) |v| std.fmt.parseFloat(f32, v) catch display_scale else display_scale;
- const px: f32 = if (test_mode) 27.0 * std.math.clamp(font_scale, 1, 4) else 27.0;
+ // proportion it has there. A live window keeps the size the user sets.
+ const px: f32 = if (test_mode) 27.0 * std.math.clamp(display_scale, 1, 4) else 27.0;
var cw: c_int = 10;
var chh: c_int = 20;
var asc: c_int = 16;