From 6ead90c0f0e9b9a44c7c1f7137f437faa29fa750 Mon Sep 17 00:00:00 2001 From: tslil clingman <> Date: Sat, 30 Oct 2021 16:54:03 -0400 Subject: Switched to tracking zig-sfml-wrapper as submodule --- src/sfml/graphics/VertexArray.zig | 36 ------------------------------------ 1 file changed, 36 deletions(-) delete mode 100644 src/sfml/graphics/VertexArray.zig (limited to 'src/sfml/graphics/VertexArray.zig') diff --git a/src/sfml/graphics/VertexArray.zig b/src/sfml/graphics/VertexArray.zig deleted file mode 100644 index d340600..0000000 --- a/src/sfml/graphics/VertexArray.zig +++ /dev/null @@ -1,36 +0,0 @@ -//! Define a set of one or more 2D primitives. - -const sf = @import("../sfml.zig"); - -// CONSTRUCTION ZONE - -const VertexArray = @This(); - -/// Creates a vertex array from a slice of vertices -pub fn createFromSlice(vertex: []const sf.graphics.Vertex, primitive: sf.graphics.PrimitiveType) !VertexArray { - var va = sf.c.sfVertexArray_create(); - if (va) |vert| { - sf.c.sfVertexArray_setPrimitiveType(vert, @enumToInt(primitive)); - sf.c.sfVertexArray_resize(vert, vertex.len); - for (vertex) |v, i| - sf.c.sfVertexArray_getVertex(vert, i).* = @bitCast(sf.c.sfVertex, v); - return VertexArray{ ._ptr = vert }; - } else return sf.Error.nullptrUnknownReason; -} - -/// Destroys a vertex array -pub fn destroy(self: *VertexArray) void { - sf.c.sfVertexArray_destroy(self._ptr); -} - -// Draw function -pub fn sfDraw(self: VertexArray, window: anytype, states: ?*sf.c.sfRenderStates) void { - switch (@TypeOf(window)) { - sf.graphics.RenderWindow => sf.c.sfRenderWindow_drawVertexArray(window._ptr, self._ptr, states), - sf.graphics.RenderTexture => sf.c.sfRenderTexture_drawVertexArray(window._ptr, self._ptr, states), - else => @compileError("window must be a render target"), - } -} - -/// Pointer to the csfml structure -_ptr: *sf.c.sfVertexArray, -- cgit v1.3.1