We are currently migrating Bugzilla to GitHub issues.
Any changes made to the bug tracker now will be lost, so please do not post new bugs or make changes to them.
When we're done, all bug URLs will redirect to their equivalent location on the new bug tracker.

Bug 4890 - [Patch] Add hint for SDL that the graphics context is externally managed
Summary: [Patch] Add hint for SDL that the graphics context is externally managed
Status: RESOLVED FIXED
Alias: None
Product: SDL
Classification: Unclassified
Component: video (show other bugs)
Version: 2.0.10
Hardware: All All
: P2 normal
Assignee: Sam Lantinga
QA Contact: Sam Lantinga
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-12-07 22:51 UTC by Aaron Barany
Modified: 2019-12-08 19:33 UTC (History)
0 users

See Also:


Attachments
sdl-external-context.patch (6.01 KB, patch)
2019-12-07 22:51 UTC, Aaron Barany
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Aaron Barany 2019-12-07 22:51:58 UTC
Created attachment 4091 [details]
sdl-external-context.patch

Add SDL_HINT_VIDEO_EXTERNAL_CONTEXT hint to notify SDL that the graphics context is external. This disables the automatic context save/restore behavior on Android and avoids using OpenGL by default when SDL_WINDOW_VUKLAN isn't set.

When the application wishes to manage the OpenGL contexts on Android, this avoids cases where SDL unbinds the context and creates new contexts, which can interfere with the application's operation.

When using Vulkan and Metal renderer implementations, this avoids SDL forcing OpenGL to be enabled on certain platforms. While using the SDL_WINDOW_VULKAN flag can be used to achieve the same thing, it also causes Vulkan to be loaded. If the application uses Vulkan directly, this is not necessary, and fails window creation when using Metal due to Vulkan not being present. (assuming MoltenVK isn't installed)
Comment 1 Sam Lantinga 2019-12-08 19:33:24 UTC
Looks good, thanks!
https://hg.libsdl.org/SDL/rev/881796f84081