diff options
| author | tslil clingman <> | 2021-10-27 15:37:28 -0400 |
|---|---|---|
| committer | tslil clingman <> | 2021-10-27 15:37:28 -0400 |
| commit | 48dee0817f5fe8c09a085f0150e0c6b4a699ab7c (patch) | |
| tree | d6ab0a54f2260cb73c79e00ca1489c034f555f09 /src/sfml/system/Clock.zig | |
| parent | 486935299e4b7e097754611d9f8dd40003351ae4 (diff) | |
Update SFML wrapper
Diffstat (limited to 'src/sfml/system/Clock.zig')
| -rw-r--r-- | src/sfml/system/Clock.zig | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/sfml/system/Clock.zig b/src/sfml/system/Clock.zig index d8b174e..74b73ab 100644 --- a/src/sfml/system/Clock.zig +++ b/src/sfml/system/Clock.zig @@ -17,29 +17,29 @@ pub fn create() !Clock { if (clock == null) return sf.Error.nullptrUnknownReason; - return Clock{ .ptr = clock.? }; + return Clock{ ._ptr = clock.? }; } /// Destroys this clock -pub fn destroy(self: Clock) void { - sf.c.sfClock_destroy(self.ptr); +pub fn destroy(self: *Clock) void { + sf.c.sfClock_destroy(self._ptr); } // Clock control /// Gets the elapsed seconds pub fn getElapsedTime(self: Clock) sf.Time { - var time = sf.c.sfClock_getElapsedTime(self.ptr).microseconds; + var time = sf.c.sfClock_getElapsedTime(self._ptr).microseconds; return sf.Time{ .us = time }; } /// Gets the elapsed seconds and restarts the timer -pub fn restart(self: Clock) sf.Time { - var time = sf.c.sfClock_restart(self.ptr).microseconds; +pub fn restart(self: *Clock) sf.Time { + var time = sf.c.sfClock_restart(self._ptr).microseconds; return sf.Time{ .us = time }; } /// Pointer to the csfml structure -ptr: *sf.c.sfClock, +_ptr: *sf.c.sfClock, test "clock: sleep test" { const tst = @import("std").testing; |
