Peanut-GB
Peanut-GB copied to clipboard
sdl2: Use 8-bit surface for pixel data
Use SDL_GetRendererInfo()
to find out what the native texture format is for the used driver, then convert the RGB555 values to whatever format is detected.
Using a texture format that is native to the system should improve performance on systems that do not natively support RGB555.
This will require logic to convert palette colours to selected texture format. Not difficult, but may be time consuming depending on how many texture formats we want to support (only the most popular ones since SDL2 can just convert the format itself as a fallback).
The renderer should use an 8-bit surface that Peanut-GB will fill with pixels. By using SDL_SetPaletteColours, the colour of the pixels can be changed. SDL2 will convert the 8-bit surface to whichever format the hardware is using.
This issue depends on #55.