4.2 Mac - getWindowBrightness() don't work

  • #1, by LebosteinSunday, 03. May 2015, 18:22 5 years ago
    returns 0 in every case after I set the brightness with setWindowBrightness().

    Other mysterious thing: if I change the brightness, the Mac switches the color profile to a blue shaded thing. What is the reason for that?

    Key Killer

    598 Posts


  • #2, by BigStansMonday, 04. May 2015, 01:04 5 years ago
    Returning 0 succeed. You are using shaders?
    I've tested it with the Demogame and without shaders.
    setWindowBrightness(150)
    and it works.

    Great Poster

    361 Posts

  • #3, by LebosteinMonday, 04. May 2015, 07:49 5 years ago
    I don't use shaders. But I have this problem with some Daedalic games too:

    http://www.visionaire-studio.net/forum/thread/blaustich-bei-...

    Until yet I have no solution found for this problem.

    Key Killer

    598 Posts

  • #4, by LebosteinMonday, 04. May 2015, 07:51 5 years ago
    Here is an other discription of that problem:
    http://www.visionaire-studio.net/forum/thread/mac-os-color-s...

    Key Killer

    598 Posts

  • #5, by BigStansMonday, 04. May 2015, 17:04 5 years ago
    These are old and different issues, which are fixed.
    You have an "blue" tint screen if setWindowBrightness was higher or lower than 100 (100 = default), that's not an issue, that's an Overlay from SDL.

    Great Poster

    361 Posts

  • #6, by LebosteinMonday, 04. May 2015, 17:47 5 years ago
    How I can fix this? This blue tint is also present if I set the brightness = 100 (default)

    Key Killer

    598 Posts

  • #7, by BigStansMonday, 04. May 2015, 21:21 5 years ago
    Does the player start directly with an brightness?
    It gives 2 Brightness options smile
    You can add brightness = x in the config.ini so, the player has directly an brightness and you have an "blue tint".
    Hint: it gives 2 config.ini files 1 in the app and 1 in the user directory (localAppDir). Make sure that these 2 config.ini has no brightness setting or 100 by default.

    If you set the brightness with the lua command:
    setWindowBrightness(value) command, then we show, what's the requested brightness value. If the current brightness was not the same as the requested, we set the brightness.
    You can print the current brightness with:
    local currentBrightness = getWindowBrightness()
    print(currentBrightness)

    Make sure, that the currentBrightness is 100. Otherwise you set it before. Hope we find this smile

    Great Poster

    361 Posts

  • #8, by LebosteinTuesday, 05. May 2015, 07:34 5 years ago
    I can't check this, because getWindowBrightness returns wrong values (see the bug report in the first post)

    werte = {0,1,50,99,100,101,150,199,200}
    for i,v in ipairs(werte) do
    setWindowBrightness(v)
    print(v .. "=" .. getWindowBrightness())
    end
    1
    2
    3
    4
    5
    6

    returns:
    0=0
    1=0
    50=0
    99=0
    100=100
    101=100
    150=100
    199=100
    200=200
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10

    Key Killer

    598 Posts

  • #9, by AlexTuesday, 05. May 2015, 10:56 5 years ago
    I fixed the getWindowBrightness command. currently it only returns 0 for values < 100 and 1 for values >= 100.

    Great Poster

    378 Posts

  • #10, by LebosteinWednesday, 06. May 2015, 19:01 5 years ago
    Why you don't use a software/rendering brightness? It seems the hardware brightness is very hard to handle and leads to very different results depending on hardware, graphic card and operation system. I have some system tested and sometimes the setWindowBrightness() function returns an error and nothing happens...

    Key Killer

    598 Posts

  • #11, by BigStansWednesday, 06. May 2015, 20:55 5 years ago
    Well, the brightness command is directly from SDL developed by valve.
    This command uses different brightness functions from the backend, not depending on the Hardware, it depends on the os, and on linux on the graphics backend (wayland, etc).

    With Visionaire you have 2 options.
    - setWindowBrightness and brightness in the ini file works on Mac, Windows, iOS, Andoid supported by SDL.
    Linux: it depends of the Backend, X11, Wayland, Mir
    Not supported @ your Linux? Then use the libSDL 2 from the maintainer in most cases, the maintainer (like Conconial) has patches. Yes, you can make an jump to an other libSDL @ linux.
    Mir (Ubuntu > 12.04) has an brightness bug in the X11 fallback, so it gives patches for this. The function exists and an error comes back. It's not an issue by us or SDL. You must compile your own X11 and SDL (but that's Linux and normal).
    - If you do not want use this you can make the same with an shader.

    Great Poster

    361 Posts

Write post