fn rect(backend: *Backend, rec: dimensions.Rect, rgb: dimensions.RGB) void { const self = @fieldParentPtr(Self, "backend", backend); const color = 0xFF000000 | @as(u32, rgb.r) << 16 | @as(u32, rgb.g) << 8 | rgb.b; var y = rec.top_left.y; while (y < rec.bottom_right.y) : (y += 1) { if (y > self.backend.height) unreachable; const offset = (y * backend.width); var x = rec.top_left.x; while (x < rec.bottom_right.x) : (x += 1) { if (x > self.backend.width) unreachable; //_setPixel(self, .{ .x = x, .y = y }, rgb); self.pixmap[offset + x] = color; } } }