about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorNguyễn Gia Phong <mcsinyx@disroot.org>2021-09-09 15:05:33 +0700
committerNguyễn Gia Phong <mcsinyx@disroot.org>2021-09-09 15:05:33 +0700
commit517356e2d6ebce33004d91cb55173f8cc419fc66 (patch)
tree4d8a87cfde6a8fdfc2297a8b1cb56591d833ec12 /src
parent5fec1072d49a159b0b3893950dcb692f6ecd5d0e (diff)
downloadgfz-517356e2d6ebce33004d91cb55173f8cc419fc66.tar.gz
Remove unnecessary namespacing
Diffstat (limited to 'src')
-rw-r--r--src/Monitor.zig2
-rw-r--r--src/Window.zig23
2 files changed, 14 insertions, 11 deletions
diff --git a/src/Monitor.zig b/src/Monitor.zig
index 39e9815..9d6465f 100644
--- a/src/Monitor.zig
+++ b/src/Monitor.zig
@@ -1,4 +1,4 @@
 usingnamespace @import("cimport.zig");
-const Monitor = @This();
 
+const Monitor = @This();
 pimpl: *GLFWmonitor,
diff --git a/src/Window.zig b/src/Window.zig
index 0c8bacb..bc3b8bd 100644
--- a/src/Window.zig
+++ b/src/Window.zig
@@ -17,38 +17,41 @@
 // along with gfz.  If not, see <https://www.gnu.org/licenses/>.
 
 usingnamespace @import("cimport.zig");
-const gfz = @import("gfz.zig");
+const Error = gfz.Error;
 const Monitor = @import("Monitor.zig");
-const Window = @This();
+const checkError = gfz.checkError;
+const getError = gfz.getError;
+const gfz = @import("gfz.zig");
 
+const Window = @This();
 pimpl: *GLFWwindow,
 
 /// Create a window and its associated context.
 pub fn create(width: c_int, height: c_int, title: []const u8,
-              monitor: ?Monitor, share: ?Window) gfz.Error!Window {
+              monitor: ?Monitor, share: ?Window) Error!Window {
     const pmonitor = if (monitor) |box| box.pimpl else null;
     const pshare = if (share) |box| box.pimpl else null;
     const ptr = glfwCreateWindow(width, height, title.ptr, pmonitor, pshare);
     return if (ptr) |pimpl|
         Window{ .pimpl = pimpl }
     else
-        gfz.getError();
+        getError();
 }
 
 /// Make the context current for the calling thread.
-pub fn makeCurrent(self: Window) gfz.Error!void {
+pub fn makeCurrent(self: Window) Error!void {
     glfwMakeContextCurrent(self.pimpl);
-    try gfz.checkError();
+    try checkError();
 }
 
 /// Check the close flag.
-pub fn shouldClose(self: Window) gfz.Error!bool {
+pub fn shouldClose(self: Window) Error!bool {
     const flag = glfwWindowShouldClose(self.pimpl);
-    try gfz.checkError();
+    try checkError();
     return flag == GLFW_TRUE;
 }
 
-pub fn swapBuffers(self: Window) gfz.Error!void {
+pub fn swapBuffers(self: Window) Error!void {
     glfwSwapBuffers(self.pimpl);
-    try gfz.checkError();
+    try checkError();
 }