wcale
Posts: 9
Joined: Mon Feb 16, 2015 8:08 am

Bug in Raspberry related to brightness in SDL2!

Tue Feb 24, 2015 10:11 am

Hi,
I’m trying to change brightness in SDL2 and there is no effect at all.
There is an example of method which I’m using:
SDL_SetWindowBrightness(window, 0.1); // there is no difference in brightness between 0.1 and 1.0
Function returns 0 – so the function is supported.

I’m also trying by this function : SDL_SetWindowGammaRamp, but result is the same.
Is here on this forum someone who can test this please: SDL_SetWindowBrightness ?
The function: SDL_SetTextureColorMod and similar functions works perfect.

So it is a serious bug related to:
http://www.raspberrypi.org/forums/viewt ... 3&t=100410
Or I haven’t installed SDL2 correctly.

ShiftPlusOne
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 6229
Joined: Fri Jul 29, 2011 5:36 pm
Location: The unfashionable end of the western spiral arm of the Galaxy

Re: Bug in Raspberry related to brightness in SDL2!

Tue Feb 24, 2015 2:43 pm

Despite the name and signature, this method sets the brightness of the entire display, not an individual window. A window is considered to be owned by the display that contains the window's center pixel. (The index of this display can be retrieved using SDL_GetWindowDisplayIndex().) The brightness set will not follow the window if it is moved to another display.
I hope you don't intend to create a topic for every bit of software that this doesn't work with. As has been established in the earlier thread you linked, this isn't a supported feature.

-rst-
Posts: 1316
Joined: Thu Nov 01, 2012 12:12 pm
Location: Dublin, Ireland

Re: Bug in Raspberry related to brightness in SDL2!

Tue Feb 24, 2015 2:55 pm

Yep the SDL calls are trying to use the not-implemented functionality to control the HDMI.

Funnily enough, on my work laptop here I can software control the brightness of the built-in display but this has no effect what so ever on the external HDMI monitor I use as second display for extended desktop...
http://raspberrycompote.blogspot.com/ - Low-level graphics and 'Coding Gold Dust'

wcale
Posts: 9
Joined: Mon Feb 16, 2015 8:08 am

Re: Bug in Raspberry related to brightness in SDL2!

Tue Feb 24, 2015 5:49 pm

The problem is not related to HDMI, but to change the brightness by the software. In some games that problem does not exists, because it is controlled from SDL (or not?).
Is there any method, how control screen fading without significant efficiency decrease?

@ShiftPlusOne
I don't know what are you talking about. I'm using "window" as display index.
Here is the initiation of renderer:
renderer = SDL_CreateRenderer(window, -1, SDL_RENDERER_SOFTWARE);
renderer = SDL_CreateRenderer(window, -1, SDL_RENDERER_ACCELERATED);
Brightness / gamma is not working using software nor accelerated initialization.
ShiftPlusOne wrote:I hope you don't intend to create a topic for every bit of software that this doesn't work with.
So you want me to not mention about serious bugs.
So on this forum i must only say how Raspberry is great, wonderful and awesome?
This forum is under Kim Dzong Un control?
ShiftPlusOne wrote:As has been established in the earlier thread you linked, this isn't a supported feature.
This is bug.
Nothing has been estabilished. The moderator closed thread, because he has not enough knowledge about this and is very nervous person.

Is there in SDL2 is a method in which I can change brightness or gamma? Is this problem is only on Raspberry Pi?

jdb
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 2397
Joined: Thu Jul 11, 2013 2:37 pm

Re: Bug in Raspberry related to brightness in SDL2!

Tue Feb 24, 2015 7:00 pm

wcale wrote:
ShiftPlusOne wrote:As has been established in the earlier thread you linked, this isn't a supported feature.
This is bug.
Nothing has been estabilished. The moderator closed thread, because he has not enough knowledge about this and is very nervous person.
Yes. I'm quaking in my little booties.
Rockets are loud.
https://astro-pi.org

Return to “Graphics programming”