diff options
author | Yaroslav de la Peña Smirnov <yps@yaroslavps.com> | 2024-09-21 23:57:14 +0300 |
---|---|---|
committer | Yaroslav de la Peña Smirnov <yps@yaroslavps.com> | 2024-09-21 23:57:14 +0300 |
commit | 7f2bee0d11ce5f98a450b80d33ef28c6e19b94e9 (patch) | |
tree | b37c3d9c252017a5b5fbdd06705c62135e835cd3 /src | |
parent | 44a1263cbbe6a19f796d6fb05e74396703482340 (diff) | |
download | zigway-7f2bee0d11ce5f98a450b80d33ef28c6e19b94e9.tar.gz zigway-7f2bee0d11ce5f98a450b80d33ef28c6e19b94e9.zip |
gl: rgb squaregl/rgb-square
Diffstat (limited to 'src')
-rw-r--r-- | src/main.zig | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/src/main.zig b/src/main.zig index 8b9f927..33e8aba 100644 --- a/src/main.zig +++ b/src/main.zig @@ -121,19 +121,22 @@ pub const Window = struct { /// OpenGl triangle shader program shader_prog: c_uint = undefined, /// Triangle vertices - vertices: [9]f32 = .{ + vertices: [12]f32 = .{ -0.5, -0.5, 0.0, // bl 0.5, -0.5, 0.0, // br - 0.0, 0.5, 0.0, // t + 0.5, 0.5, 0.0, // tr + -0.5, 0.5, 0.0, // tl }, - colors: [12]f32 = .{ + colors: [16]f32 = .{ 1.0, 0.0, 0.0, 1.0, 0.0, 1.0, 0.0, 1.0, 0.0, 0.0, 1.0, 1.0, + 1.0, 1.0, 1.0, 1.0, }, /// Triangles indices - indices: [3]c_uint = .{ + indices: [6]c_uint = .{ 0, 1, 2, + 2, 3, 0, }, /// OpenGL vertex buffer object vbo: c_uint = undefined, |