
import Foundation
import Metal

public class SpaceRocksRenderable: ConfiguredQuadRenderable<SpaceRocksRenderable.Config> {
    public struct Config: QuadRenderConfiguration {
        // matches GooWaves_Uniforms
        var resolution: ADVector2
        var time: ADFloat

        public init(
            resolution: ADVector2 = .ones,
            time: ADFloat = .zero
        ) {
            self.resolution = resolution
            self.time = time
        }

        public static var defaultConfiguration: Config {
            return Config()
        }
    }

    /// Name of the Metal fragment function in your `.metal` library
    override public var fragmentShaderName: String {
        return "space_rocks_fragment_main"
    }

    /// Hook to set up any extra state before drawing;
    /// here all your `Config` fields are bound automatically.
    override public var configureAction: ConfigureAction {
        return { encoder in
            super.configureAction(encoder)
            // if you ever need to tweak bindings manually, do it here
        }
    }
}
