use crate::gpu::GpuDevice;
use crate::model::{Material, Node, PrimitiveType};

/// A mesh uploaded to the GPU
#[derive(Debug, Clone)]
pub struct GpuMesh<G: GpuDevice> {
    /// Vertex buffer handle
    pub vertex_buffer: G::Buffer,
    /// Index buffer handle
    pub index_buffer: G::Buffer,
    /// Number of indices
    pub index_count: usize,
    /// Number of vertices
    pub vertex_count: usize,
    /// Material index
    pub material_index: Option<usize>,
    /// Primitive type
    pub primitive_type: PrimitiveType,
}

/// A model uploaded to the GPU
#[derive(Debug, Clone)]
pub struct GpuModel<G: GpuDevice> {
    /// Meshes
    pub meshes: Vec<GpuMesh<G>>,
    /// Materials (CPU data, typically uploaded to uniforms by renderer)
    pub materials: Vec<Material>,
    /// Textures (GPU handles)
    pub textures: Vec<G::Texture>,
    /// Nodes (Scene graph)
    pub nodes: Vec<Node>,
    /// Root node index
    pub scene_root: Option<usize>,
}
