Add texture

This commit is contained in:
Dusk 2023-09-24 19:11:54 +02:00
parent 3e552932ad
commit 0a94c68195
4 changed files with 2 additions and 5 deletions

2
.gitignore vendored
View File

@ -90,3 +90,5 @@ zig-out
zig-cache
zig-cache/h
zig-cache/z
*.kra

BIN
res/cell.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

View File

@ -86,7 +86,6 @@ pub const Texture = struct {
}
pub fn drawTo(self: Texture, x: i32, y: i32, w: i32, h: i32, tint: [4]u8) void {
std.debug.print("\n\n I love penis \n\n", .{});
self.texture.drawTo(x, y, w, h, tint);
}

View File

@ -78,14 +78,12 @@ pub const Texture = struct {
}
pub fn drawTo(self: Texture, x: i32, y: i32, w: i32, h: i32, tint: [4]u8) void {
std.debug.print("\n\nachooooo\n\n", .{});
const srcRec: c.Rectangle = .{
.x = 0,
.y = 0,
.width = @floatFromInt(self.texture.width),
.height = @floatFromInt(self.texture.height),
};
std.debug.print("\n\nnaguru\n\n", .{});
const dstRec: c.Rectangle = .{
.x = @floatFromInt(x),
@ -94,7 +92,6 @@ pub const Texture = struct {
.height = @floatFromInt(h),
};
std.debug.print("\n\nHAstta aqui hemos llegao\n\n", .{});
c.DrawTexturePro(
self.texture,
srcRec,
@ -103,7 +100,6 @@ pub const Texture = struct {
0,
.{ .r = tint[0], .g = tint[1], .b = tint[2], .a = tint[3] },
);
std.debug.print("\n\nlmaolol\n\n", .{});
}
pub fn unload(self: Texture) void {