Update joysticks and so forth during live resize
Fixes https://github.com/libsdl-org/SDL/issues/12022
This commit is contained in:
@@ -1354,29 +1354,8 @@ bool SDL_RunOnMainThread(SDL_MainThreadCallback callback, void *userdata, bool w
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Run the system dependent event loops
|
void SDL_PumpEventMaintenance(void)
|
||||||
static void SDL_PumpEventsInternal(bool push_sentinel)
|
|
||||||
{
|
{
|
||||||
// Free any temporary memory from old events
|
|
||||||
SDL_FreeTemporaryMemory();
|
|
||||||
|
|
||||||
// Release any keys held down from last frame
|
|
||||||
SDL_ReleaseAutoReleaseKeys();
|
|
||||||
|
|
||||||
// Run any pending main thread callbacks
|
|
||||||
SDL_RunMainThreadCallbacks();
|
|
||||||
|
|
||||||
#ifdef SDL_PLATFORM_ANDROID
|
|
||||||
// Android event processing is independent of the video subsystem
|
|
||||||
Android_PumpEvents(0);
|
|
||||||
#else
|
|
||||||
// Get events from the video subsystem
|
|
||||||
SDL_VideoDevice *_this = SDL_GetVideoDevice();
|
|
||||||
if (_this) {
|
|
||||||
_this->PumpEvents(_this);
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifndef SDL_AUDIO_DISABLED
|
#ifndef SDL_AUDIO_DISABLED
|
||||||
SDL_UpdateAudio();
|
SDL_UpdateAudio();
|
||||||
#endif
|
#endif
|
||||||
@@ -1402,6 +1381,32 @@ static void SDL_PumpEventsInternal(bool push_sentinel)
|
|||||||
SDL_UpdateTrays();
|
SDL_UpdateTrays();
|
||||||
|
|
||||||
SDL_SendPendingSignalEvents(); // in case we had a signal handler fire, etc.
|
SDL_SendPendingSignalEvents(); // in case we had a signal handler fire, etc.
|
||||||
|
}
|
||||||
|
|
||||||
|
// Run the system dependent event loops
|
||||||
|
static void SDL_PumpEventsInternal(bool push_sentinel)
|
||||||
|
{
|
||||||
|
// Free any temporary memory from old events
|
||||||
|
SDL_FreeTemporaryMemory();
|
||||||
|
|
||||||
|
// Release any keys held down from last frame
|
||||||
|
SDL_ReleaseAutoReleaseKeys();
|
||||||
|
|
||||||
|
// Run any pending main thread callbacks
|
||||||
|
SDL_RunMainThreadCallbacks();
|
||||||
|
|
||||||
|
#ifdef SDL_PLATFORM_ANDROID
|
||||||
|
// Android event processing is independent of the video subsystem
|
||||||
|
Android_PumpEvents(0);
|
||||||
|
#else
|
||||||
|
// Get events from the video subsystem
|
||||||
|
SDL_VideoDevice *_this = SDL_GetVideoDevice();
|
||||||
|
if (_this) {
|
||||||
|
_this->PumpEvents(_this);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
SDL_PumpEventMaintenance();
|
||||||
|
|
||||||
if (push_sentinel && SDL_EventEnabled(SDL_EVENT_POLL_SENTINEL)) {
|
if (push_sentinel && SDL_EventEnabled(SDL_EVENT_POLL_SENTINEL)) {
|
||||||
SDL_Event sentinel;
|
SDL_Event sentinel;
|
||||||
|
|||||||
@@ -51,6 +51,8 @@ extern const char *SDL_CreateTemporaryString(const char *string);
|
|||||||
extern void *SDL_ClaimTemporaryMemory(const void *mem);
|
extern void *SDL_ClaimTemporaryMemory(const void *mem);
|
||||||
extern void SDL_FreeTemporaryMemory(void);
|
extern void SDL_FreeTemporaryMemory(void);
|
||||||
|
|
||||||
|
extern void SDL_PumpEventMaintenance(void);
|
||||||
|
|
||||||
extern void SDL_SendQuit(void);
|
extern void SDL_SendQuit(void);
|
||||||
|
|
||||||
extern bool SDL_InitEvents(void);
|
extern bool SDL_InitEvents(void);
|
||||||
|
|||||||
@@ -3951,6 +3951,8 @@ void SDL_OnWindowLiveResizeUpdate(SDL_Window *window)
|
|||||||
// Send an expose event so the application can redraw
|
// Send an expose event so the application can redraw
|
||||||
SDL_SendWindowEvent(window, SDL_EVENT_WINDOW_EXPOSED, 0, 0);
|
SDL_SendWindowEvent(window, SDL_EVENT_WINDOW_EXPOSED, 0, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
SDL_PumpEventMaintenance();
|
||||||
}
|
}
|
||||||
|
|
||||||
static void SDL_CheckWindowSafeAreaChanged(SDL_Window *window)
|
static void SDL_CheckWindowSafeAreaChanged(SDL_Window *window)
|
||||||
@@ -4922,12 +4924,12 @@ bool SDL_GL_GetAttribute(SDL_GLAttr attr, int *value)
|
|||||||
if (glBindFramebufferFunc && (current_fbo != 0)) {
|
if (glBindFramebufferFunc && (current_fbo != 0)) {
|
||||||
glBindFramebufferFunc(GL_DRAW_FRAMEBUFFER, 0);
|
glBindFramebufferFunc(GL_DRAW_FRAMEBUFFER, 0);
|
||||||
}
|
}
|
||||||
// glGetFramebufferAttachmentParameterivFunc may cause GL_INVALID_OPERATION when querying depth/stencil size if the
|
// glGetFramebufferAttachmentParameterivFunc may cause GL_INVALID_OPERATION when querying depth/stencil size if the
|
||||||
// bits is 0. From the GL docs:
|
// bits is 0. From the GL docs:
|
||||||
// If the value of GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE is GL_NONE, then either no framebuffer is bound to target;
|
// If the value of GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE is GL_NONE, then either no framebuffer is bound to target;
|
||||||
// or a default framebuffer is queried, attachment is GL_DEPTH or GL_STENCIL, and the number of depth or stencil bits,
|
// or a default framebuffer is queried, attachment is GL_DEPTH or GL_STENCIL, and the number of depth or stencil bits,
|
||||||
// respectively, is zero. In this case querying pname GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME will return zero, and all
|
// respectively, is zero. In this case querying pname GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME will return zero, and all
|
||||||
// other queries will generate an error.
|
// other queries will generate an error.
|
||||||
GLint fbo_type = GL_FRAMEBUFFER_DEFAULT;
|
GLint fbo_type = GL_FRAMEBUFFER_DEFAULT;
|
||||||
if (attachment == GL_DEPTH || attachment == GL_STENCIL) {
|
if (attachment == GL_DEPTH || attachment == GL_STENCIL) {
|
||||||
glGetFramebufferAttachmentParameterivFunc(GL_FRAMEBUFFER, attachment, GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE, &fbo_type);
|
glGetFramebufferAttachmentParameterivFunc(GL_FRAMEBUFFER, attachment, GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE, &fbo_type);
|
||||||
|
|||||||
Reference in New Issue
Block a user