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 5053

Summary: Do not overwrite window surface created by driver
Product: SDL Reporter: Jay Petacat <libsdl.org>
Component: videoAssignee: Sam Lantinga <slouken>
Status: RESOLVED FIXED QA Contact: Sam Lantinga <slouken>
Severity: normal    
Priority: P2    
Version: HG 2.0   
Hardware: x86   
OS: Other   
Attachments: Mercurial patch

Description Jay Petacat 2020-03-23 00:30:38 UTC
Created attachment 4276 [details]
Mercurial patch

If a driver's implementation of CreateWindowFramebuffer sets the window surface, use that rather than overwriting it. A driver may set the window surface if data cannot be passed via the CreateWindowFramebuffer output parameters (e.g. surface palette colors).

While working on my DOS port[1], I was having problems drawing to the framebuffer surface for indexed color modes because the CreateWindowFramebuffer interface doesn't support a palette. The attached patch allows me to set a paletted surface to the window in CreateWindowFramebuffer.

[1]: https://discourse.libsdl.org/t/porting-sdl-to-dos/27361
Comment 1 Sam Lantinga 2020-03-23 18:49:36 UTC
Patch added, thanks!
https://hg.libsdl.org/SDL/rev/daed33b4f74a