From 48dee0817f5fe8c09a085f0150e0c6b4a699ab7c Mon Sep 17 00:00:00 2001 From: tslil clingman <> Date: Wed, 27 Oct 2021 15:37:28 -0400 Subject: Update SFML wrapper --- src/sfml/system/Clock.zig | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'src/sfml/system/Clock.zig') 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; -- cgit v1.3.1