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 - Do not overwrite window surface created by driver
Summary: Do not overwrite window surface created by driver
Status: RESOLVED FIXED
Alias: None
Product: SDL
Classification: Unclassified
Component: video (show other bugs)
Version: HG 2.0
Hardware: x86 Other
: P2 normal
Assignee: Sam Lantinga
QA Contact: Sam Lantinga
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-03-23 00:30 UTC by Jay Petacat
Modified: 2020-03-23 18:49 UTC (History)
0 users

See Also:


Attachments
Mercurial patch (988 bytes, patch)
2020-03-23 00:30 UTC, Jay Petacat
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
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