15 lines
566 B
Zig
15 lines
566 B
Zig
const std = @import("std");
|
|
pub const c = @import("c.zig").c;
|
|
pub const PowerState = enum(c_int) {
|
|
powerstateError = -1, //error determining power status
|
|
powerstateUnknown, //cannot determine power status
|
|
powerstateOnBattery, //Not plugged in, running on the battery
|
|
powerstateNoBattery, //Plugged in, no battery available
|
|
powerstateCharging, //Plugged in, charging battery
|
|
powerstateCharged,
|
|
};
|
|
|
|
pub inline fn getPowerInfo(seconds: *c_int, percent: *c_int) PowerState {
|
|
return c.SDL_GetPowerInfo(@ptrCast(seconds), @ptrCast(percent));
|
|
}
|