Support custom pixel formats
We currently support only BGRA32 colors. We should allow users to customize this when using the library.
References:
- https://wiki.libsdl.org/SDL2/SDL_PixelFormatEnum
This would be really useful for my project. I'm trying to use ZeroGL as a C-Extension in DragonRuby but DR only accepts ABGR colours. So instead of altering ZeroGL, I post process the pixel array to convert it. However, that's not very efficient. I also noticed that ZeroGL doesn't deal with the Alpha channel in most of the colour functions so I have to force Alpha on. I don't know if this is just a product of the colour format or something else. Thanks.
Hey @dcrawl, not sure if this is still useful to you, but PR #47 solved this issue. You can now set the pixel format by doing:
#define ZEROGL_PIXELFORMAT ZEROGL_PIXELFORMAT_ABGR8888
Before including zeroGL. More details on the docs.