Main/Assets/Plugins/iOS/DeviceSetting.mm
2025-01-25 04:38:09 +08:00

28 lines
426 B
Plaintext

float get_brightness()
{
return [UIScreen mainScreen].brightness;
}
void set_brightness(float val)
{
val = val < 0.0f ? 0.0f : val;
val = val > 1.0f ? 1.0f : val;
[UIScreen mainScreen].brightness = val;
}
// c interface
extern "C"
{
float get_screen_brightness()
{
return get_brightness();
}
void set_screen_brightness(float val)
{
set_brightness(val);
}
}