             self.codeViewController?.setTexture(filename: filename, index: index)
         }
         
+        //setup buttons
         let playBarItem = UIBarButtonItem(title: "Play", style: .plain, target: self, action: #selector(self.onPlayButtonTapped))
         let viewBarItem = UIBarButtonItem(title: "View", style: .plain, target: self, action: #selector(self.onViewButtonTapped))
         let texturesBarItem = UIBarButtonItem(title: "Textures", style: .plain, target: self, action: #selector(self.onTexturesButtonTapped))

        
        metalViewController = metalViewPanelContentVC.metalViewController
        
        metalViewController?.finishedCompiling = { result, compilerMessages in
            if result {
                if let codeViewController = self.codeViewController {

    }
    
    @objc func onTexturesButtonTapped(sender: UIBarButtonItem) {
        
        //show texture selector
        
        textureSelectorPanelVC.modalPresentationStyle = .popover
        textureSelectorPanelVC.popoverPresentationController?.barButtonItem = sender
        
