Skip to content

Commit 7392718

Browse files
committed
vdisp/sdl3: add show_cursor
1 parent 99355fc commit 7392718

1 file changed

Lines changed: 8 additions & 2 deletions

File tree

src/video_display/sdl3.c

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,7 @@ struct state_sdl3 {
164164
SDL_Renderer *renderer;
165165

166166
struct dictionary *hints;
167+
bool show_cursor;
167168
bool fs;
168169
enum deint deinterlace;
169170
bool keep_aspect;
@@ -502,7 +503,7 @@ show_help(const char *driver, bool full)
502503
color_printf(TBOLD(TRED(
503504
"\t-d sdl") "[[:fs|:d|:display=<d>|:driver=<drv>|:novsync|:"
504505
"renderer=<name[s]>|:nodecorate|:size[=WxH]|:window_"
505-
"flags=<f>|:keep-aspect]*]") "\n");
506+
"flags=<f>|:keep-aspect|:show_cursor]*]") "\n");
506507
color_printf(TBOLD(
507508
"\t-d sdl[:driver=<drv>]:[full]help") "\n");
508509
printf("where:\n");
@@ -523,6 +524,7 @@ show_help(const char *driver, bool full)
523524
"respective to the video\n");
524525
color_printf(TBOLD(" novsync") " - disable sync on VBlank\n");
525526
color_printf(TBOLD(" nodecorate") " - disable window border\n");
527+
color_printf(TBOLD(" show_cursor") " - do not hide cursor\n");
526528
color_printf(
527529
TBOLD(" size") " - window size in pixels with optional "
528530
"position\n"
@@ -1071,6 +1073,8 @@ display_sdl3_init(struct module *parent, const char *fmt, unsigned int flags)
10711073
s->req_blend_mode = SDL_BLENDMODE_BLEND;
10721074
} else if (IS_KEY_PREFIX(tok, "hint") && strchr(tok, '=') != strrchr(tok, '=')) {
10731075
dictionary_insert2(s->hints, strchr(tok, '=') + 1);
1076+
} else if (IS_PREFIX(tok, "show_cursor")) {
1077+
s->show_cursor = true;
10741078
} else {
10751079
MSG(ERROR, "Wrong option: %s\n", tok);
10761080
free(s);
@@ -1110,7 +1114,9 @@ display_sdl3_init(struct module *parent, const char *fmt, unsigned int flags)
11101114
}
11111115
MSG(NOTICE, "Using driver: %s\n", SDL_GetCurrentVideoDriver());
11121116

1113-
SDL_CHECK(SDL_HideCursor());
1117+
if (!s->show_cursor) {
1118+
SDL_CHECK(SDL_HideCursor());
1119+
}
11141120
SDL_CHECK(SDL_DisableScreenSaver());
11151121

11161122
module_init_default(&s->mod);

0 commit comments

Comments
 (0)