Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sdl2: Use 8-bit surface for pixel data #26

Open
deltabeard opened this issue Aug 12, 2019 · 2 comments
Open

sdl2: Use 8-bit surface for pixel data #26

deltabeard opened this issue Aug 12, 2019 · 2 comments
Labels
diff: intermediate Medium difficulty enhancement New feature or request
Milestone

Comments

@deltabeard
Copy link
Owner

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.

@deltabeard deltabeard added enhancement New feature or request diff: intermediate Medium difficulty labels Aug 12, 2019
@deltabeard
Copy link
Owner Author

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).

@deltabeard
Copy link
Owner Author

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.

@deltabeard deltabeard changed the title sdl2: Use native texture format sdl2: Use 8-bit surface for pixel data May 26, 2023
@deltabeard deltabeard added this to the v2 milestone May 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
diff: intermediate Medium difficulty enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant