mirror of
https://github.com/open-simh/simh.git
synced 2026-02-27 09:19:51 +00:00
VIDEO: Add API for querying and setting fullscreen mode.
This commit is contained in:
26
sim_video.c
26
sim_video.c
@@ -1404,6 +1404,20 @@ if (SDL_SemWait (vid_mouse_events.sem) == 0) {
|
||||
}
|
||||
}
|
||||
|
||||
t_bool vid_is_fullscreen (void)
|
||||
{
|
||||
return SDL_GetWindowFlags (vid_window) & SDL_WINDOW_FULLSCREEN_DESKTOP;
|
||||
}
|
||||
|
||||
t_stat vid_set_fullscreen (t_bool flag)
|
||||
{
|
||||
if (flag)
|
||||
SDL_SetWindowFullscreen (vid_window, SDL_WINDOW_FULLSCREEN_DESKTOP);
|
||||
else
|
||||
SDL_SetWindowFullscreen (vid_window, 0);
|
||||
return SCPE_OK;
|
||||
}
|
||||
|
||||
void vid_update (void)
|
||||
{
|
||||
SDL_Rect vid_dst;
|
||||
@@ -2368,4 +2382,16 @@ t_stat vid_screenshot (const char *filename)
|
||||
sim_printf ("video support unavailable\n");
|
||||
return SCPE_NOFNC|SCPE_NOMESSAGE;
|
||||
}
|
||||
|
||||
t_bool vid_is_fullscreen (void)
|
||||
{
|
||||
sim_printf ("video support unavailable\n");
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
t_stat vid_set_fullscreen (t_bool flag)
|
||||
{
|
||||
sim_printf ("video support unavailable\n");
|
||||
return SCPE_OK;
|
||||
}
|
||||
#endif /* defined(USE_SIM_VIDEO) */
|
||||
|
||||
@@ -198,6 +198,8 @@ t_stat vid_show_release_key (FILE* st, UNIT* uptr, int32 val, CONST void* desc);
|
||||
t_stat vid_show_video (FILE* st, UNIT* uptr, int32 val, CONST void* desc);
|
||||
t_stat vid_show (FILE* st, DEVICE *dptr, UNIT* uptr, int32 val, CONST char* desc);
|
||||
t_stat vid_screenshot (const char *filename);
|
||||
t_bool vid_is_fullscreen (void);
|
||||
t_stat vid_set_fullscreen (t_bool flag);
|
||||
|
||||
extern t_bool vid_active;
|
||||
void vid_set_cursor_position (int32 x, int32 y); /* cursor position (set by calling code) */
|
||||
|
||||
Reference in New Issue
Block a user