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:
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.
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.