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

Support for pixel formats with an alpha channel #257

Closed
connorskees opened this issue Sep 4, 2021 · 2 comments
Closed

Support for pixel formats with an alpha channel #257

connorskees opened this issue Sep 4, 2021 · 2 comments

Comments

@connorskees
Copy link

Hello,

I am wondering if supporting pixel formats other than 0RGB would be out of the scope of this library. I am currently using this library to prototype something that requires support for an alpha channel, and having this available in the windowing library would be very useful.

I see discussion about this in #101, but would like to clarify thoughts here. Would you be open to a PR implementing this for POSIX?

I think the ideal API would be to have the format specifiable in minifb::WindowOptions, but that would be a breaking change. Do you have other thoughts for how/where this should be implemented?

@emoon
Copy link
Owner

emoon commented Sep 6, 2021

Hey,

It depends a bit on what you want the alpha channel to do. In this PR #164 it makes it possible (on some OSes) that the alpha will blend towards the background of the screen (i.e a transparent window)

@twe4ked
Copy link

twe4ked commented Nov 10, 2021

I had a bit of a play with different color formats backed by u32s in a library I wrote a little while back. It introduces a Storage trait that can be implemented to pack/unpack the RGBA values. The idea might be relevant here.

https://github.com/twe4ked/inku/blob/4898cc2579ad91722e5a413eb33a89be95e0cced/src/lib.rs#L116-L175

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants