#pragma once #include #include #include struct Vertex { float position[2]; float color[3]; }; class Waterfall { public: Waterfall(wgpu::Device device, float x, float y, float width, float height, const std::string& title); ~Waterfall(); bool initialize(); void update(float time); void render(wgpu::RenderPassEncoder& pass, wgpu::RenderPipeline linePipeline, wgpu::RenderPipeline lineListPipeline, int windowWidth, int windowHeight); void toggleGrid(); private: std::vector generateGridLines(); std::vector generateBorder(); wgpu::Device device_; wgpu::Buffer vertexBuffer_; float x_, y_, width_, height_; std::string title_; bool showGrid_; std::vector> lines_; static constexpr int MAX_LINES = 50; static constexpr int POINTS_PER_LINE = 100; };