SFML community forums
General => Feature requests => Topic started by: kdmiller3 on January 18, 2008, 02:18:30 am
-
I noticed that there's no way to request alpha for the color buffer, even when setting a 32-bit color format. Some OpenGL blend functions require the color buffer have an alpha channel (e.g. GL_SRC_ALPHA_SATURATE, GL_ONE required by polygon smoothing). My renderer failedafter switching over from SDL, as the alpha-saturate blending stopped drawing anything due to the missing destination alpha. I ended up locally modifying WindowImplWin32::CreateContex to request an alpha channel for 32-bit and 16-bit color depths, but that's obviously not ideal. Exposing the pixel format attributes as some sort of "advanced" properties would help. :)
-
Yep, having advanced settings to customize the context creation could certainly help.
Or I could just create an alpha-channel by default if it doesn't impact the performances for regular RGB usage.
-
The latter should be okay short-term, but alpha bits is just one of many useful OpenGL setup properties. SDL exposes a number of them, so there's definitely a call for that sort of thing. The antialiasing (multisampling) parameter could then be rolled into the larger properties system.
-
Yep, that's true.
-
Any updates on this issue?
I think, if I create a Window with 32 bits per pixels, doesn't that always mean I want an alpha channel with it? If I didn't want an alpha channel, wouldn't I specify something like 24 bit? I think SFML should automatically add the alpha channel for 32 bit or at least give me the option to do so manually. What do you think?
I ended up locally adding this to "WindowImplWin32::CreateContex"
PixelDescriptor.cAlphaBits = Mode.BitsPerPixel==32 ? 8:0;
Will this issue be fixed in a future release?
-
Thanks for reminding me.
I added your fix, it will be available in version 1.6.
-
Great! Thanks.