use pool::Pool;

use crate::system::*;
use super::vulkan::*;

pub struct Internal {
    supervisor:Sender<Query>,

    devices:Pool<()>,
    surfaces:Pool<()>,
    swapchains:Pool<()>,
    viewports:Pool<()>,
}
impl Internal {
    pub fn thread(supervisor:Sender<Query>, _tx:Sender<Query>, rx:Receiver<Query>)
    {
        let _sv = Internal {
            supervisor,

            devices:Pool::new(),
            surfaces:Pool::new(),
            swapchains:Pool::new(),
            viewports:Pool::new(),
        };

        // Initialize rendering system.
        if let Ok(_renderer) = Vulkan::init() {

            // Handle messages.
            while let Ok(msg) = rx.recv() {
                match &msg.data {
                    QueryData::Video(query) => match query {


                        _ => { }
                    }

                    _ => { }
                }
            }
        }
    }
}
