mirror of
https://github.com/libsdl-org/SDL.git
synced 2025-09-05 19:08:12 +00:00
Add a quirk for fullscreen-only video drivers
This commit is contained in:

committed by
Sam Lantinga

parent
4c3b8b2b93
commit
596096a86a
@@ -155,6 +155,7 @@ typedef enum
|
||||
{
|
||||
VIDEO_DEVICE_QUIRK_DISABLE_DISPLAY_MODE_SWITCHING = 0x01,
|
||||
VIDEO_DEVICE_QUIRK_DISABLE_UNSET_FULLSCREEN_ON_MINIMIZE = 0x02,
|
||||
VIDEO_DEVICE_QUIRK_FULLSCREEN_ONLY = 0x04,
|
||||
} DeviceQuirkFlags;
|
||||
|
||||
struct SDL_VideoDevice
|
||||
|
@@ -188,6 +188,11 @@ static SDL_bool DisableUnsetFullscreenOnMinimize(_THIS)
|
||||
return !!(_this->quirk_flags & VIDEO_DEVICE_QUIRK_DISABLE_UNSET_FULLSCREEN_ON_MINIMIZE);
|
||||
}
|
||||
|
||||
static SDL_bool IsFullscreenOnly(_THIS)
|
||||
{
|
||||
return !!(_this->quirk_flags & VIDEO_DEVICE_QUIRK_FULLSCREEN_ONLY);
|
||||
}
|
||||
|
||||
/* Support for framebuffer emulation using an accelerated renderer */
|
||||
|
||||
#define SDL_WINDOWTEXTUREDATA "_SDL_WindowTextureData"
|
||||
@@ -1752,7 +1757,7 @@ SDL_Window *SDL_CreateWindow(const char *title, int x, int y, int w, int h, Uint
|
||||
window->windowed.w = window->w;
|
||||
window->windowed.h = window->h;
|
||||
|
||||
if (flags & SDL_WINDOW_FULLSCREEN) {
|
||||
if (flags & SDL_WINDOW_FULLSCREEN || IsFullscreenOnly(_this)) {
|
||||
SDL_VideoDisplay *display = SDL_GetDisplayForWindow(window);
|
||||
int displayIndex;
|
||||
SDL_Rect bounds;
|
||||
@@ -1779,6 +1784,7 @@ SDL_Window *SDL_CreateWindow(const char *title, int x, int y, int w, int h, Uint
|
||||
window->y = bounds.y;
|
||||
window->w = bounds.w;
|
||||
window->h = bounds.h;
|
||||
flags |= SDL_WINDOW_FULLSCREEN;
|
||||
}
|
||||
|
||||
window->flags = ((flags & CREATE_FLAGS) | SDL_WINDOW_HIDDEN);
|
||||
|
@@ -128,6 +128,7 @@ static SDL_VideoDevice *NACL_CreateDevice(void) {
|
||||
device->GL_SwapWindow = NACL_GLES_SwapWindow;
|
||||
device->GL_DeleteContext = NACL_GLES_DeleteContext;
|
||||
|
||||
device->quirk_flags = VIDEO_DEVICE_QUIRK_FULLSCREEN_ONLY;
|
||||
|
||||
return device;
|
||||
}
|
||||
|
@@ -45,7 +45,6 @@ int NACL_CreateWindow(_THIS, SDL_Window * window)
|
||||
window->h = driverdata->h;
|
||||
|
||||
window->flags &= ~SDL_WINDOW_RESIZABLE; /* window is NEVER resizeable */
|
||||
window->flags |= SDL_WINDOW_FULLSCREEN; /* window is always fullscreen */
|
||||
window->flags &= ~SDL_WINDOW_HIDDEN;
|
||||
window->flags |= SDL_WINDOW_SHOWN; /* only one window on NaCl */
|
||||
window->flags |= SDL_WINDOW_INPUT_FOCUS; /* always has input focus */
|
||||
|
@@ -90,6 +90,9 @@ static SDL_VideoDevice *RISCOS_CreateDevice(void)
|
||||
|
||||
device->free = RISCOS_DeleteDevice;
|
||||
|
||||
/* TODO: Support windowed mode */
|
||||
device->quirk_flags = VIDEO_DEVICE_QUIRK_FULLSCREEN_ONLY;
|
||||
|
||||
return device;
|
||||
}
|
||||
|
||||
|
@@ -41,8 +41,6 @@ int RISCOS_CreateWindow(_THIS, SDL_Window *window)
|
||||
}
|
||||
driverdata->window = window;
|
||||
|
||||
window->flags |= SDL_WINDOW_FULLSCREEN;
|
||||
|
||||
SDL_SetMouseFocus(window);
|
||||
|
||||
/* All done! */
|
||||
|
Reference in New Issue
Block a user