Add a capability for fullscreen-only video drivers

main
Cameron Cawley 2024-04-12 13:30:53 +01:00 committed by Sam Lantinga
parent 6b9a8f0da1
commit d760f16ba6
4 changed files with 12 additions and 4 deletions

View File

@ -156,7 +156,8 @@ typedef enum
{
VIDEO_DEVICE_CAPS_MODE_SWITCHING_EMULATED = 0x01,
VIDEO_DEVICE_CAPS_HAS_POPUP_WINDOW_SUPPORT = 0x02,
VIDEO_DEVICE_CAPS_SENDS_FULLSCREEN_DIMENSIONS = 0x04
VIDEO_DEVICE_CAPS_SENDS_FULLSCREEN_DIMENSIONS = 0x04,
VIDEO_DEVICE_CAPS_FULLSCREEN_ONLY = 0x08
} DeviceCaps;
struct SDL_VideoDevice

View File

@ -179,6 +179,11 @@ static SDL_bool SDL_SendsFullscreenDimensions(SDL_VideoDevice *_this)
return !!(_this->device_caps & VIDEO_DEVICE_CAPS_SENDS_FULLSCREEN_DIMENSIONS);
}
static SDL_bool IsFullscreenOnly(SDL_VideoDevice *_this)
{
return !!(_this->device_caps & VIDEO_DEVICE_CAPS_FULLSCREEN_ONLY);
}
/* Hint to treat all window ops as synchronous */
static SDL_bool syncHint;
@ -2135,7 +2140,7 @@ SDL_Window *SDL_CreateWindowWithProperties(SDL_PropertiesID props)
window->undefined_x = undefined_x;
window->undefined_y = undefined_y;
if (flags & SDL_WINDOW_FULLSCREEN) {
if (flags & SDL_WINDOW_FULLSCREEN || IsFullscreenOnly(_this)) {
SDL_VideoDisplay *display = SDL_GetVideoDisplayForWindow(window);
SDL_Rect bounds;
@ -2144,6 +2149,7 @@ SDL_Window *SDL_CreateWindowWithProperties(SDL_PropertiesID props)
window->y = bounds.y;
window->w = bounds.w;
window->h = bounds.h;
flags |= SDL_WINDOW_FULLSCREEN;
}
window->flags = ((flags & CREATE_FLAGS) | SDL_WINDOW_HIDDEN);

View File

@ -87,6 +87,9 @@ static SDL_VideoDevice *RISCOS_CreateDevice(void)
device->free = RISCOS_DeleteDevice;
/* TODO: Support windowed mode */
device->device_caps = VIDEO_DEVICE_CAPS_FULLSCREEN_ONLY;
return device;
}

View File

@ -38,8 +38,6 @@ int RISCOS_CreateWindow(SDL_VideoDevice *_this, SDL_Window *window, SDL_Properti
}
driverdata->window = window;
window->flags |= SDL_WINDOW_FULLSCREEN;
SDL_SetMouseFocus(window);
/* All done! */