The SDL forums have moved to discourse.libsdl.org.
This is just a read-only archive of the previous forums, to keep old links working.


SDL Forum Index
SDL
Simple Directmedia Layer Forums
SDL_SetWindowBrightness is not working!
Tch0c


Joined: 29 Jan 2016
Posts: 4
I'm a developer but also a gamer. I've played games that use SDL2 and I am convinced that there's a bug with SDL_SetWindowBrightness which I myself have witnessed. In games such as Left for Dead 2 or Portal 2, both of which use SDL2, the brightness setting has no effect at all. As a developer, I program with SDL2 and OpenGL. The said function has NO effect on the brightness of the display. I have a model rendered and calling the function thus:



Code:

SDL_SetWindowBrightness(window, 0.0); // Completely dark

// or

SDL_SetWindowBrightness(window, 1.0); // bright


Still renders the model exactly as-is with no difference whatsoever.

Here's the rendered output with brightness at 0.0:



and the rendered output with brightness at 1.0:



To be honest with you the outputs are so alike it makes no difference which is which!

As you can see I'm using Ubuntu 15.10 64-bit on an Intel HD 5500 with OpenGL 3.3.

Is it a case that I'm not using the function correctly, or is there a bug that needs to be squashed?
mr_tawan


Joined: 13 Jan 2014
Posts: 161
First of all, you might wan to try calling `SDL_GetError()` right after the set brightness thing. It might tell you something interesting.

Secondly I don't think this is what you are aiming for. From the wiki https://wiki.libsdl.org/SDL_SetWindowBrightness, this function set the brightness to the whole display/screen (rather than just your window, despite what its name suggested). The proper lighting system would be needed to litting up your model.

I've never used this funtion though. I might be wrong.
Tch0c


Joined: 29 Jan 2016
Posts: 4
mr_tawan wrote:
First of all, you might wan to try calling `SDL_GetError()` right after the set brightness thing. It might tell you something interesting.

Secondly I don't think this is what you are aiming for. From the wiki https://wiki.libsdl.org/SDL_SetWindowBrightness, this function set the brightness to the whole display/screen (rather than just your window, despite what its name suggested). The proper lighting system would be needed to litting up your model.

I've never used this funtion though. I might be wrong.


I'm aware that's what the brightness function does. I also have a lighting system in place (I use phong shading) which lights up the model. I only have one light currently which is positioned in front of the model. That works regardless of the brightness setting.