Removed SDL_HINT_VIDEO_EXTERNAL_CONTEXT
This is replaced with SDL_PROP_WINDOW_CREATE_EXTERNAL_GRAPHICS_CONTEXT in SDL_CreateWindowWithProperties()
This commit is contained in:
@@ -49,6 +49,7 @@ struct SDL_Window
|
||||
Uint32 flags;
|
||||
Uint32 pending_flags;
|
||||
float display_scale;
|
||||
SDL_bool external_graphics_context;
|
||||
SDL_bool fullscreen_exclusive; /* The window is currently fullscreen exclusive */
|
||||
SDL_DisplayID last_fullscreen_exclusive_display; /* The last fullscreen_exclusive display */
|
||||
SDL_DisplayID last_displayID;
|
||||
@@ -487,7 +488,6 @@ extern VideoBootStrap QNX_bootstrap;
|
||||
/* Use SDL_OnVideoThread() sparingly, to avoid regressions in use cases that currently happen to work */
|
||||
extern SDL_bool SDL_OnVideoThread(void);
|
||||
extern SDL_VideoDevice *SDL_GetVideoDevice(void);
|
||||
extern SDL_bool SDL_IsVideoContextExternal(void);
|
||||
extern void SDL_SetSystemTheme(SDL_SystemTheme theme);
|
||||
extern SDL_DisplayID SDL_AddBasicVideoDisplay(const SDL_DisplayMode *desktop_mode);
|
||||
extern SDL_DisplayID SDL_AddVideoDisplay(const SDL_VideoDisplay *display, SDL_bool send_event);
|
||||
|
||||
@@ -627,11 +627,6 @@ SDL_bool SDL_OnVideoThread(void)
|
||||
return (_this && SDL_GetCurrentThreadID() == _this->thread);
|
||||
}
|
||||
|
||||
SDL_bool SDL_IsVideoContextExternal(void)
|
||||
{
|
||||
return SDL_GetHintBoolean(SDL_HINT_VIDEO_EXTERNAL_CONTEXT, SDL_FALSE);
|
||||
}
|
||||
|
||||
void SDL_SetSystemTheme(SDL_SystemTheme theme)
|
||||
{
|
||||
if (_this && theme != _this->system_theme) {
|
||||
@@ -2005,6 +2000,7 @@ SDL_Window *SDL_CreateWindowWithProperties(SDL_PropertiesID props)
|
||||
Uint32 type_flags, graphics_flags;
|
||||
SDL_bool undefined_x = SDL_FALSE;
|
||||
SDL_bool undefined_y = SDL_FALSE;
|
||||
SDL_bool external_graphics_context = SDL_GetBooleanProperty(props, SDL_PROP_WINDOW_CREATE_EXTERNAL_GRAPHICS_CONTEXT_BOOLEAN, SDL_FALSE);
|
||||
|
||||
if (!_this) {
|
||||
/* Initialize the video system if needed */
|
||||
@@ -2092,7 +2088,7 @@ SDL_Window *SDL_CreateWindowWithProperties(SDL_PropertiesID props)
|
||||
}
|
||||
|
||||
/* Some platforms have certain graphics backends enabled by default */
|
||||
if (!graphics_flags && !SDL_IsVideoContextExternal()) {
|
||||
if (!graphics_flags && !external_graphics_context) {
|
||||
flags |= SDL_DefaultGraphicsBackends(_this);
|
||||
}
|
||||
|
||||
@@ -2153,6 +2149,7 @@ SDL_Window *SDL_CreateWindowWithProperties(SDL_PropertiesID props)
|
||||
window->next = _this->windows;
|
||||
window->is_destroying = SDL_FALSE;
|
||||
window->last_displayID = SDL_GetDisplayForWindow(window);
|
||||
window->external_graphics_context = external_graphics_context;
|
||||
|
||||
if (_this->windows) {
|
||||
_this->windows->prev = window;
|
||||
|
||||
@@ -96,11 +96,9 @@ void Android_PumpEvents_Blocking(SDL_VideoDevice *_this)
|
||||
SDL_VideoData *videodata = _this->driverdata;
|
||||
|
||||
if (videodata->isPaused) {
|
||||
SDL_bool isContextExternal = SDL_IsVideoContextExternal();
|
||||
|
||||
#ifdef SDL_VIDEO_OPENGL_EGL
|
||||
/* Make sure this is the last thing we do before pausing */
|
||||
if (!isContextExternal) {
|
||||
if (!Android_Window->external_graphics_context) {
|
||||
SDL_LockMutex(Android_ActivityMutex);
|
||||
android_egl_context_backup(Android_Window);
|
||||
SDL_UnlockMutex(Android_ActivityMutex);
|
||||
@@ -124,7 +122,7 @@ void Android_PumpEvents_Blocking(SDL_VideoDevice *_this)
|
||||
|
||||
/* Restore the GL Context from here, as this operation is thread dependent */
|
||||
#ifdef SDL_VIDEO_OPENGL_EGL
|
||||
if (!isContextExternal && !SDL_HasEvent(SDL_EVENT_QUIT)) {
|
||||
if (!Android_Window->external_graphics_context && !SDL_HasEvent(SDL_EVENT_QUIT)) {
|
||||
SDL_LockMutex(Android_ActivityMutex);
|
||||
android_egl_context_restore(Android_Window);
|
||||
SDL_UnlockMutex(Android_ActivityMutex);
|
||||
@@ -170,11 +168,10 @@ void Android_PumpEvents_NonBlocking(SDL_VideoDevice *_this)
|
||||
|
||||
if (videodata->isPaused) {
|
||||
|
||||
SDL_bool isContextExternal = SDL_IsVideoContextExternal();
|
||||
if (backup_context) {
|
||||
|
||||
#ifdef SDL_VIDEO_OPENGL_EGL
|
||||
if (!isContextExternal) {
|
||||
if (!Android_Window->external_graphics_context) {
|
||||
SDL_LockMutex(Android_ActivityMutex);
|
||||
android_egl_context_backup(Android_Window);
|
||||
SDL_UnlockMutex(Android_ActivityMutex);
|
||||
@@ -205,7 +202,7 @@ void Android_PumpEvents_NonBlocking(SDL_VideoDevice *_this)
|
||||
|
||||
#ifdef SDL_VIDEO_OPENGL_EGL
|
||||
/* Restore the GL Context from here, as this operation is thread dependent */
|
||||
if (!isContextExternal && !SDL_HasEvent(SDL_EVENT_QUIT)) {
|
||||
if (!Android_Window->external_graphics_context && !SDL_HasEvent(SDL_EVENT_QUIT)) {
|
||||
SDL_LockMutex(Android_ActivityMutex);
|
||||
android_egl_context_restore(Android_Window);
|
||||
SDL_UnlockMutex(Android_ActivityMutex);
|
||||
|
||||
Reference in New Issue
Block a user