libsdl-org / sdl12-compat

An SDL-1.2 compatibility layer that uses SDL 2.0 behind the scenes.
Other
197 stars 40 forks source link

SDL_SetVideoMode with bpp=0 is incorrect #213

Closed icculus closed 2 years ago

icculus commented 2 years ago

In sdl12-compat, if an app calls SDL_SetVideoMode(w, h, 0, 0), we'll give them whatever the desktop mode is set to, which on this laptop, SDL2 is reporting it as 24-bit...but SDL 1.2 reports this as 32-bit on this machine. So we should probably do the same

Originally posted by @icculus in https://github.com/libsdl-org/sdl12-compat/issues/182#issuecomment-1251050983

icculus commented 2 years ago

This patch fixes tucnak again, and verified that Powder and Schismtracker (which both had 24-bit issues previously) are still working.

sezero commented 2 years ago

Has SDL-1.2 ever supported / reported 8 bits?

slouken commented 2 years ago

Yes, in late 90's there were desktop configurations that didn't have truecolor at all.

sezero commented 2 years ago

Then, should sdl12-compat report 8 bit too if it ever runs into it??

slouken commented 2 years ago

No, I don't think so at this point.

icculus commented 2 years ago

(I could have sworn SDL2 didn't even support 8-bit displays, but regardless of that) there isn't any direct pixel access in sdl12-compat, since it either goes in renderer texture or uses OpenGL, and both will convert to whatever display depth.

Plus we aren't going to bother with palettes if we really do ever see an 8-bit display.