Here is a simple fragment shader with uniform buffers:
const std = @import("std");
const gpu = std.gpu;
const UBO = extern struct {
object_color: @Vector(4, f32),
light_color: @Vector(4, f32),| const std = @import("std"); | |
| const net = std.net; | |
| const StreamServer = net.StreamServer; | |
| const Options = StreamServer.Options; | |
| const Address = net.Address; | |
| pub fn main() anyerror!void { | |
| const address = Address.initIp4([4]u8{ 127, 0, 0, 1 }, 8080); | |
| var stream = StreamServer.init(Options{ .reuse_address = true }); | |
| defer stream.deinit(); |
| use tokio::io::{AsyncReadExt, AsyncWriteExt}; | |
| use tokio::net::TcpListener; | |
| #[tokio::main] | |
| async fn main() -> Result<(), Box<dyn std::error::Error>> { | |
| let listener = TcpListener::bind("127.0.0.1:8080").await?; | |
| loop { | |
| let (mut socket, _) = listener.accept().await?; |