just add everything!

This commit is contained in:
vfs committed 2026-01-13 22:52:26 +01:00
1 parent d639db711f
commit e439198097
5 files changed
+1973 -19

No files matched your search

+43 -18
View File
@@ -6,6 +6,7 @@ const bufzilla = @import("bufzilla");
const shared = @import("shared");
const kb = @import("kb");
const ft = @import("freetype");
const client = @import("client.zig");
const entity = @import("entity.zig");
@@ -41,13 +42,15 @@ pub fn main() !void {
// kbts_shape_context *Context = kbts_CreateShapeContext(0, 0);
_ = try ft.Library.init();
_ = kb.kbts_CreateShapeContext(null, null);
const shader = try rl.loadShader(null, "assets/test.frag");
// const shader = try rl.loadShader(null, "assets/test.frag");
const img = rl.genImageColor(32, 32, .blank);
const tx = try rl.loadTextureFromImage(img);
rl.unloadImage(img);
// const img = rl.genImageColor(32, 32, .blank);
// const tx = try rl.loadTextureFromImage(img);
// rl.unloadImage(img);
const host = try znet.Host.init(.{
.addr = null,
@@ -177,6 +180,29 @@ pub fn main() !void {
rl.beginDrawing();
// rl.beginShaderMode(shader);
rl.gl.rlBegin(rl.gl.rl_triangles);
// const color = rl.Color.init(255, 0, 255, 255);
const top : rl.Vector2 = .{ .x = @as(f32, @floatFromInt(rl.getScreenWidth())) / 2.0, .y = 0.0 };
const bottomLeft : rl.Vector2 = .{ .x = 0.0, .y = @floatFromInt(rl.getScreenHeight()) };
const bottomRight : rl.Vector2 = .{ .x = @floatFromInt(rl.getScreenWidth()), .y = @floatFromInt(rl.getScreenHeight()) };
// rl.gl.vertex
rl.gl.rlColor4ub(0, 255, 0, 255);
rl.gl.rlVertex2f(top.x, top.y);
rl.gl.rlColor4ub(255, 0, 0, 255);
rl.gl.rlVertex2f(bottomLeft.x, bottomLeft.y);
rl.gl.rlColor4ub(0, 0, 255, 255);
rl.gl.rlVertex2f(bottomRight.x, bottomRight.y);
// rl.gl.rlVertex2f(topRight.x, topRight.y);
// rl.gl.rlVertex2f(bottomLeft.x, bottomLeft.y);
// rl.gl.rlVertex2f(bottomRight.x, bottomRight.y);
rl.gl.rlEnd();
// rl.endShaderMode();
// const connected_text = "Connected";
//const not_connected_text = "Not Connected";
@@ -187,21 +213,20 @@ pub fn main() !void {
//@divFloor(rl.getScreenWidth(), 2) - @divFloor(rl.measureText(connected_text, f.baseSize), 2), 50
rl.beginShaderMode(shader);
// const font_size : i32 = 180;
// const text_size = rl.Vector2{.x = @floatFromInt(rl.measureText(connected_text, font_size)), .y = font_size};//rl.measureTextEx(try rl.getFontDefault(), connected_text, font_size, font_size / 10);
// const pos = rl.Vector2{.x = 0, .y = 0};
// rl.drawText(connected_text, pos.x, pos.y, font_size, .white);
// rl.drawRectangleLines(pos.x, pos.y, @intFromFloat(text_size.x), @intFromFloat(text_size.y), .red);
// rl.drawRectangle(pos.x, pos.y, rl.getScreenWidth(), rl.getScreenHeight(), .white);
rl.drawTexturePro(tx,
rl.Rectangle{.x = 0, .y = 0, .width = 32, .height = 32},
rl.Rectangle{.x = 100, .y = 100, .width = 500, .height = 500},
.{.x = 0, .y = 0},
0,
.white);
rl.endShaderMode();
// // const font_size : i32 = 180;
// // const text_size = rl.Vector2{.x = @floatFromInt(rl.measureText(connected_text, font_size)), .y = font_size};//rl.measureTextEx(try rl.getFontDefault(), connected_text, font_size, font_size / 10);
// // const pos = rl.Vector2{.x = 0, .y = 0};
// // rl.drawText(connected_text, pos.x, pos.y, font_size, .white);
// // rl.drawRectangleLines(pos.x, pos.y, @intFromFloat(text_size.x), @intFromFloat(text_size.y), .red);
// // rl.drawRectangle(pos.x, pos.y, rl.getScreenWidth(), rl.getScreenHeight(), .white);
// rl.drawTexturePro(tx,
// rl.Rectangle{.x = 0, .y = 0, .width = 32, .height = 32},
// rl.Rectangle{.x = 100, .y = 100, .width = 500, .height = 500},
// .{.x = 0, .y = 0},
// 0,
// .white);
//rl.drawLineV(.{.x = @floatFromInt(@divFloor(rl.getScreenWidth(), 2)), .y = 0}, .{.x = @floatFromInt(@divFloor(rl.getScreenWidth(), 2)), .y = @floatFromInt(rl.getScreenHeight())}, .red);
File diff suppressed because it is too large. Load diff