Add texture
This commit is contained in:
parent
3e552932ad
commit
0a94c68195
|
@ -90,3 +90,5 @@ zig-out
|
||||||
zig-cache
|
zig-cache
|
||||||
zig-cache/h
|
zig-cache/h
|
||||||
zig-cache/z
|
zig-cache/z
|
||||||
|
|
||||||
|
*.kra
|
||||||
|
|
Binary file not shown.
After Width: | Height: | Size: 1.1 KiB |
|
@ -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 {
|
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);
|
self.texture.drawTo(x, y, w, h, tint);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -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 {
|
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 = .{
|
const srcRec: c.Rectangle = .{
|
||||||
.x = 0,
|
.x = 0,
|
||||||
.y = 0,
|
.y = 0,
|
||||||
.width = @floatFromInt(self.texture.width),
|
.width = @floatFromInt(self.texture.width),
|
||||||
.height = @floatFromInt(self.texture.height),
|
.height = @floatFromInt(self.texture.height),
|
||||||
};
|
};
|
||||||
std.debug.print("\n\nnaguru\n\n", .{});
|
|
||||||
|
|
||||||
const dstRec: c.Rectangle = .{
|
const dstRec: c.Rectangle = .{
|
||||||
.x = @floatFromInt(x),
|
.x = @floatFromInt(x),
|
||||||
|
@ -94,7 +92,6 @@ pub const Texture = struct {
|
||||||
.height = @floatFromInt(h),
|
.height = @floatFromInt(h),
|
||||||
};
|
};
|
||||||
|
|
||||||
std.debug.print("\n\nHAstta aqui hemos llegao\n\n", .{});
|
|
||||||
c.DrawTexturePro(
|
c.DrawTexturePro(
|
||||||
self.texture,
|
self.texture,
|
||||||
srcRec,
|
srcRec,
|
||||||
|
@ -103,7 +100,6 @@ pub const Texture = struct {
|
||||||
0,
|
0,
|
||||||
.{ .r = tint[0], .g = tint[1], .b = tint[2], .a = tint[3] },
|
.{ .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 {
|
pub fn unload(self: Texture) void {
|
||||||
|
|
Loading…
Reference in New Issue